Re: Unexpected behavior when git-adding files in a pre-commit hook then using "git commit -o"
- From
Junio C Hamano <gitster@pobox.com>
- Date
- May 4, 2015, 18:03 UTC
- Message-ID
- <xmqqvbg8rzij.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <463FC822-916F-4160-A1F2-B4AAEFF3A5B2@gmail.com>
Michaël Fortin <fortinmike@gmail.com> writes:
> I’ve encountered unexpected behavior performing a git add from a > pre-commit hook, followed by performing a commit using the “-o” > flag,...
As pre-commit is a verification (and rejection) mechanism, not a mechanism to tweak what is to be commited, it is totally expected that its behaviour is unspecified when you modify anything in it.
I think I saw a similar confusion posted to the list once in the past few years. Perhaps we would need a documentation patch to clarify this.
Thanks.