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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello.

On Fri, May 3, 2024 at 10:57 PM Junio C Hamano <gitster@xxxxxxxxx> wrote:
>
> Kang-Che Sung <explorer09@xxxxxxxxx> writes:
>
> > 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.

I wonder what things would break if we change the default behavior of this?

> 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.

Well, I won't expect the default to be changed for uses in scripts or
GUI frontends. I wish to change the default for interactive, terminal
uses, so that usability comes in "out of the box".

And I don't want the "alias command" workaround for a few reasons:

1. It seems like the `--combined-all-paths` would also affect the
"file-by-file" diff output ("git diff-index", "git diff-tree" and
like), and I am not requesting to change the default of this one.
2. The combined diff format is used in many places - including "git
diff" when there is a conflict, and a "git show" of a merge commit
when the merge was not trivial and human merging was involved.
3. And this diff output style should ideally be a "git config" option
that users can tweak it for personal preference (including reverting
to the old, "`--no-combined-all-paths`" behavior when needed).

I know there would be compatibility problems with GUIs and scripts if
we change the default like this, but the GUIs and scripts should fix
them, as git is already able to output three filename header lines for
the merge/combined diff. I just request to make it the default.





[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux