Merge branch 'js/range-diff-wo-dotdot'

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
This commit is contained in:
Junio C Hamano
2021-02-17 17:21:41 -08:00
6 changed files with 65 additions and 5 deletions

View File

@ -153,6 +153,19 @@ test_expect_success 'simple A B C (unmodified)' '
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 main topic reordered >actual &&
cat >expect <<-EOF &&