git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Felipe Contreras <felipe.contreras@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 4/4] t: branch: improve test rollback
Date: Sat, 7 Sep 2013 22:02:59 -0500	[thread overview]
Message-ID: <CAMP44s2PFVAKRUkEyN8BAH8C5UUMn21ou9hNkcOXaCsXscywHQ@mail.gmail.com> (raw)
In-Reply-To: <xmqq61ugo67v.fsf@gitster.dls.corp.google.com>

On Wed, Sep 4, 2013 at 12:19 PM, Junio C Hamano <gitster@pobox.com> wrote:
> 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".

Yes it is, because there are no better alternatives within our
ability, capacity, or realization.

http://www.merriam-webster.com/dictionary/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.

No, what if that test is skipped for some reason? Ideally each test
case should do 'git checkout $branch_i_need', not rely on the previous
tests to checkout the branch they need, but that requires too much
work to fix.

'git checkout -' works perfectly fine, and it's the closest we have to
my suggested test_checkout() which I think would be ideal, but I'm not
going to work on.

-- 
Felipe Contreras

  reply	other threads:[~2013-09-08  3:03 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
2013-09-08  3:02             ` Felipe Contreras [this message]
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=CAMP44s2PFVAKRUkEyN8BAH8C5UUMn21ou9hNkcOXaCsXscywHQ@mail.gmail.com \
    --to=felipe.contreras@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).