Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retain commit message after pre-commit hook failure #854

Open
willbowditch opened this issue May 19, 2020 · 1 comment
Open

Retain commit message after pre-commit hook failure #854

willbowditch opened this issue May 19, 2020 · 1 comment

Comments

@willbowditch
Copy link

@willbowditch willbowditch commented May 19, 2020

Is your feature request related to a problem? Please describe.
If pre-commit modifies a file, such as code formatting, the lazygit interface reloads, but staging the modified file and committing again requires retyping the commit message.

Specifically this happens with github.com/psf/black plugin, but I guess the issue will apply to any hook that modifies a file and reports a failure.

Describe the solution you'd like
It would be good if the commit message was retained in this scenario - so you can quickly stage the reformatted file

Describe alternatives you've considered
None.

Additional context

This event triggers it:

black....................................................................Failed
- hook id: black
- files were modified by this hook
@jesseduffield
Copy link
Owner

@jesseduffield jesseduffield commented Aug 23, 2020

Sounds like we'd need to set a flag to false upon submitting the message and if an error occurs afterwards we set it to true, then next time we open the commit message view we only clear it based on that flag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.