]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'js/range-diff-wo-dotdot'
authorJunio C Hamano <gitster@pobox.com>
Thu, 18 Feb 2021 01:21:41 +0000 (17:21 -0800)
committerJunio C Hamano <gitster@pobox.com>
Thu, 18 Feb 2021 01:21:41 +0000 (17:21 -0800)
There are other ways than ".." for a single token to denote a
"commit range", namely "<rev>^!" and "<rev>^-<n>", but "git
range-diff" did not understand them.

* js/range-diff-wo-dotdot:
  range-diff(docs): explain how to specify commit ranges
  range-diff/format-patch: handle commit ranges other than A..B
  range-diff/format-patch: refactor check for commit range

1  2 
builtin/log.c
t/t3206-range-diff.sh

diff --cc builtin/log.c
Simple merge
index ce24b5d735abc263be7c4125155a47663d1616cf,2b518378d4a0a8bb7d4e37222f89c0a42fad276c..b782d26820c6d1e62c9ad0b3d55176bc567b4cad
@@@ -153,8 -150,21 +153,21 @@@ test_expect_success 'simple A B C (unmo
        test_cmp expect actual
  '
  
+ test_expect_success 'A^! and A^-<n> (unmodified)' '
+       git range-diff --no-color topic^! unmodified^-1 >actual &&
+       cat >expect <<-EOF &&
+       1:  $(test_oid t4) = 1:  $(test_oid u4) s/12/B/
+       EOF
+       test_cmp expect actual
+ '
+ test_expect_success 'A^{/..} is not mistaken for a range' '
+       test_must_fail git range-diff topic^.. topic^{/..} 2>error &&
+       test_i18ngrep "not a commit range" error
+ '
  test_expect_success 'trivial reordering' '
 -      git range-diff --no-color master topic reordered >actual &&
 +      git range-diff --no-color main topic reordered >actual &&
        cat >expect <<-EOF &&
        1:  $(test_oid t1) = 1:  $(test_oid r1) s/5/A/
        3:  $(test_oid t3) = 2:  $(test_oid r2) s/11/B/