Description
Code of Conduct
- I have read and agree to the GitHub Docs project's Code of Conduct
What article on docs.github.com is affected?
What part(s) of the article would you like to see updated?
The use of A...B and A..B when using git diff
is not recommended by the developers of git, since this terminology refers to ranges, and git diff
doesn't work with ranges, but works with endpoints.
What makes this use even more confusing is that git diff A..B
compares A and B, whereas git log A..B
compares merge base of A and B, with B, and vice versa, git diff A...B
compares merge base of A and B, with B, whereas git log A...B
compares A and B.
This answer on stackoverflow explains this issue better than me, and quotes the developers of git.
I suggest replacing the use of "three-dot git diff" with git diff --merge-base base-branch topic-branch
, and "two-dot git diff" git diff base-branch topic-branch
.
Additional information
No response
Added by a maintainer
Content changes suggested to resolve this issue
I think the best solution is to update the introductions to the two sections "Three-dot Git diff comparison" and "Two-dot diff comparison" to include the definitions that you've included in the issue summary. That is:
In the "Three-dot Git diff comparison" section
- Explain that what we're referring to as a three-dot git comparison is equivalent to: git diff --merge-base base-branch topic-branch
In the "Two-dot diff comparison" section
- Explain that what we're referring to as a two-dot git comparison is equivalent to: git diff base-branch topic-branch
Any larger changes would need to wait on changes to the user interface.