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

Re: [PATCH 1/2] t4151: document a pair of am --abort bugs

From
Elijah Newren <newren@gmail.com>
Date
Sep 8, 2021, 05:24 UTC
Message-ID
<CABPp-BE812VNn9Qq8bWdCMH0bMcaN8JqKJYt=XKC430y1eE=xA@mail.gmail.com>
In-Reply-To
<96e001e5-56d7-7806-19ad-ac41f833b0a7@gmail.com>
On Tue, Sep 7, 2021 at 10:13 PM Bagas Sanjaya <bagasdotme@gmail.com> wrote:
Show 61 quoted lines
>
> On 08/09/21 09.17, Elijah Newren via GitGitGadget wrote:
> > From: Elijah Newren <newren@gmail.com>
> >
> > Signed-off-by: Elijah Newren <newren@gmail.com>
> > ---
> >   t/t4151-am-abort.sh | 31 +++++++++++++++++++++++++++++++
> >   1 file changed, 31 insertions(+)
> >
> > diff --git a/t/t4151-am-abort.sh b/t/t4151-am-abort.sh
> > index 9d8d3c72e7e..501a7a9d211 100755
> > --- a/t/t4151-am-abort.sh
> > +++ b/t/t4151-am-abort.sh
> > @@ -23,7 +23,11 @@ test_expect_success setup '
> >               test_tick &&
> >               git commit -a -m $i || return 1
> >       done &&
> > +     git branch changes &&
> >       git format-patch --no-numbered initial &&
> > +     git checkout -b conflicting initial &&
> > +     echo different >>file-1 &&
> > +     git commit -a -m different &&
> >       git checkout -b side initial &&
> >       echo local change >file-2-expect
> >   '
> > @@ -191,4 +195,31 @@ test_expect_success 'am --abort leaves index stat info alone' '
> >       git diff-files --exit-code --quiet
> >   '
> >
> > +test_expect_failure 'git am --abort return failed exit status when it fails' '
> > +     test_when_finished "rm -rf file-2/ && git reset --hard" &&
> > +     git checkout changes &&
> > +     git format-patch -1 --stdout conflicting >changes.mbox &&
> > +     test_must_fail git am --3way changes.mbox &&
> > +
> > +     git rm file-2 &&
> > +     mkdir file-2 &&
> > +     echo precious >file-2/somefile &&
> > +     test_must_fail git am --abort &&
> > +     test_path_is_dir file-2/
> > +'
> > +
> > +test_expect_failure 'git am --abort returns us to a clean state' '
> > +     git checkout changes &&
> > +     git format-patch -1 --stdout conflicting >changes.mbox &&
> > +     test_must_fail git am --3way changes.mbox &&
> > +
> > +     # Make a change related to the rest of the am work
> > +     echo related change >>file-2 &&
> > +
> > +     # Abort, and expect the related change to go away too
> > +     git am --abort &&
> > +     git status --porcelain -uno >actual &&
> > +     test_must_be_empty actual
> > +'
> > +
> >   test_done
> >
>
> I expect BUGS section in git-am(1) to be added to describe known bugs
> you demonstrated above, judging from the patch subject.

There's no point documenting the first one since it'll be fixed by the next patch. As for the second, as I noted in my cover letter, I'm not quite sure that it really is a bug. If it isn't, the second testcase should be dropped. However, if the second testcase represents an actual bug rather than me just misjudging the intent, then your suggestion certainly makes sense.

Previous: Bagas SanjayaNext: Junio C Hamano
Message 4 of 15 in “A pair of git am --abort issues”
  1. 0/2 A pair of git am --abort issuesElijah Newren via GitGitGadget, Sep 8, 2021
  2. 1/2 t4151: document a pair of am --abort bugsElijah Newren via GitGitGadget, Sep 8, 2021
  3. Bagas SanjayaSep 8, 2021
  4. Elijah NewrenSep 8, 2021
  5. Junio C HamanoSep 8, 2021
  6. Elijah NewrenSep 8, 2021
  7. Junio C HamanoSep 8, 2021
  8. 2/2 am: fix incorrect exit status on am fail to abortElijah Newren via GitGitGadget, Sep 8, 2021
  9. Junio C HamanoSep 8, 2021
  10. Johannes SchindelinSep 8, 2021
  11. 0/3 A pair of git am --abort issuesElijah Newren via GitGitGadget, Sep 10, 2021
  12. 1/3 git-am.txt: clarify --abort behaviorElijah Newren via GitGitGadget, Sep 10, 2021
  13. 2/3 t4151: add a few am --abort testsElijah Newren via GitGitGadget, Sep 10, 2021
  14. 3/3 am: fix incorrect exit status on am fail to abortElijah Newren via GitGitGadget, Sep 10, 2021
  15. Johannes SchindelinSep 13, 2021

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.