public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox•com>
To: Felipe Contreras <felipe.contreras@gmail•com>
Cc: git@vger•kernel.org
Subject: Re: [PATCH 4/4] t: branch: improve test rollback
Date: Wed, 04 Sep 2013 10:19:00 -0700	[thread overview]
Message-ID: <xmqq61ugo67v.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <CAMP44s1Q6YjVnVz3OnT=cE+ozUddBxFzM1r_WT5QoR7sP6-9Sg@mail.gmail.com> (Felipe Contreras's message of "Tue, 3 Sep 2013 18:03:09 -0500")

Felipe Contreras <felipe.contreras@gmail•com> writes:

> On Tue, Sep 3, 2013 at 5:59 PM, Junio C Hamano <gitster@pobox•com> wrote:
>> Felipe Contreras <felipe.contreras@gmail•com> writes:
>>
>>> On Tue, Sep 3, 2013 at 2:32 PM, Junio C Hamano <gitster@pobox•com> wrote:
>>>> Felipe Contreras <felipe.contreras@gmail•com> writes:
>>>
>>>>>  test_expect_success 'refuse --edit-description on unborn branch for now' '
>>>>> +     test_when_finished "git checkout -" &&
>>>>
>>>> I am not sure if this is a good change.  Depending on the outcome of
>>>> the "git checkout" in the test (it may succeed and set @{-1} to the
>>>> branch we were on when we entered the test, or it may fail and leave
>>>> @{-1} to the branch before we were on when we entered the test),
>>>> this will take us to a different place, no?
>>>
>>> It is better than leaving Git in an unborn branch.
>>
>> True, but it falls short of "After every test the environment should
>> be as close as to how it was before as possible.", doesn't it?
>
> No it doesn't. Closer is closer.

Closer is not "as close as ... possible".

I think the fix is just to use the name of a concrete branch we want
the next test to start on, instead of "-", which could be far
quickly done than making excuses like that.

  reply	other threads:[~2013-09-04 17:19 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-31  4:31 [PATCH 0/4] t: branch: fixes and cleanups Felipe Contreras
2013-08-31  4:31 ` [PATCH 1/4] t: branch: trivial style fix Felipe Contreras
2013-09-03 19:13   ` Junio C Hamano
2013-08-31  4:31 ` [PATCH 2/4] t: branch: fix typo Felipe Contreras
2013-08-31  4:31 ` [PATCH 3/4] t: branch: fix broken && chains Felipe Contreras
2013-08-31  4:31 ` [PATCH 4/4] t: branch: improve test rollback Felipe Contreras
2013-09-03 19:32   ` Junio C Hamano
2013-09-03 22:10     ` Felipe Contreras
2013-09-03 22:59       ` Junio C Hamano
2013-09-03 23:03         ` Felipe Contreras
2013-09-04 17:19           ` Junio C Hamano [this message]
2013-09-08  3:02             ` Felipe Contreras
2013-09-08  4:56               ` Jeff King
2013-09-08  5:01                 ` Felipe Contreras

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqq61ugo67v.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox$(echo .)com \
    --cc=felipe.contreras@gmail$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox