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

Re: [PATCH] Add test for git rebase --abort

From
Mike Hommey <mh@glandium.org>
Date
Mar 1, 2008, 07:36 UTC
Message-ID
<20080301073612.GA26767@glandium.org>
In-Reply-To
<7v63w7bb06.fsf@gitster.siamese.dyndns.org>
On Fri, Feb 29, 2008 at 03:26:01PM -0800, Junio C Hamano wrote:
Show 8 quoted lines
> Mike Hommey <mh@glandium.org> writes:
> 
> >  The failing test is the third. I don't have enough knowledge in git-rebase
> >  to write an appropriate fix, but the problem seems to be in
> >  move_to_original_branch, where testing head_name doesn't seem appropriate.
> 
> Please mark such an "expected to succeed but fails due to
> suspected bug" with test_expect_failure.

I was kind of expecting the bug would be fixed before the test be included ;)

Show 5 quoted lines
> > +test_expect_success 'rebase --abort' '
> > +	! git rebase master &&
> 
> When making sure "git frotz" refuses gracefully (instead of
> segfault-and-burn), please say "test_must_fail git frotz".
Ooooh, I just saw 74359821.
Show 23 quoted lines
> > +# In case previous test failed
> > +git reset --hard pre-rebase >&3 2>&4
> > +rm -rf .dotest # Should be changed whenever rebase stop using .dotest
> 
> Have this kind of clean-up at the very beginning of the next
> test.  Test writers should not have to learn about file
> descriptors 3 and 4.
> 
>         Side note.  As a test framework extension, we might want
>         to add 4th parameter to test_expect_{success,failure}
>         that specifies a clean-up to be made regardless of the
>         outcome of the test.
> 
> > +test_expect_success 'rebase --abort after --skip' '
> > +	! git rebase master &&
> > +	! git rebase --skip &&
> > +	test $(git rev-parse HEAD) = $(git rev-parse master) &&
> > +	sh -x ../../git-rebase --abort &&
> > +	test $(git rev-parse to-rebase) = $(git rev-parse pre-rebase)
> > +'
> 
> I take that "sh -x ../../" is not for inclusion in the official
> release.
D'oh, I forgot to change that back.
Mike
Previous: Johannes SchindelinNext: Junio C Hamano
Message 4 of 12 in “Add test for git rebase --abort”
  1. Add test for git rebase --abortMike Hommey, Feb 29, 2008
  2. Junio C HamanoFeb 29, 2008
  3. Johannes SchindelinFeb 29, 2008
  4. Mike HommeyMar 1, 2008
  5. Junio C HamanoMar 1, 2008
  6. Mike HommeyMar 1, 2008
  7. Mike HommeyMar 1, 2008
  8. Junio C HamanoMar 1, 2008
  9. Fix git reset --abort not restoring the right commit under some conditionsMike Hommey, Mar 1, 2008
  10. Mike HommeyMar 1, 2008
  11. Junio C HamanoMar 2, 2008
  12. Junio C HamanoMar 2, 2008

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.