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

Re: Combined diff format: Show all filenames by default?

From
Junio C Hamano <gitster@pobox.com>
Date
May 3, 2024, 14:57 UTC
Message-ID
<xmqqmsp7aqoa.fsf@gitster.g>
In-Reply-To
<CADDzAfNz3R5yj1SdJYbBe0f8m3Sp-R+X6dRpYoJ8Foj6zijcDA@mail.gmail.com>
Kang-Che Sung <explorer09@gmail.com> writes:
Show 5 quoted lines
> My reason for making it default:
> ...
> As the "combined diff" format is likely to last for a long time, it
> would be good for Git to set a right default for presenting this
> format.

As the format HAS ALREADY lasted for a long time since its introduction in d8f4790e (diff-tree --cc: denser combined diff output for a merge commit., 2006-01-24), it is too late to change the default.

If a scripted use wants to parse out all the pathnames, it can write the option on the command line just once in the script file and forget about it.

For interactive use, the standard answer is "you can alias only for yourself in ~/.git/config", but unfortunately, because the alias works at the command level (e.g., an alias that allows "git lc" to work as "git log --cc --combined-all-paths" can be written), an optional behaviour like --combined-all-paths that is shared across a family of commands (e.g., "log" and "show" both would benefit) is a bit awkward to handle.

I wonder if introducing an "aliases for options" mechanism would improve the situation. Take an otherwise unused character sequence, say, cccc, and when you say "git <cmd> --cccc", pretend as if you said "git <cmd> --cc --combined-all-paths" from the command line.

Previous: Kang-Che SungNext: Kang-Che Sung
Message 2 of 5 in “Combined diff format: Show all filenames by default?”
  1. Kang-Che SungMay 3, 2024
  2. Junio C HamanoMay 3, 2024
  3. Kang-Che SungMay 3, 2024
  4. Junio C HamanoMay 3, 2024
  5. Kang-Che SungMay 3, 2024

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.