-
Notifications
You must be signed in to change notification settings - Fork 610
Open
Labels
investigatingThis is a bit weird, not sure if this is a bug yetThis is a bit weird, not sure if this is a bug yet
Description
Is your feature request related to a problem? Please describe.
I found it frustrating to manually debug a git issue when chezmoi couldn't perform a git commit.
Describe the solution you'd like
If committing to the local git repository is failing for some reason - chezmoi should show the user the error instead of silently failing and not logging that an edit with --apply failed to commit and push (for example).
Describe alternatives you've considered
None
Additional context
This could be seen as a bug - but in my case the error was due to my own incompetence - here's a way to replicate it:
- In your
~/.gitconfigadd a usersigningkeythat isn't on the machine and setup gpg. - make a change to a tracked file with
chezmoi edit --apply ~/.some_file - upon exiting the edit, chezmoi will print nothing and the exit code will be normal - i.e. the user may think that everything worked as expected.
- inspect local git repo to see it's in a dirty state with no commit (because git failed to sign the commit)
For example, this is the output I got:
➜ chezmoi edit --apply ~/.zshrc --verbose
This is what I'd expect:
➜ chezmoi edit --apply ~/.zshrc --verbose
chezmoi: failed to commit change:
<git log here>Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
investigatingThis is a bit weird, not sure if this is a bug yetThis is a bit weird, not sure if this is a bug yet