git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 1/3] rebase -r: do create merge commit after empty resolution

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Apr 1, 2025, 16:17 UTC
Message-ID
<417b8ff4-475b-6f00-0753-d3f9e3a528b5@gmx.de>
In-Reply-To
<CAPig+cThwsBdumXB3m2ZA-_tmDVTMojkYx7_YxNp49eK6a2HMg@mail.gmail.com>
Hi Eric,
On Fri, 28 Mar 2025, Eric Sunshine wrote:
Show 31 quoted lines
> On Fri, Mar 28, 2025 at 1:14 PM Eric Sunshine <sunshine@sunshineco.com> wrote:
> > On Fri, Mar 28, 2025 at 1:03 PM Philippe Blain via GitGitGadget
> > <gitgitgadget@gmail.com> wrote:
> > > diff --git a/t/t3418-rebase-continue.sh b/t/t3418-rebase-continue.sh
> > > +test_expect_success '--continue creates merge commit after empty resolution' '
> > > +       [...]
> > > +       git commit --no-edit &&
> > > +       FAKE_LINES="1 2 3 5 6 7 8 9 10 11" &&
> > > +       export FAKE_LINES &&
> > > +       test_must_fail git rebase -ir main &&
> >
> > I don't think you want to be setting FAKE_LINES like this since doing
> > so will pollute the environment for all tests following this one. You
> > can find existing precedent in this script which demonstrates the
> > correct way to handle this case. Specifically, you'd want:
> >
> >     test_must_fail env FAKE_LINES="1 2 3 5 6 7 8 9 10 11" \
> >         git rebase -ir main &&
>
> To clarify, by "pollute", I mean that it can impact subsequent tests
> which don't take care to override FAKE_LINES as necessary. There
> certainly are test scripts which use the:
>
>     FAKE_LINES=... &&
>     export FAKE_LINES &&
>
> form successfully, but such scripts are careful to override/set
> FAKE_LINES in every test. This particular script (t3418), on the other
> hand, does not otherwise employ the form in which the variable is
> exported, so introducing it in a test which is inserted into the
> middle of the script feels dangerous.

The entire `FAKE_LINES` paradigm is broken, and since I suspect that it was me who introduced it, I apologize.

A much better way to have done this would have been to write the string to a certain file, say, $(git rev-parse --git-path sequencer.pick-lines), and in the `fake-editor.sh`:

- test for the existence of that file, and if it exists
  - use its contents
  - delete that file

Ciao, Johannes

Previous: Eric SunshineNext: Phillip Wood
Message 5 of 17 in “rebase -r: a bugfix and two status-related improvements”
  1. 0/3 rebase -r: a bugfix and two status-related improvementsPhilippe Blain via GitGitGadget, Mar 28, 2025
  2. 1/3 rebase -r: do create merge commit after empty resolutionPhilippe Blain via GitGitGadget, Mar 28, 2025
  3. Eric SunshineMar 28, 2025
  4. Eric SunshineMar 28, 2025
  5. Johannes SchindelinApr 1, 2025
  6. Phillip WoodMar 31, 2025
  7. 2/3 wt-status: also abbreviate 'merge' and 'fixup -C' lines during rebasePhilippe Blain via GitGitGadget, Mar 28, 2025
  8. Phillip WoodMar 31, 2025
  9. 3/3 wt-status: suggest 'git rebase --continue' to conclude 'merge' instructionPhilippe Blain via GitGitGadget, Mar 28, 2025
  10. Phillip WoodMar 31, 2025
  11. Johannes SchindelinApr 1, 2025
  12. phillip.wood123@gmail.comApr 2, 2025
  13. Johannes SchindelinApr 3, 2025
  14. phillip.wood123@gmail.comApr 3, 2025
  15. Johannes SchindelinApr 4, 2025
  16. Phillip WoodApr 4, 2025
  17. Phillip WoodMar 31, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.