gitui icon indicating copy to clipboard operation
gitui copied to clipboard

Cache commit message in case commit is aborted

Open stevejalim opened this issue 3 years ago • 4 comments

Is your feature request related to a problem? Please describe. When using pre-commit hooks, it's possible that a well-intentioned commit will be rejected by those hooks. If one has just written a long commit message (using the external editor or just the smaller in-GUI dialog) and the commit is aborted, the commit note is lost.

Describe the solution you'd like It would be great if the commit message was cached/stashed somewhere to avoid rework in the case of commit failure.

Additional context I'm personally using the pre-commit framework, but I think this stands for anyone using pre-commit hooks

stevejalim avatar Jan 19 '22 14:01 stevejalim

Can you link me that pre commit framework you were referring to? I am asking cause I recently looked into husky for #1019

extrawurst avatar Jan 19 '22 14:01 extrawurst

Sure thing - it's https://pre-commit.com/ - and gitui does run the hooks, happily 😄

There's also Therapist which does a similar job

stevejalim avatar Jan 19 '22 15:01 stevejalim

Also see #937

extrawurst avatar Jan 19 '22 15:01 extrawurst

This issue has been automatically marked as stale because it has not had any activity half a year. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jul 30 '22 18:07 stale[bot]

I am not sure what the problem is. If I create a pre-commit hook that always rejects it does not clear the commit message?

Screenshot 2022-09-18 at 16 25 20

extrawurst avatar Sep 18 '22 14:09 extrawurst

this was actually implemented in 6249491 and released in 0.20

extrawurst avatar Sep 18 '22 14:09 extrawurst