Combined diff format: Show all filenames by default?

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

 



Dear Git developers,

I have a humble feature request, perhaps to address a usability
problem that annoyed me a lot.

When Git shows merge commits, it often present a diff called a
"combined diff" format. The documentation has an example
(https://git-scm.com/docs/diff-format#_combined_diff_format)

```
diff --combined describe.c
index fabadb8,cc95eb0..4866510
--- a/describe.c
+++ b/describe.c
@@@ -98,10 -98,8 +98,10 @@@
return (a_date > b_date) ? -1 : (a_date == b_date) ? 0 : 1;
 }

- static void describe(char *arg)
-static void describe(struct commit *cmit, int last_one)
++static void describe(char *arg, int last_one)
 {
+ unsigned char sha1[20];
+ struct commit *cmit;
struct commit_list *list;
static int initialized = 0;
struct commit_name *n;
```

The from-file/to-file header is my main concern. It shows two lines by default:

```
--- a/describe.c
+++ b/describe.c
```

Although the documentation says it allows `--combined-all-paths`
option to show all N+1 lines:

```
--- a/file
--- a/file
--- a/file
+++ b/file
```

Why isn't this the default? I am requesting it to show the filenames
of all parent by default, for the line-by-line combined diff format.

My reason for making it default:

1. When the format is an N-way diff format, we can make it obvious
that the comparison is N-way, not two-way, by listing more than two
filenames.

2. Even though the duplicated `--- a/file` filename lines might look
redundant, it's the _number_ of those lines that matters - how many
files are involved in a diff comparison. (In contrast, showing only
two filenames is confusing.)

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.

Thank you.




[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