[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. Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano committed
Jan 22, 2007 at 13:03 UTC
83e24dce148fd384cbfb01cf718ec32618f6d8b3
1 file changed
+10
-9
git-commit.sh
+10
-9
@@ -462,15 +462,7 @@ if test -f "$GIT_DIR/MERGE_HEAD" && test -z "$no_edit"; then
462
fi >>"$GIT_DIR"/COMMIT_EDITMSG
463
464
# Author
465
-if test '' != "$force_author"
466
-then
467
- GIT_AUTHOR_NAME=`expr "z$force_author" : 'z\(.*[^ ]\) *<.*'` &&
468
- GIT_AUTHOR_EMAIL=`expr "z$force_author" : '.*\(<.*\)'` &&
469
- test '' != "$GIT_AUTHOR_NAME" &&
470
- test '' != "$GIT_AUTHOR_EMAIL" ||
471
- die "malformed --author parameter"
472
- export GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL
473
-elif test '' != "$use_commit"
465
+if test '' != "$use_commit"
466
then
467
pick_author_script='
468
/^author /{
@@ -501,6 +493,15 @@ then
493
export GIT_AUTHOR_EMAIL
494
export GIT_AUTHOR_DATE
495
fi
496
+if test '' != "$force_author"
497
+then
498
+ GIT_AUTHOR_NAME=`expr "z$force_author" : 'z\(.*[^ ]\) *<.*'` &&
499
+ GIT_AUTHOR_EMAIL=`expr "z$force_author" : '.*\(<.*\)'` &&
500
+ test '' != "$GIT_AUTHOR_NAME" &&
501
+ test '' != "$GIT_AUTHOR_EMAIL" ||
502
+ die "malformed --author parameter"
503
+ export GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL
504
+fi
505
506
PARENTS="-p HEAD"
507
if test -z "$initial_commit"