login
Header Space

 
 

Re: modifying commit's author

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: J. Bruce Fields <bfields@...>
Cc: <git@...>
Date: Monday, January 22, 2007 - 5:03 pm

Junio C Hamano <junkio@cox.net> writes:


Untested, but something along this line.

-- >8 --
[PATCH] honor --author even with --amend, -C, and -c.

Earlier code discarded GIT_AUTHOR_DATE taken from the base
commit when --author was specified.  This was often wrong as
that use is likely to fix the spelling of author's name.

---

diff --git a/git-commit.sh b/git-commit.sh
index e23918c..6f4dcdb 100755
--- a/git-commit.sh
+++ b/git-commit.sh
@@ -462,15 +462,7 @@ if test -f "$GIT_DIR/MERGE_HEAD" && test -z "$no_edit"; then
 fi >>"$GIT_DIR"/COMMIT_EDITMSG
 
 # Author
-if test '' != "$force_author"
-then
-	GIT_AUTHOR_NAME=`expr "z$force_author" : 'z\(.*[^ ]\) *<.*'` &&
-	GIT_AUTHOR_EMAIL=`expr "z$force_author" : '.*\(<.*\)'` &&
-	test '' != "$GIT_AUTHOR_NAME" &&
-	test '' != "$GIT_AUTHOR_EMAIL" ||
-	die "malformed --author parameter"
-	export GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL
-elif test '' != "$use_commit"
+if test '' != "$use_commit"
 then
 	pick_author_script='
 	/^author /{
@@ -501,6 +493,15 @@ then
 	export GIT_AUTHOR_EMAIL
 	export GIT_AUTHOR_DATE
 fi
+if test '' != "$force_author"
+then
+	GIT_AUTHOR_NAME=`expr "z$force_author" : 'z\(.*[^ ]\) *<.*'` &&
+	GIT_AUTHOR_EMAIL=`expr "z$force_author" : '.*\(<.*\)'` &&
+	test '' != "$GIT_AUTHOR_NAME" &&
+	test '' != "$GIT_AUTHOR_EMAIL" ||
+	die "malformed --author parameter"
+	export GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL
+fi
 
 PARENTS="-p HEAD"
 if test -z "$initial_commit"

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
modifying commit's author, J. Bruce Fields, (Mon Jan 22, 4:37 pm)
Re: modifying commit's author, Robin Rosenberg, (Mon Jan 22, 4:50 pm)
Re: modifying commit's author, J. Bruce Fields, (Mon Jan 22, 5:04 pm)
Re: modifying commit's author, Junio C Hamano, (Mon Jan 22, 4:48 pm)
Re: modifying commit's author, Junio C Hamano, (Mon Jan 22, 5:03 pm)
Re: modifying commit's author, J. Bruce Fields, (Mon Jan 22, 5:02 pm)
speck-geostationary