gitui icon indicating copy to clipboard operation
gitui copied to clipboard

Add no-verify commit command

Open dam5h opened this issue 3 years ago • 2 comments

This Pull Request fixes/closes #1374.

It changes the following:

  • Adds a "Commit no-verify" option to the commit workflow.

I think there is likely a cleaner way that just adds a "no-verify" or "no-hooks" option, but maybe this works fine. It seems the the amend workflow could probably still use this.

I followed the checklist:

  • [ ] I added unittests
  • [x] I ran make check without errors
  • [x] I tested the overall application
  • [ ] I added an appropriate item to the changelog

dam5h avatar Oct 04 '22 02:10 dam5h

yeah I think I would prefer an option that we can toggle with the new key and that resets back to the verify default after a commit.

extrawurst avatar Oct 15 '22 14:10 extrawurst

I have been using this and it does work fine with the amend workflow. I can look into adding it as an option, this makes for less "action" items on the menu bar, but does add a keystroke in the workflow. You have to set the option and then hit commit. As it is now, you can just hit ctrl-f to quickly force a commit. Maybe one use case for --no-verify is that you are is a rush anyway so I've found not having the extra step of a toggle (like in magit) to be kinda nice.

That said adding options to this menu could well be extended into other flags as well, so that could be a good thing.

I'd have to dig through the code a bit more to see how you are handing options, but happy to do so. Thanks for taking a look here.

Cheers! Dave

dam5h avatar Oct 15 '22 14:10 dam5h

Howdy @extrawurst , I've updated this to be a flag on the CommitComponent struct, which can be toggled on or off via Ctrl-f. When verify is true (the default), it shows Disable hooks [^f] in the menu, once toggled the menu shows Enable hooks [^f]

Let me know if this is what you had in mind, re: "toggle with new key". I'll be taking it for a spin for the rest of the week.

Cheers, Dave

dam5h avatar Oct 25 '22 02:10 dam5h

lgtm! Thanks you. will create the relevant changelog

extrawurst avatar Jan 13 '23 13:01 extrawurst

Thanks @extrawurst , I am really enjoying daily driving gitui!

dam5h avatar Jan 13 '23 18:01 dam5h