Hi Junio,

On Mon, 9 Jan 2017, Junio C Hamano wrote:

> Johannes Schindelin <[email protected]> writes:
> 
> > Changes since v2:
> >
> > - fixed a TRANSLATORS: comment
> > ...
> > - replaced a spawned `diff-tree` command by code using the diff functions
> >   directly
> 
> I just finished skimming the interdiff (the difference between the
> result of merging the v2 into 'master' and the result of applying
> this series on 'master').

I wish you would not have skimmed it, but provided a thorough review.
There was a rather serious bug in this (not the first problem introduced
into one of my patch series *because of* code review, unhidden-git and
mmap-regexec are also very recent examples, I really should learn to
resist the prodding to replace well-tested code with code of unknown
correctness).

The problem in this instance was that the authorship is no longer retained
when continuing after resolving a conflict. Let me stress again that this
has not been a problem with v1 of sequencer-i, nor with v2. The regression
was caused by changes required by the code review.

In case you wonder: Yes, I am upset by this.

The required fixup patch is:

-- snipsnap --
Subject: [PATCH] fixup! sequencer: make reading author-script more elegant

An unfortunate regression of formerly battle-tested code sadly crept
into Git for Windows v2.11.0(2): authorship was not retained in case of
conflicts during picks.

Signed-off-by: Johannes Schindelin <[email protected]>
---
 sequencer.c                   |  2 +-
 t/t3404-rebase-interactive.sh | 16 ++++++++++++++++
 2 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/sequencer.c b/sequencer.c
index 73b2ec6894..8ecab02291 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -612,7 +612,7 @@ static int read_env_script(struct argv_array *env)
                        count++;
                }
 
-       for (i = 0; i < count; i++) {
+       for (i = 0, p = script.buf; i < count; i++) {
                argv_array_push(env, p);
                p += strlen(p) + 1;
        }
diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh
index 71b9c8ef8b..61113be08a 100755
--- a/t/t3404-rebase-interactive.sh
+++ b/t/t3404-rebase-interactive.sh
@@ -237,6 +237,22 @@ test_expect_success 'retain authorship' '
        git show HEAD | grep "^Author: Twerp Snog"
 '
 
+test_expect_success 'retain authorship w/ conflicts' '
+       git reset --hard twerp &&
+       test_commit a conflict a conflict-a &&
+       git reset --hard twerp &&
+       GIT_AUTHOR_NAME=AttributeMe \
+       test_commit b conflict b conflict-b &&
+       set_fake_editor &&
+       test_must_fail git rebase -i conflict-a &&
+       echo resolved >conflict &&
+       git add conflict &&
+       git rebase --continue &&
+       test $(git rev-parse conflict-a^0) = $(git rev-parse HEAD^) &&
+       git show >out &&
+       grep AttributeMe out
+'
+
 test_expect_success 'squash' '
        git reset --hard twerp &&
        echo B > file7 &&
-- 
2.11.0.windows.3

Reply via email to