range-diff/format-patch: handle commit ranges other than A..B
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Fri, 5 Feb 2021 14:44:48 +0000 (14:44 +0000)
committerJunio C Hamano <gitster@pobox.com>
Sun, 7 Feb 2021 05:24:55 +0000 (21:24 -0800)
commit359f0d754ab709c5a1ff3267bc117fb8559c62c2
tree05586b877349a8bc8466f2a7a733df04585cd14a
parent679b5916cdafdcfa9fb36c31dbf53d7e4aa0af0b
range-diff/format-patch: handle commit ranges other than A..B

In the `SPECIFYING RANGES` section of gitrevisions[7], two ways are
described to specify commit ranges that `range-diff` does not yet
accept: "<commit>^!" and "<commit>^-<n>".

Let's accept them, by parsing them via the revision machinery and
looking for at least one interesting and one uninteresting revision in
the resulting `pending` array.

This also finally lets us reject arguments that _do_ contain `..` but
are not actually ranges, e.g. `HEAD^{/do.. match this}`.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
range-diff.c
range-diff.h
t/t3206-range-diff.sh