From: Junio C Hamano Date: Mon, 17 Sep 2018 20:53:56 +0000 (-0700) Subject: Merge branch 'es/format-patch-rangediff' X-Git-Tag: v2.20.0-rc0~239 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=881c019ea6a0a45f97fb8a1865a88b07263a02ca;p=git Merge branch 'es/format-patch-rangediff' "git format-patch" learned a new "--range-diff" option to explain the difference between this version and the previous attempt in the cover letter (or after the tree-dashes as a comment). * es/format-patch-rangediff: format-patch: allow --range-diff to apply to a lone-patch format-patch: add --creation-factor tweak for --range-diff format-patch: teach --range-diff to respect -v/--reroll-count format-patch: extend --range-diff to accept revision range format-patch: add --range-diff option to embed diff in cover letter range-diff: relieve callers of low-level configuration burden range-diff: publish default creation factor range-diff: respect diff_option.file rather than assuming 'stdout' --- 881c019ea6a0a45f97fb8a1865a88b07263a02ca diff --cc builtin/log.c index df42011312,f69b67b9ce..f09a5789f8 --- a/builtin/log.c +++ b/builtin/log.c @@@ -31,8 -31,8 +31,9 @@@ #include "progress.h" #include "commit-slab.h" #include "repository.h" +#include "commit-reach.h" #include "interdiff.h" + #include "range-diff.h" #define MAIL_DEFAULT_WRAP 72 diff --cc t/t3206-range-diff.sh index c94f9bf5ee,3d7a2d8a4d..88ebed1dfa --- a/t/t3206-range-diff.sh +++ b/t/t3206-range-diff.sh @@@ -142,43 -142,16 +142,55 @@@ test_expect_success 'changed message' test_cmp expected actual ' +test_expect_success 'dual-coloring' ' + sed -e "s|^:||" >expect <<-\EOF && + :1: a4b3333 = 1: f686024 s/5/A/ + :2: f51d370 ! 2: 4ab067d s/4/A/ + : @@ -2,6 +2,8 @@ + : + : s/4/A/ + : + : + Also a silly comment here! + : + + : diff --git a/file b/file + : --- a/file + : +++ b/file + :3: 0559556 ! 3: b9cb956 s/11/B/ + : @@ -10,7 +10,7 @@ + : 9 + : 10 + : -11 + : -+BB + : ++B + : 12 + : 13 + : 14 + :4: d966c5c ! 4: 8add5f1 s/12/B/ + : @@ -8,7 +8,7 @@ + : @@ + : 9 + : 10 + : - BB + : + B + : -12 + : +B + : 13 + EOF + git range-diff changed...changed-message --color --dual-color >actual.raw && + test_decode_color >actual actual && + grep "= 1: .* s/5/A" actual && + grep "= 2: .* s/4/A" actual && + grep "= 3: .* s/11/B" actual && + grep "= 4: .* s/12/B" actual + ' + done + test_done