All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Pasha Bolokhov <pasha.bolokhov@gmail.com>
Cc: "Johannes Sixt" <j6t@kdbg.org>, "Duy Nguyen" <pclouds@gmail.com>,
	"Jonathan Nieder" <jrnieder@gmail.com>,
	"Jakub Narębski" <jnareb@gmail.com>,
	"Git Mailing List" <git@vger.kernel.org>
Subject: Re: [PATCH v6] Add an explicit GIT_DIR to the list of excludes
Date: Fri, 13 Jun 2014 09:50:33 -0700	[thread overview]
Message-ID: <xmqqfvj84uue.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <CAKpPgvf=OGRHFv81x2b_PVqzALbSWHaJvejyy5w7aS_P+QFA6w@mail.gmail.com> (Pasha Bolokhov's message of "Fri, 13 Jun 2014 09:10:22 -0700")

Pasha Bolokhov <pasha.bolokhov@gmail.com> writes:

>>> +             test_cmp status.actual.2 status.expect.2
>>
>> It is customary to call the files 'expect' and 'actual'. Furthermore,
>> swap the order so that in case of a failure the diff shows how the
>> actual text was changed from the expected text:
>>
>>                 test_cmp status.expect.2 status.actual.2
>
> So, is naming the files "status.expect.2" instead of just
> "expect"/"actual" ok or not?

Unless there is a compelling reason not to, just use expect/actual,
without "status." or ".<number>".  When debugging, people pass the
"-i" (and often "-v") to the script which would stop at the first
breakage.  If they can inspect the result in "actual", that is far
more pleasant than having to know that it is status.actual.43 they
have to inspect while ignoring clutters in status.actual.{1-42} that
have nothing to do with the breakage they are dealing with.

> Ok, no problem, will change that. The only thing, I saw this in other
> tests, so decided to use it too. Those tests use "test_mighf_fail rm"

"might_fail" and "must_fail" are totally different beasts.
"must_fail" is about controlled failure exit (i.e. no segfaulting
allowed) and we avoid using it on non-git things.

When you run clean-up commands without knowing if there is anythning
to clean-up, e.g. you may or may not have successfully created a
junk file and you want to make sure that file does not exist.  It
happens that "rm junk" has a convenient option "-f" to make it not
barf upon missing "junk", so you can do so with "rm -f junk" instead
of saying "test_might_fail rm junk", but "might_fail" is designed to
be useful for commands that do not have such a convenient option.

  reply	other threads:[~2014-06-13 16:50 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-04 20:15 [PATCH v5] Add an explicit GIT_DIR to the list of excludes Pasha Bolokhov
2014-06-08 10:17 ` Duy Nguyen
2014-06-10  3:18   ` Pasha Bolokhov
2014-06-11 10:48     ` Duy Nguyen
2014-06-11 23:28       ` [PATCH v6] " Pasha Bolokhov
2014-06-12  6:19         ` Johannes Sixt
2014-06-13 16:10           ` Pasha Bolokhov
2014-06-13 16:50             ` Junio C Hamano [this message]
2014-06-14 19:16               ` [PATCH v8] " Pasha Bolokhov
2014-06-13 16:32           ` [PATCH v7] " Pasha Bolokhov

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=xmqqfvj84uue.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=j6t@kdbg.org \
    --cc=jnareb@gmail.com \
    --cc=jrnieder@gmail.com \
    --cc=pasha.bolokhov@gmail.com \
    --cc=pclouds@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.