git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] git-gui: do not exit upon prepare-commit-msg hook failure
@ 2024-07-11 13:25 Anthony Loiseau
  2024-07-11 13:25 ` Anthony Loiseau
  2024-07-11 17:15 ` Eric Sunshine
  0 siblings, 2 replies; 4+ messages in thread
From: Anthony Loiseau @ 2024-07-11 13:25 UTC (permalink / raw)
  To: git
  Cc: Anthony Loiseau, Junio C Hamano, Pat Thoyts, Joshua Williams,
	Shawn O . Pearce

Targeted issue
==============

git-gui is currently unusable when prepare-commit-msg hook fails, since
it closes as soon as user dismiss modal error popup shown on start.

Proposal
========

Next mail is a proposal to make this failure non-fatal. Popup is still
shown but not in its fatal variant (which removes the "you must fix this
before commiting" unwanted sentence), and git-gui is not terminated upon
popup dismiss.

With this proposal, user is clearly aware of a prepare-commit-msg hook
failure but is not denied to use git-gui and can even commit.
Pre-filled commit message content is likely empty or not filled in this
case, which is not a big issue.

Other hooks are not affected. commit-msg hook and next ones are still
triggered upon commit action, telling commit can not be performed (fatal
variant of the popup) without terminating git-gui upon dismiss.

How to test
===========

cat > .git/hooks/fake_failing_hook <<EOF
#!/bin/sh
echo 'FAKE FAILING HOOK $0' >&2
exit 1
EOF

for i in .git/hooks/*.sample
do
	ln -svf fake_failing_hook "${i%%.sample}"
done

chmod u+x .git/hooks/*
rm .git/GITGUI_MSG
git gui


Anthony Loiseau (1):
  git-gui: do not exit upon prepare-commit-msg hook failure

 git-gui/git-gui.sh | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

-- 
2.45.2


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-07-13 20:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-11 13:25 [PATCH] git-gui: do not exit upon prepare-commit-msg hook failure Anthony Loiseau
2024-07-11 13:25 ` Anthony Loiseau
2024-07-13 20:50   ` Johannes Sixt
2024-07-11 17:15 ` Eric Sunshine

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).