summaryrefslogtreecommitdiff
path: root/dir.h
diff options
context:
space:
mode:
authorChris Torek <chris.torek@gmail.com>2020-06-12 16:19:59 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-06-12 17:53:44 (GMT)
commit8bfcb3a690126e6222f0d4f7012b0f68bb748018 (patch)
tree23e39a459c38a0cc16a14c17ba87836bc5079f98 /dir.h
parentbafa2d741e9dcc4d70ffcb3943e530635bb8e684 (diff)
downloadgit-8bfcb3a690126e6222f0d4f7012b0f68bb748018.zip
git-8bfcb3a690126e6222f0d4f7012b0f68bb748018.tar.gz
git-8bfcb3a690126e6222f0d4f7012b0f68bb748018.tar.bz2
git diff: improve range handling
When git diff is given a symmetric difference A...B, it chooses some merge base from the two specified commits (as documented). This fails, however, if there is *no* merge base: instead, you see the differences between A and B, which is certainly not what is expected. Moreover, if additional revisions are specified on the command line ("git diff A...B C"), the results get a bit weird: * If there is a symmetric difference merge base, this is used as the left side of the diff. The last final ref is used as the right side. * If there is no merge base, the symmetric status is completely lost. We will produce a combined diff instead. Similar weirdness occurs if you use, e.g., "git diff C A...B D". Likewise, using multiple two-dot ranges, or tossing extra revision specifiers into the command line with two-dot ranges, or mixing two and three dot ranges, all produce nonsense. To avoid all this, add a routine to catch the range cases and verify that that the arguments make sense. As a side effect, produce a warning showing *which* merge base is being used when there are multiple choices; die if there is no merge base. Signed-off-by: Chris Torek <chris.torek@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'dir.h')
0 files changed, 0 insertions, 0 deletions