Re: git commit --verbose shows incorrect diff when pre-commit hook is used to modify files

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

 



Fernando Chorney <djsbx@xxxxxxxxx> writes:

> Hmm looks like I forgot to send my reply to this back to the mailing list.
>
> "Hmm, so I currently have it set to run vim as my commit editor, and
> enter the message in there most of the time. I can definitely see
> output from the hook into the shell before my vim editor loads up that
> shows me the diff and lets me add in the commit message. This leads me
> to believe that the pre-commit hook is being run before the editor
> (with the diff) pops up."
>
> Does anybody else have any insight to this issue?

I do not know if it counts as an insight, but the pre-* hooks, not
limited to pre-commit, were invented for the purpose of validating
the input to an operation so that the hooks can _reject_ if the
outcome anticipated does not satisfy project's conventions; the
purpose they were invented was not because the operations wanted to
allow the input to them.  So attempting to modify the tree in
pre-commit hook, for example, is outside the scope of its design and
I wouldn't be surprised if you get an unexpected result.



[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