Re: [PATCH] xdiff/xpatience: support anchoring line(s)
flat view
From: Junio C Hamano <hidden>
Date: 2017-11-23 02:47:09
Junio C Hamano [off-list ref] writes:
What do we do when
git diff --histogram --patience
is given? Do we warn? If we don't, perhaps it may not be too bad
if
git diff --histogram --patience-anchor=foo
git diff --patience-anchor=foo --histogram
did not get any warning. Instead we just implicitly turn any
occurence of --patience-anchor=foo into --patience followed by the
same option, and assume that the user wanted the usual "last one
wins" semantics. It would turn patience on for the former, and
ignore the anchor for the latter and use historgram.
Thinking about this a bit more, I do like the basic idea of the UI
even better. What we could do is to sell this to the end users as a
new kind of diff algorithm choice (i.e. myers, patience, ... will
gain a new friend) that internally happens to be implemented by
piggybacking on patience (just like minimal is piggybacking on
myers) and call it "anchor". Then just like this command line
git diff --histogram --patience
makes the last one win without complaint, it is sane that these
command lines
git diff --histogram --anchored=<pattern>
git diff --anchored=<pattern> --histogram
make the last one win without complaint, either.
Hmm?