From: Martin von Zweigbergk Date: Thu, 16 Oct 2025 16:34:42 GMT Subject: Re: [PATCH] BreakingChanges: say that `git diff X..Y` syntax will be removed in 3.0 Message-ID: In-Reply-To: On Wed, 15 Oct 2025 at 18:28, Justin Tobler wrote: > > On 25/10/15 10:07PM, Martin von Zweigbergk via GitGitGadget wrote: > > From: Martin von Zweigbergk > > > > 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. Oh, I agree. I had forgotten that the triple-dot notation is also accepted. > 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. > > > 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. FWIW, `jj diff` can diff between two commits with `jj diff --from A --to B`. It can also show the changes in commit A with `jj diff -r A`. You can also show the combined diffs in a range with `jj diff -r A..B` (i.e. `jj diff -r A` is a special case of that). I think that's consistent with the range notation because it's the same set of commits that are considered. But both `git diff A..B` and `git diff A...B` take range expressions and show diffs that don't correspond to those ranges. So I guess I'm saying that I'm not fundamentally opposed to having a way of showing the combined diff in a range, as long as it's consistent. > > 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. Makes sense. The problem is that there are not many symbols that are available without requiring shell escaping. I don't have a good suggestion. > > 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