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 of git 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:
-phiresky link
The semantics of .. vs ... are essentially swapped between diff and the log family of commands. This is because diff uses
setup_revisionsbut 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..Binstead 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:
https://public-inbox.org/git/bc7c3f9d769b2d5a108ff4cdc3c7277e112fdb56.1552820745.git.liu.denton@gmail.com/
https://public-inbox.org/git/20190311093751.GA31092@archbookpro.localdomain/
https://public-inbox.org/git/xmqqmumy6mxe.fsf@gitster-ct.c.googlers.com/