Thread (7 messages) flat view 7 messages, 3 authors, 2016-06-15

Re: [PATCH 1/2] commit.c - provide commit-type to the hooks/pre-commit script

From: Jeff King <hidden>
Date: 2016-06-15 22:48:55

On Mon, Jun 07, 2010 at 08:26:53AM +0200, Johannes Sixt wrote:
quoted
Is there a reason to use the magic "amend" and "normal" words, if
scripts are just going to end up changing them back into HEAD~1 and HEAD
anyway?
pre-commit might act differently when a commit is amended, the most likely
reason I can think of is to always allow to amend. When you have only a
SHA1, you can get that information only with an additional process.
Actually, I meant to provide the hook with the literal words "HEAD~1"
and "HEAD", not the sha1. So they are effectively magic words, but they
also happen to be useful for directly feeding to git commands.

It also extends naturally to indicating a merge commit ("HEAD" or
"HEAD~1" followed by some other ref). I don't know if that is useful or
not, but it seems like the same realm of information as whether or not
we are amending.

-Peff
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help