git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Mark Levedahl <mlevedahl@gmail.com>
Date
Jun 7, 2010, 00:21 UTC
Message-ID
<4C0C3B82.3030504@gmail.com>
In-Reply-To
<20100606221037.GE6993@coredump.intra.peff.net>
On 06/06/2010 06:10 PM, Jeff King wrote:
Show 21 quoted lines
> 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
>
>    

Well, git-gui's internal $commit_type variable has the values normal|amend, so I went with those. So , yes there is a reason, but maybe not a great one :^). Given some consensus, this is trivial to change. I'll let things cook a while longer before sending a new patch.

Mark
Previous: Jeff KingNext: Johannes Sixt
Message 4 of 7 in “commit.c - provide commit-type to the hooks/pre-commit script”
  1. 1/2 commit.c - provide commit-type to the hooks/pre-commit scriptMark Levedahl, Jun 5, 2010
  2. 2/2 git-gui - provide commit-type to the hooks/pre-commit scriptMark Levedahl, Jun 5, 2010
  3. Jeff KingJun 6, 2010
  4. Mark LevedahlJun 7, 2010
  5. Johannes SixtJun 7, 2010
  6. Jeff KingJun 7, 2010
  7. Mark LevedahlJun 8, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.