abcxyz / abcxyz/guardian

[change-detect] log helpful error message when git history is not available

Offen Anfängerfreundlich
#177 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
enhancement
Vorherrschende Sprache
Go
Sterne
26
Forks
7
Ø Merge
1 T. 1 Std.
Gemergte PRs (30 T.)
1

Beschreibung

### TL;DR

Change detection in guardian requires fetch-depth on the checkout action. When this requirement isn't met a generic error message is shown to the user. Instead we should detect whether the history is there and log a message suggesting adding the fetch-depth.

### Detailed design

Current error message looks like:

```
fatal: ambiguous argument 'HEAD~1': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git [...] -- [...]'
dirname: missing operand
Try 'dirname --help' for more information.
Error: Process completed with exit code 123.
```

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Look for the change detection logic in the codebase, likely in a command or utility that runs git commands. Find where the error 'HEAD~1' is used. Add a check for git history availability before that command and log a helpful message about setting fetch-depth. Run the guardian CLI in a test environment without full git history to verify the new error message appears.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
git, go
Bereich
cli, developer-experience
Issue-Typ
Feature
Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Aktivitätsstatus
Veraltet
Klarheit
Klar beschrieben
Anfängerfreundlichkeit
65/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.