[PATCH] git-gui: do not exit upon prepare-commit-msg hook failure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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





[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux