abcxyz / abcxyz/guardian

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

Aperta Adatta ai principianti
#177 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
enhancement
Lingua principale
Go
Stelle
26
Fork
7
Merge medio
1g 1h
PR unite (30g)
1

Descrizione

### 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.
```

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
git, go
Ambito
cli, developer-experience
Tipo di issue
Funzionalità
Difficoltà
2/5
Tempo stimato
1-3 ore
Stato di attività
Ferma
Chiarezza
Specificata chiaramente
Idoneità per principianti
65/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.