Re: git gui replaces amend message when prepare-commit-msg hook is used
- From
Orgad Shaneh <orgads@gmail.com>
- Date
- Jul 4, 2013, 12:46 UTC
- Message-ID
- <CAGHpTBJhwzLdxiTynx-eBWj7wUwe4e6HPAB4g0jDHTeVF2rfeg@mail.gmail.com>
- In-Reply-To
- <CALWbr2zAt4a6vkQy8PhP-dH5eZ9_5VMzbiWqSEKE_1V5rsfh+A@mail.gmail.com>
On Thu, Jul 4, 2013 at 3:42 PM, Antoine Pelisse <apelisse@gmail.com> wrote:
Show 9 quoted lines
>>> Your problem is that your hook script is not checking $2 so it is >>> overwriting the message even when you do not want to do so. >> >> No, it isn't. Not by git-gui at least. Check /tmp/hook.log with the >> hook I provided... > > So what you mean is that the hook is not executed with the correct parameters? > Could you please provide the output of the /tmp/hook.log file (I can't > reproduce right now) ?
It only runs for "New commit" (possibly with merge or squash as arguments). In my case the log is: .git/PREPARE_COMMIT_MSG .git/PREPARE_COMMIT_MSG .git/PREPARE_COMMIT_MSG ...
Not running the hook for amend is another problem.
What I referred to was that handling the hook's result is done without checking if the state has changed while it was running, like Fredrik has already pointed out.
- Orgad