Re: [PATCH v2 1/2] t3418: add testcase showing problems with rebase -i and strategy options
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 27, 2018, 16:54 UTC
- Message-ID
- <xmqqh8logofg.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <CABPp-BFkjF5z6axqW-v=zPq9U9sOQGpUKK+WvLknkkGzX-F4rA@mail.gmail.com>
Elijah Newren <newren@gmail.com> writes:
Show 19 quoted lines
>>> + chmod +x test-bin/git-merge-funny && >>> + ( >>> + PATH=./test-bin:$PATH >> >> Broken &&-chain (in subshell). >> >>> + test_must_fail git rebase -i -s funny -Xopt -Xfoo master topic >>> + ) && >>> + test -f funny.was.run && >>> + rm funny.was.run && >>> + echo "Resolved" >F2 && >>> + git add F2 && >>> + ( >>> + PATH=./test-bin:$PATH >> >> Ditto. >> > > I'm just trying to prove how important your other patch series is. ;-)
Actually, this shows why the other patch series, especially its last step, is problematic a bit. The above assignments are followed by a single command, i.e.
+ ( + PATH=./test-bin:$PATH + test_must_fail git rebase -i -s funny -Xopt -Xfoo master topic + ) &&
+ ( + PATH=./test-bin:$PATH + git rebase --continue + ) &&
and it would be reasonable to assume that these variable assignments would not fail. IOW, there is no BUG in breaking &&-chain at these two places. It is merely that the automated mechanism introduced by step 29/29 of that other series does not understand that (which is expected). It is not wrong to have && at the end of the assignment, though.
Having said that, it would be simpler for at least the latter to write it using a single-shot environment assignment, perhaps? I.e.
PATH=./test-bin:$PATH git rebase --continue &&
without running in a subshell?