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

Re: [PATCH 8/9] Use git diff instead of diff in t7201

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 6, 2008, 02:10 UTC
Message-ID
<7vr6fq6di0.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<alpine.LNX.1.00.0802052011290.13593@iabervon.org>
Daniel Barkalow <barkalow@iabervon.org> writes:
Show 16 quoted lines
> On Tue, 5 Feb 2008, Junio C Hamano wrote:
>
>> Daniel Barkalow <barkalow@iabervon.org> writes:
>> 
>> > Well, it's something I tripped over when builtin-checkout wasn't passing 
>> > the tests and I couldn't figure out what it was doing wrong from the 
>> > output. Like [3/9], it's relevant to evaluating whether the series works, 
>> > even if it's not important for whether it actually does work.
>> 
>> Yeah, using "diff -u" instead of just "diff" is an improvement
>> for debuggability which matters a lot in the test scripts.
>
> I think I asked before and didn't hear back (or maybe I got distracted 
> and didn't ask); do you want this to use "diff -u" everywhere or "git 
> diff" everywhere? This test is currently part "diff" and part "git diff", 
> and I went for git diff" everywhere, but you seemed to prefer "diff -u".

Typically the test sequence is "do this with git, do that with git, produce the output with git, now what happened? did we produce a correct result?" And we often compare 'expect' and 'actual' to see if there are discrepancies.

My preference is NEVER using "git diff" when comparing expected result and the actual output from git. When "git diff" has breakage, it would break unrelated tests and make debugging needlessly harder.

We need to have tests for regressions in "git diff", but such a test would use "git diff" in earlier parts of the test sequence that _produce_ the output to be compared with expected result.

Previous: Daniel BarkalowNext: Daniel Barkalow
Message 6 of 8 in “Use git diff instead of diff in t7201”
  1. 8/9 Use git diff instead of diff in t7201Daniel Barkalow, Feb 4, 2008
  2. Johannes SchindelinFeb 5, 2008
  3. Daniel BarkalowFeb 5, 2008
  4. Junio C HamanoFeb 5, 2008
  5. Daniel BarkalowFeb 6, 2008
  6. Junio C HamanoFeb 6, 2008
  7. Daniel BarkalowFeb 6, 2008
  8. Junio C HamanoFeb 6, 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.