Description
It's pretty ridiculous how the meaning of .. and ... is exactly swapped for log and diff: log A..B is changes from merge base to B which is what diff A...B does
-phiresky link
The semantics of .. vs ... are essentially swapped between diff and the log family of commands. This is because diff uses setup_revisions
but abuses the way that the returned endpoints are used.
There are several options to deal with this:
-
Print a warning into the output if a user uses
git diff A..B
instead ofgit diff A B
(see here) -
Update the documentation for git-diff so that it's obvious why this is happening (so we tell users about how range-notation is implemented). Upside is users will understand why
git diff foo@^!
works as well. Downside is that I'm not sure it's productive to expose implementation details to end-uers. -
Swap the meaning of
..
and...
. One can dream... -
Something else? I've been mulling over it and not wanting to contribute a patch because there might be some cleaner way to resolve this. Not really sure how.
See: