Code

rebase -i: squash should retain the authorship of the _first_ commit
authorJohannes Schindelin <Johannes.Schindelin@gmx.de>
Sat, 29 Sep 2007 23:34:23 +0000 (00:34 +0100)
committerJunio C Hamano <gitster@pobox.com>
Sun, 30 Sep 2007 06:16:08 +0000 (23:16 -0700)
It was determined on the mailing list, that it makes more sense for a
"squash" to keep the author of the first commit as the author for the
result of the squash.

Make it so.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-rebase.txt
git-rebase--interactive.sh
t/t3404-rebase-interactive.sh

index 61b1810dbaa56bdc43364ea10d9a5ea0d532f1be..dfb8a0da5b9338940ce60f2c70bf1801241bc0f7 100644 (file)
@@ -293,7 +293,7 @@ rebasing.
 If you want to fold two or more commits into one, replace the command
 "pick" with "squash" for the second and subsequent commit.  If the
 commits had different authors, it will attribute the squashed commit to
-the author of the last commit.
+the author of the first commit.
 
 In both cases, or when a "pick" does not succeed (because of merge
 errors), the loop will stop to let you fix things, and you can continue
index 2fa53fdaeb3a24495f023e1f1f79da23e7e34f7c..653393d8c992a6d61e0b4443e3d106b32c718033 100755 (executable)
@@ -261,9 +261,9 @@ do_next () {
                esac
 
                failed=f
+               author_script=$(get_author_ident_from_commit HEAD)
                output git reset --soft HEAD^
                pick_one -n $sha1 || failed=t
-               author_script=$(get_author_ident_from_commit $sha1)
                echo "$author_script" > "$DOTEST"/author-script
                case $failed in
                f)
index 718c9c1fa31fa63fee65a7da857f0c9378af3c5c..6c92d61192570d0d1d7a35e1304e9c8046926410 100755 (executable)
@@ -180,7 +180,7 @@ test_expect_success 'squash' '
 '
 
 test_expect_success 'retain authorship when squashing' '
-       git show HEAD | grep "^Author: Nitfol"
+       git show HEAD | grep "^Author: Twerp Snog"
 '
 
 test_expect_success 'preserve merges with -p' '