From: Jeff King Date: Sun, 06 Jun 2010 22:10:37 GMT Subject: Re: [PATCH 1/2] commit.c - provide commit-type to the hooks/pre-commit script Message-ID: <20100606221037.GE6993@coredump.intra.peff.net> In-Reply-To: <1275759590-16342-1-git-send-email-mlevedahl@gmail.com> On Sat, Jun 05, 2010 at 01:39:50PM -0400, Mark Levedahl wrote: > - if (!no_verify && run_hook(index_file, "pre-commit", NULL)) > + if (!no_verify && run_hook(index_file, "pre-commit", amend ? "amend" : "normal", NULL)) > [...] > - against=HEAD > + if test "$1" = "amend" > + then > + against=HEAD~1 > + else > + against=HEAD > + fi 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? -Peff