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

Re: [PATCH RFC] diff --no-index: teach option to exclude files by pattern

From
Junio C Hamano <gitster@pobox.com>
Date
May 15, 2025, 18:09 UTC
Message-ID
<xmqqtt5lzqxh.fsf@gitster.g>
In-Reply-To
<CA+P7+xqg3S0q=n3nrTUJJuYicooDm83Q32AkpzRt1u7rH3n3Pw@mail.gmail.com>
Jacob Keller <jacob.keller@gmail.com> writes:
Show 7 quoted lines
> I guess the one weirdness is that pathspecs must come after the first
> 2 arguments, since we need to find 2 paths first. But this matches the
> way that treeish must come first in git diff-tree -r takes treeish and
> then pathspecs, and you can't re-order them arbitrarily either.
>
> Does this sound like a reasonable extension to the existing 2 argument
> form of git diff --no-index?
Absolutely.

Or you could even use "--" convention in the examples you would write in the documentation, even though you may not absolutely need it for the purpose of parsing the command line, to highlight the fact that two things to be compared is given and then with an optional pathspec after the two things, e.g.,

 $ git diff --no-index git-1.6.0 git-2.43.0 -- Documentation/
or something silly like that.
Previous: Jacob KellerNext: Jacob Keller
Message 4 of 5 in “diff --no-index: teach option to exclude files by pattern”
  1. diff --no-index: teach option to exclude files by patternJacob Keller, May 14, 2025
  2. Junio C HamanoMay 14, 2025
  3. Jacob KellerMay 15, 2025
  4. Junio C HamanoMay 15, 2025
  5. Jacob KellerMay 15, 2025

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.