format-patch: use --compact-summary instead of --summary
PATCH 1/1 format-patch: use --compact-summary instead of --summary
For reviewers, a couple fewer lines from diffstat (either cover letter or patches) is a good thing because there's less to read.
---
I realize that rename percentage is lost with this change. I just hope that nobody cares about that, or I'll have to implement rename percentage in --compact-summary too in order to move this patch forward.
builtin/log.c | 9 +++++--- ...tach_--stdout_--suffix=.diff_initial..side | 7 +++--- ...at-patch_--attach_--stdout_initial..master | 19 +++++++--------- ...t-patch_--attach_--stdout_initial..master^ | 12 +++++----- ...rmat-patch_--attach_--stdout_initial..side | 7 +++--- ..._--stdout_--numbered-files_initial..master | 19 +++++++--------- ..._--subject-prefix=TESTCASE_initial..master | 19 +++++++--------- ...at-patch_--inline_--stdout_initial..master | 19 +++++++--------- ...t-patch_--inline_--stdout_initial..master^ | 12 +++++----- ...-patch_--inline_--stdout_initial..master^^ | 7 +++--- ...rmat-patch_--inline_--stdout_initial..side | 7 +++--- ...-stdout_--cover-letter_-n_initial..master^ | 22 ++++++++----------- ...tch_--stdout_--no-numbered_initial..master | 19 +++++++--------- ...-patch_--stdout_--numbered_initial..master | 19 +++++++--------- ...diff.format-patch_--stdout_initial..master | 19 +++++++--------- ...iff.format-patch_--stdout_initial..master^ | 12 +++++----- .../diff.format-patch_--stdout_initial..side | 7 +++--- t/t4052-stat-output.sh | 4 ++-- 18 files changed, 103 insertions(+), 136 deletions(-)
builtin/log.c +6 -3
@@ -1062,7 +1062,8 @@ static void make_cover_letter(struct rev_info *rev, int use_stdout,return ;memcpy (&opts, &rev->diffopt,sizeof (opts)); - opts.output_format =DIFF_FORMAT_SUMMARY |DIFF_FORMAT_DIFFSTAT ; + opts.output_format =DIFF_FORMAT_DIFFSTAT ; + opts.flags.stat_with_summary =1 ; opts.stat_width =MAIL_DEFAULT_WRAP ;diff_setup_done (&opts);
@@ -1615,8 +1616,10 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)if (!use_patch_format && (!rev.diffopt.output_format || - rev.diffopt.output_format ==DIFF_FORMAT_PATCH )) - rev.diffopt.output_format =DIFF_FORMAT_DIFFSTAT |DIFF_FORMAT_SUMMARY ; + rev.diffopt.output_format ==DIFF_FORMAT_PATCH )) { + rev.diffopt.output_format =DIFF_FORMAT_DIFFSTAT ; + rev.diffopt.flags.stat_with_summary =1 ; + }if (!rev.diffopt.stat_width) rev.diffopt.stat_width =MAIL_DEFAULT_WRAP ;
t/t4013/diff.format-patch_--attach_--stdout_--suffix=.diff_initial..side +3 -4
@@ -12,11 +12,10 @@ Content-Type: text/plain; charset=UTF-8; format=fixed Content-Transfer-Encoding: 8bit --- - dir/sub | 2 ++ - file0 | 3 +++ - file3 | 4 ++++ + dir/sub | 2 ++ + file0 | 3 +++ + file3 (new) | 4 ++++ 3 files changed, 9 insertions(+) - create mode 100644 file3 --------------g-i-t--v-e-r-s-i-o-n
t/t4013/diff.format-patch_--attach_--stdout_initial..master +8 -11
@@ -14,11 +14,10 @@ Content-Transfer-Encoding: 8bit This is the second commit. --- - dir/sub | 2 ++ - file0 | 3 +++ - file2 | 3 --- + dir/sub | 2 ++ + file0 | 3 +++ + file2 (gone) | 3 --- 3 files changed, 5 insertions(+), 3 deletions(-) - delete mode 100644 file2 --------------g-i-t--v-e-r-s-i-o-n
@@ -73,10 +72,9 @@ Content-Type: text/plain; charset=UTF-8; format=fixed Content-Transfer-Encoding: 8bit --- - dir/sub | 2 ++ - file1 | 3 +++ + dir/sub | 2 ++ + file1 (new) | 3 +++ 2 files changed, 5 insertions(+) - create mode 100644 file1 --------------g-i-t--v-e-r-s-i-o-n
@@ -121,11 +119,10 @@ Content-Type: text/plain; charset=UTF-8; format=fixed Content-Transfer-Encoding: 8bit --- - dir/sub | 2 ++ - file0 | 3 +++ - file3 | 4 ++++ + dir/sub | 2 ++ + file0 | 3 +++ + file3 (new) | 4 ++++ 3 files changed, 9 insertions(+) - create mode 100644 file3 --------------g-i-t--v-e-r-s-i-o-n
t/t4013/diff.format-patch_--attach_--stdout_initial..master^ +5 -7
@@ -14,11 +14,10 @@ Content-Transfer-Encoding: 8bit This is the second commit. --- - dir/sub | 2 ++ - file0 | 3 +++ - file2 | 3 --- + dir/sub | 2 ++ + file0 | 3 +++ + file2 (gone) | 3 --- 3 files changed, 5 insertions(+), 3 deletions(-) - delete mode 100644 file2 --------------g-i-t--v-e-r-s-i-o-n
@@ -73,10 +72,9 @@ Content-Type: text/plain; charset=UTF-8; format=fixed Content-Transfer-Encoding: 8bit --- - dir/sub | 2 ++ - file1 | 3 +++ + dir/sub | 2 ++ + file1 (new) | 3 +++ 2 files changed, 5 insertions(+) - create mode 100644 file1 --------------g-i-t--v-e-r-s-i-o-n
t/t4013/diff.format-patch_--attach_--stdout_initial..side +3 -4
@@ -12,11 +12,10 @@ Content-Type: text/plain; charset=UTF-8; format=fixed Content-Transfer-Encoding: 8bit --- - dir/sub | 2 ++ - file0 | 3 +++ - file3 | 4 ++++ + dir/sub | 2 ++ + file0 | 3 +++ + file3 (new) | 4 ++++ 3 files changed, 9 insertions(+) - create mode 100644 file3 --------------g-i-t--v-e-r-s-i-o-n
t/t4013/diff.format-patch_--inline_--stdout_--numbered-files_initial..master +8 -11
@@ -14,11 +14,10 @@ Content-Transfer-Encoding: 8bit This is the second commit. --- - dir/sub | 2 ++ - file0 | 3 +++ - file2 | 3 --- + dir/sub | 2 ++ + file0 | 3 +++ + file2 (gone) | 3 --- 3 files changed, 5 insertions(+), 3 deletions(-) - delete mode 100644 file2 --------------g-i-t--v-e-r-s-i-o-n
@@ -73,10 +72,9 @@ Content-Type: text/plain; charset=UTF-8; format=fixed Content-Transfer-Encoding: 8bit --- - dir/sub | 2 ++ - file1 | 3 +++ + dir/sub | 2 ++ + file1 (new) | 3 +++ 2 files changed, 5 insertions(+) - create mode 100644 file1 --------------g-i-t--v-e-r-s-i-o-n
@@ -121,11 +119,10 @@ Content-Type: text/plain; charset=UTF-8; format=fixed Content-Transfer-Encoding: 8bit --- - dir/sub | 2 ++ - file0 | 3 +++ - file3 | 4 ++++ + dir/sub | 2 ++ + file0 | 3 +++ + file3 (new) | 4 ++++ 3 files changed, 9 insertions(+) - create mode 100644 file3 --------------g-i-t--v-e-r-s-i-o-n
t/t4013/diff.format-patch_--inline_--stdout_--subject-prefix=TESTCASE_initial..master +8 -11
@@ -14,11 +14,10 @@ Content-Transfer-Encoding: 8bit This is the second commit. --- - dir/sub | 2 ++ - file0 | 3 +++ - file2 | 3 --- + dir/sub | 2 ++ + file0 | 3 +++ + file2 (gone) | 3 --- 3 files changed, 5 insertions(+), 3 deletions(-) - delete mode 100644 file2 --------------g-i-t--v-e-r-s-i-o-n
@@ -73,10 +72,9 @@ Content-Type: text/plain; charset=UTF-8; format=fixed Content-Transfer-Encoding: 8bit --- - dir/sub | 2 ++ - file1 | 3 +++ + dir/sub | 2 ++ + file1 (new) | 3 +++ 2 files changed, 5 insertions(+) - create mode 100644 file1 --------------g-i-t--v-e-r-s-i-o-n
@@ -121,11 +119,10 @@ Content-Type: text/plain; charset=UTF-8; format=fixed Content-Transfer-Encoding: 8bit --- - dir/sub | 2 ++ - file0 | 3 +++ - file3 | 4 ++++ + dir/sub | 2 ++ + file0 | 3 +++ + file3 (new) | 4 ++++ 3 files changed, 9 insertions(+) - create mode 100644 file3 --------------g-i-t--v-e-r-s-i-o-n
t/t4013/diff.format-patch_--inline_--stdout_initial..master +8 -11
@@ -14,11 +14,10 @@ Content-Transfer-Encoding: 8bit This is the second commit. --- - dir/sub | 2 ++ - file0 | 3 +++ - file2 | 3 --- + dir/sub | 2 ++ + file0 | 3 +++ + file2 (gone) | 3 --- 3 files changed, 5 insertions(+), 3 deletions(-) - delete mode 100644 file2 --------------g-i-t--v-e-r-s-i-o-n
@@ -73,10 +72,9 @@ Content-Type: text/plain; charset=UTF-8; format=fixed Content-Transfer-Encoding: 8bit --- - dir/sub | 2 ++ - file1 | 3 +++ + dir/sub | 2 ++ + file1 (new) | 3 +++ 2 files changed, 5 insertions(+) - create mode 100644 file1 --------------g-i-t--v-e-r-s-i-o-n
@@ -121,11 +119,10 @@ Content-Type: text/plain; charset=UTF-8; format=fixed Content-Transfer-Encoding: 8bit --- - dir/sub | 2 ++ - file0 | 3 +++ - file3 | 4 ++++ + dir/sub | 2 ++ + file0 | 3 +++ + file3 (new) | 4 ++++ 3 files changed, 9 insertions(+) - create mode 100644 file3 --------------g-i-t--v-e-r-s-i-o-n
t/t4013/diff.format-patch_--inline_--stdout_initial..master^ +5 -7
@@ -14,11 +14,10 @@ Content-Transfer-Encoding: 8bit This is the second commit. --- - dir/sub | 2 ++ - file0 | 3 +++ - file2 | 3 --- + dir/sub | 2 ++ + file0 | 3 +++ + file2 (gone) | 3 --- 3 files changed, 5 insertions(+), 3 deletions(-) - delete mode 100644 file2 --------------g-i-t--v-e-r-s-i-o-n
@@ -73,10 +72,9 @@ Content-Type: text/plain; charset=UTF-8; format=fixed Content-Transfer-Encoding: 8bit --- - dir/sub | 2 ++ - file1 | 3 +++ + dir/sub | 2 ++ + file1 (new) | 3 +++ 2 files changed, 5 insertions(+) - create mode 100644 file1 --------------g-i-t--v-e-r-s-i-o-n
t/t4013/diff.format-patch_--inline_--stdout_initial..master^^ +3 -4
@@ -14,11 +14,10 @@ Content-Transfer-Encoding: 8bit This is the second commit. --- - dir/sub | 2 ++ - file0 | 3 +++ - file2 | 3 --- + dir/sub | 2 ++ + file0 | 3 +++ + file2 (gone) | 3 --- 3 files changed, 5 insertions(+), 3 deletions(-) - delete mode 100644 file2 --------------g-i-t--v-e-r-s-i-o-n
t/t4013/diff.format-patch_--inline_--stdout_initial..side +3 -4
@@ -12,11 +12,10 @@ Content-Type: text/plain; charset=UTF-8; format=fixed Content-Transfer-Encoding: 8bit --- - dir/sub | 2 ++ - file0 | 3 +++ - file3 | 4 ++++ + dir/sub | 2 ++ + file0 | 3 +++ + file3 (new) | 4 ++++ 3 files changed, 9 insertions(+) - create mode 100644 file3 --------------g-i-t--v-e-r-s-i-o-n
t/t4013/diff.format-patch_--stdout_--cover-letter_-n_initial..master^ +9 -13
@@ -10,13 +10,11 @@ A U Thor (2): Second Third - dir/sub | 4 ++++ - file0 | 3 +++ - file1 | 3 +++ - file2 | 3 --- + dir/sub | 4 ++++ + file0 | 3 +++ + file1 (new) | 3 +++ + file2 (gone) | 3 --- 4 files changed, 10 insertions(+), 3 deletions(-) - create mode 100644 file1 - delete mode 100644 file2 -- g-i-t--v-e-r-s-i-o-n
@@ -28,11 +26,10 @@ Subject: [DIFFERENT_PREFIX 1/2] Second This is the second commit. --- - dir/sub | 2 ++ - file0 | 3 +++ - file2 | 3 --- + dir/sub | 2 ++ + file0 | 3 +++ + file2 (gone) | 3 --- 3 files changed, 5 insertions(+), 3 deletions(-) - delete mode 100644 file2 diff --git a/dir/sub b/dir/sub index 35d242b..8422d40 100644
@@ -73,10 +70,9 @@ Date: Mon, 26 Jun 2006 00:02:00 +0000 Subject: [DIFFERENT_PREFIX 2/2] Third --- - dir/sub | 2 ++ - file1 | 3 +++ + dir/sub | 2 ++ + file1 (new) | 3 +++ 2 files changed, 5 insertions(+) - create mode 100644 file1 diff --git a/dir/sub b/dir/sub index 8422d40..cead32e 100644
t/t4013/diff.format-patch_--stdout_--no-numbered_initial..master +8 -11
@@ -6,11 +6,10 @@ Subject: [PATCH] Second This is the second commit. --- - dir/sub | 2 ++ - file0 | 3 +++ - file2 | 3 --- + dir/sub | 2 ++ + file0 | 3 +++ + file2 (gone) | 3 --- 3 files changed, 5 insertions(+), 3 deletions(-) - delete mode 100644 file2 diff --git a/dir/sub b/dir/sub index 35d242b..8422d40 100644
@@ -51,10 +50,9 @@ Date: Mon, 26 Jun 2006 00:02:00 +0000 Subject: [PATCH] Third --- - dir/sub | 2 ++ - file1 | 3 +++ + dir/sub | 2 ++ + file1 (new) | 3 +++ 2 files changed, 5 insertions(+) - create mode 100644 file1 diff --git a/dir/sub b/dir/sub index 8422d40..cead32e 100644
@@ -85,11 +83,10 @@ Date: Mon, 26 Jun 2006 00:03:00 +0000 Subject: [PATCH] Side --- - dir/sub | 2 ++ - file0 | 3 +++ - file3 | 4 ++++ + dir/sub | 2 ++ + file0 | 3 +++ + file3 (new) | 4 ++++ 3 files changed, 9 insertions(+) - create mode 100644 file3 diff --git a/dir/sub b/dir/sub index 35d242b..7289e35 100644
t/t4013/diff.format-patch_--stdout_--numbered_initial..master +8 -11
@@ -6,11 +6,10 @@ Subject: [PATCH 1/3] Second This is the second commit. --- - dir/sub | 2 ++ - file0 | 3 +++ - file2 | 3 --- + dir/sub | 2 ++ + file0 | 3 +++ + file2 (gone) | 3 --- 3 files changed, 5 insertions(+), 3 deletions(-) - delete mode 100644 file2 diff --git a/dir/sub b/dir/sub index 35d242b..8422d40 100644
@@ -51,10 +50,9 @@ Date: Mon, 26 Jun 2006 00:02:00 +0000 Subject: [PATCH 2/3] Third --- - dir/sub | 2 ++ - file1 | 3 +++ + dir/sub | 2 ++ + file1 (new) | 3 +++ 2 files changed, 5 insertions(+) - create mode 100644 file1 diff --git a/dir/sub b/dir/sub index 8422d40..cead32e 100644
@@ -85,11 +83,10 @@ Date: Mon, 26 Jun 2006 00:03:00 +0000 Subject: [PATCH 3/3] Side --- - dir/sub | 2 ++ - file0 | 3 +++ - file3 | 4 ++++ + dir/sub | 2 ++ + file0 | 3 +++ + file3 (new) | 4 ++++ 3 files changed, 9 insertions(+) - create mode 100644 file3 diff --git a/dir/sub b/dir/sub index 35d242b..7289e35 100644
t/t4013/diff.format-patch_--stdout_initial..master +8 -11
@@ -6,11 +6,10 @@ Subject: [PATCH 1/3] Second This is the second commit. --- - dir/sub | 2 ++ - file0 | 3 +++ - file2 | 3 --- + dir/sub | 2 ++ + file0 | 3 +++ + file2 (gone) | 3 --- 3 files changed, 5 insertions(+), 3 deletions(-) - delete mode 100644 file2 diff --git a/dir/sub b/dir/sub index 35d242b..8422d40 100644
@@ -51,10 +50,9 @@ Date: Mon, 26 Jun 2006 00:02:00 +0000 Subject: [PATCH 2/3] Third --- - dir/sub | 2 ++ - file1 | 3 +++ + dir/sub | 2 ++ + file1 (new) | 3 +++ 2 files changed, 5 insertions(+) - create mode 100644 file1 diff --git a/dir/sub b/dir/sub index 8422d40..cead32e 100644
@@ -85,11 +83,10 @@ Date: Mon, 26 Jun 2006 00:03:00 +0000 Subject: [PATCH 3/3] Side --- - dir/sub | 2 ++ - file0 | 3 +++ - file3 | 4 ++++ + dir/sub | 2 ++ + file0 | 3 +++ + file3 (new) | 4 ++++ 3 files changed, 9 insertions(+) - create mode 100644 file3 diff --git a/dir/sub b/dir/sub index 35d242b..7289e35 100644
t/t4013/diff.format-patch_--stdout_initial..master^ +5 -7
@@ -6,11 +6,10 @@ Subject: [PATCH 1/2] Second This is the second commit. --- - dir/sub | 2 ++ - file0 | 3 +++ - file2 | 3 --- + dir/sub | 2 ++ + file0 | 3 +++ + file2 (gone) | 3 --- 3 files changed, 5 insertions(+), 3 deletions(-) - delete mode 100644 file2 diff --git a/dir/sub b/dir/sub index 35d242b..8422d40 100644
@@ -51,10 +50,9 @@ Date: Mon, 26 Jun 2006 00:02:00 +0000 Subject: [PATCH 2/2] Third --- - dir/sub | 2 ++ - file1 | 3 +++ + dir/sub | 2 ++ + file1 (new) | 3 +++ 2 files changed, 5 insertions(+) - create mode 100644 file1 diff --git a/dir/sub b/dir/sub index 8422d40..cead32e 100644
t/t4013/diff.format-patch_--stdout_initial..side +3 -4
@@ -5,11 +5,10 @@ Date: Mon, 26 Jun 2006 00:03:00 +0000 Subject: [PATCH] Side --- - dir/sub | 2 ++ - file0 | 3 +++ - file3 | 4 ++++ + dir/sub | 2 ++ + file0 | 3 +++ + file3 (new) | 4 ++++ 3 files changed, 9 insertions(+) - create mode 100644 file3 diff --git a/dir/sub b/dir/sub index 35d242b..7289e35 100644
t/t4052-stat-output.sh +2 -2
@@ -267,10 +267,10 @@ log -1 --stat EOF cat >expect72 <<'EOF' - ...aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | 1000 +++++++++++++++++ + ...aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa (new) | 1000 +++++++++++++++++ EOF cat >expect72-graph <<'EOF' -| ...aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | 1000 +++++++++++++++++ +| ...aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa (new) | 1000 +++++++++++++++++ EOF cat >expect200 <<'EOF' aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | 1000 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Signature · 1 line
2.16.2.903.gd04caf5039
Quoted 2 lines · Nguyễn Thái Ngọc Duy
For reviewers, a couple fewer lines from diffstat (either cover letter or patches) is a good thing because there's less to read.
I can certainly accept that there may be some reviewers who share that view, but me personally, I would rather have them outside the main diffstat section, so addition and removal of files that are rarer events do stand out.
I guess people would not mind an option to use it, but they can already say "git format-patch --compact-summary $upstream..", so...
Quoted 5 lines · Junio C Hamano
Quoted 2 lines · Nguyễn Thái Ngọc Duy
For reviewers, a couple fewer lines from diffstat (either cover letter or patches) is a good thing because there's less to read.
Quoted 7 lines
I can certainly accept that there may be some reviewers who share that view, but me personally, I would rather have them outside the main diffstat section, so addition and removal of files that are rarer events do stand out.
I guess people would not mind an option to use it, but they can already say "git format-patch --compact-summary $upstream..", so...
Good point. I can't negate --summary though. But that calls for another patch.
Signature · 1 line
Duy