Re: [PATCH] BreakingChanges: say that `git diff X..Y` syntax will be removed in 3.0
- From
Justin Tobler <jltobler@gmail.com>
- Date
- Oct 16, 2025, 01:28 UTC
- Message-ID
- <i5lgq7cunzqn2k3puuudzb53efqz6cxev64l6ukwy2kf24dab3@ndymfd2ocit3>
- In-Reply-To
- <pull.1989.git.1760566054455.gitgitgadget@gmail.com>
On 25/10/15 10:07PM, Martin von Zweigbergk via GitGitGadget wrote:
Show 5 quoted lines
> From: Martin von Zweigbergk <martinvonz@google.com> > > The `git diff X..Y` syntax is quite misleading because it looks like > it shows the diff of the commits in the X..Y range but it actually > shows the diff from X to Y.
Personally, I would like to see both the double-dot and triple-dot notations removed from the diff commands because they are often confused with the revision range notations. In my opinion, the double-dot notation doesn't even have much value as it can be replaced with:
A..B => A B A.. => A @ ..B => @ B
These alternatives are just as concise.
Show 5 quoted lines
> IMO, if that syntax is supported, it > should show a diff from the merge base of X and Y to Y. I hope Git 3.0 > is a good time to remove support for the current syntax and > semantics. Then we can perhaps add the syntax back later with less > surprising semantics.
With the existing triple-dot notation, `git diff A...B` is equivalent to `git diff $(git merge-base A B) B`. I think this is what you are suggesting about that the double-dot notation should do. As mentioned earlier, I think both these notations are too easily confused with revision range notations so I think we should avoid using the dot syntax for such a shortcut altogether.
The triple-dot notation is a somewhat convienient shortcut though. If we wanted to remove it, we would maybe want to replace it some other functionally equivalent shortcut.
All this being said, I've sure there are folks in the wild using these notations in scripts and changing would cause disruption. Maybe the Git 3.0 release would indeed be a good time to remove them though.
-Justin