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

Re: [ALTERNATIVE PATCH] diff file1 file2: do not default to --no-index inside a git repository

From
Junio C Hamano <gitster@pobox.com>
Date
May 24, 2008, 07:25 UTC
Message-ID
<7vskw8madq.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<alpine.DEB.1.00.0805232349410.30431@racer>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 8 quoted lines
> When calling "diff -- a b" where a exists in the index, but b does not,
> do not default to --no-index inside a git repository.
>
> For example,
>
> 	git mv a b && git diff a b
>
> would not have the expected result.

I think the rule should be much stricter and "git diff" should _not_ use no-index if run in a repository without --no-index.

I also suspect that your updates to the testsuite are grossly inadequate. Earlier "diff expect actual" was replaced with "git diff expect actual" against my good taste (TM) in many tests, and they need to either be replaced with "git diff --no-index" or (even better) "test_cmp".

No need to resend, as I did a rather unpleasant conversion of these places back to "test_cmp" already, but I'd appreciate an extra set of eyeballs to proofread that rather large fix to the testsuite.

Previous: Johannes SchindelinNext: Junio C Hamano
Message 6 of 11 in “git diff-files weirdness (bug?)”
  1. Catalin MarinasMay 23, 2008
  2. Linus TorvaldsMay 23, 2008
  3. Linus TorvaldsMay 23, 2008
  4. diff -- file1 file2: do not default to --no-index inside a git repositoryJohannes Schindelin, May 23, 2008
  5. diff file1 file2: do not default to --no-index inside a git repositoryJohannes Schindelin, May 23, 2008
  6. Junio C HamanoMay 24, 2008
  7. 1/3 tests: do not use implicit "git diff --no-index"Junio C Hamano, May 24, 2008
  8. 2/3 diff-files: do not play --no-index gamesJunio C Hamano, May 24, 2008
  9. 3/3 "git diff": do not ignore index without --no-indexJunio C Hamano, May 24, 2008
  10. Junio C HamanoMay 24, 2008
  11. Junio C HamanoMay 24, 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.