Merge branch 'es/format-patch-rangediff'
authorJunio C Hamano <gitster@pobox.com>
Mon, 17 Sep 2018 20:53:56 +0000 (13:53 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 17 Sep 2018 20:53:56 +0000 (13:53 -0700)
"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'

1  2 
builtin/log.c
builtin/range-diff.c
log-tree.c
range-diff.c
revision.h
t/t3206-range-diff.sh
diff --cc builtin/log.c
index df4201131284317948de938242c22d9862c0ffbb,f69b67b9cef050e1e5506d2b3a9f7c1f9c519a18..f09a5789f8a5a5252e9629b6c949adb2c365bf7e
@@@ -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
  
Simple merge
diff --cc log-tree.c
Simple merge
diff --cc range-diff.c
Simple merge
diff --cc revision.h
Simple merge
index c94f9bf5ee12c1db38764ac6e51bbc011d3a2619,3d7a2d8a4d8191f93a70b2e3d4878537cd2c5564..88ebed1dfa59de4609b61f193fa3905c3238bf14
@@@ -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 &&
 +      :<YELLOW>1:  a4b3333 = 1:  f686024 s/5/A/<RESET>
 +      :<RED>2:  f51d370 <RESET><YELLOW>!<RESET><GREEN> 2:  4ab067d<RESET><YELLOW> s/4/A/<RESET>
 +      :    <REVERSE><CYAN>@@ -2,6 +2,8 @@<RESET>
 +      :     <RESET>
 +      :         s/4/A/<RESET>
 +      :     <RESET>
 +      :    <REVERSE><GREEN>+<RESET><BOLD>    Also a silly comment here!<RESET>
 +      :    <REVERSE><GREEN>+<RESET>
 +      :      diff --git a/file b/file<RESET>
 +      :      --- a/file<RESET>
 +      :      +++ b/file<RESET>
 +      :<RED>3:  0559556 <RESET><YELLOW>!<RESET><GREEN> 3:  b9cb956<RESET><YELLOW> s/11/B/<RESET>
 +      :    <REVERSE><CYAN>@@ -10,7 +10,7 @@<RESET>
 +      :      9<RESET>
 +      :      10<RESET>
 +      :    <RED> -11<RESET>
 +      :    <REVERSE><RED>-<RESET><FAINT;GREEN>+BB<RESET>
 +      :    <REVERSE><GREEN>+<RESET><BOLD;GREEN>+B<RESET>
 +      :      12<RESET>
 +      :      13<RESET>
 +      :      14<RESET>
 +      :<RED>4:  d966c5c <RESET><YELLOW>!<RESET><GREEN> 4:  8add5f1<RESET><YELLOW> s/12/B/<RESET>
 +      :    <REVERSE><CYAN>@@ -8,7 +8,7 @@<RESET>
 +      :    <CYAN> @@<RESET>
 +      :      9<RESET>
 +      :      10<RESET>
 +      :    <REVERSE><RED>-<RESET><FAINT> BB<RESET>
 +      :    <REVERSE><GREEN>+<RESET><BOLD> B<RESET>
 +      :    <RED> -12<RESET>
 +      :    <GREEN> +B<RESET>
 +      :      13<RESET>
 +      EOF
 +      git range-diff changed...changed-message --color --dual-color >actual.raw &&
 +      test_decode_color >actual <actual.raw &&
 +      test_cmp expect actual
 +'
 +
+ for prev in topic master..topic
+ do
+       test_expect_success "format-patch --range-diff=$prev" '
+               git format-patch --stdout --cover-letter --range-diff=$prev \
+                       master..unmodified >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