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: Mark Levedahl <hidden>
Date: 2016-06-15 22:48:55

On 06/06/2010 06:10 PM, Jeff King wrote:
On Sat, Jun 05, 2010 at 01:39:50PM -0400, Mark Levedahl wrote:

   
quoted
-	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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help