From 126facf8219177bc265be725a8579c86ebdf99a5 Mon Sep 17 00:00:00 2001 From: Eric Sunshine Date: Sun, 22 Jul 2018 05:57:05 -0400 Subject: format-patch: add --interdiff option to embed diff in cover letter When submitting a revised version of a patch series, it can be helpful (to reviewers) to include a summary of changes since the previous attempt in the form of an interdiff, however, doing so involves manually copy/pasting the diff into the cover letter. Add an --interdiff option to automate this process. The argument to --interdiff specifies the tip of the previous attempt against which to generate the interdiff. For example: git format-patch --cover-letter --interdiff=v1 -3 v2 The previous attempt and the patch series being formatted must share a common base. Signed-off-by: Eric Sunshine Signed-off-by: Junio C Hamano --- revision.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'revision.h') diff --git a/revision.h b/revision.h index bf2239f876..61931fbac5 100644 --- a/revision.h +++ b/revision.h @@ -212,6 +212,10 @@ struct rev_info { /* notes-specific options: which refs to show */ struct display_notes_opt notes_opt; + /* interdiff */ + const struct object_id *idiff_oid1; + const struct object_id *idiff_oid2; + /* commit counts */ int count_left; int count_right; -- cgit v1.2.3 From 5ac290f9c00edb8963585c322fae9fb06a98167d Mon Sep 17 00:00:00 2001 From: Eric Sunshine Date: Sun, 22 Jul 2018 05:57:06 -0400 Subject: format-patch: teach --interdiff to respect -v/--reroll-count The --interdiff option introduces the embedded interdiff generically as "Interdiff:", however, we can do better when --reroll-count is specified by emitting "Interdiff against v{n}:" instead. Signed-off-by: Eric Sunshine Signed-off-by: Junio C Hamano --- revision.h | 1 + 1 file changed, 1 insertion(+) (limited to 'revision.h') diff --git a/revision.h b/revision.h index 61931fbac5..ffeadc261a 100644 --- a/revision.h +++ b/revision.h @@ -215,6 +215,7 @@ struct rev_info { /* interdiff */ const struct object_id *idiff_oid1; const struct object_id *idiff_oid2; + const char *idiff_title; /* commit counts */ int count_left; -- cgit v1.2.3