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

Re: [PATCH v6] Add an explicit GIT_DIR to the list of excludes

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 13, 2014, 16:50 UTC
Message-ID
<xmqqfvj84uue.fsf@gitster.dls.corp.google.com>
In-Reply-To
<CAKpPgvf=OGRHFv81x2b_PVqzALbSWHaJvejyy5w7aS_P+QFA6w@mail.gmail.com>
Pasha Bolokhov <pasha.bolokhov@gmail.com> writes:
Show 10 quoted lines
>>> +             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.

Previous: Pasha BolokhovNext: Pasha Bolokhov
Message 8 of 10 in “Add an explicit GIT_DIR to the list of excludes”
  1. Add an explicit GIT_DIR to the list of excludesPasha Bolokhov, Jun 4, 2014
  2. Duy NguyenJun 8, 2014
  3. Pasha BolokhovJun 10, 2014
  4. Duy NguyenJun 11, 2014
  5. Add an explicit GIT_DIR to the list of excludesPasha Bolokhov, Jun 11, 2014
  6. Johannes SixtJun 12, 2014
  7. Pasha BolokhovJun 13, 2014
  8. Junio C HamanoJun 13, 2014
  9. Add an explicit GIT_DIR to the list of excludesPasha Bolokhov, Jun 14, 2014
  10. Add an explicit GIT_DIR to the list of excludesPasha Bolokhov, Jun 13, 2014

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.