git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] BreakingChanges: say that `git diff X..Y` syntax will be removed in 3.0

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 15, 2025, 22:19 UTC
Message-ID
<xmqq4irzu7st.fsf@gitster.g>
In-Reply-To
<pull.1989.git.1760566054455.gitgitgadget@gmail.com>

"Martin von Zweigbergk via GitGitGadget" <gitgitgadget@gmail.com> writes:

Show 13 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. 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.
>
> Signed-off-by: Martin von Zweigbergk <martinvonz@google.com>
> ---
>     BreakingChanges: say that git diff X..Y syntax will be removed in 3.0

I like it in prinicple and I do wish that we didn't do the lazy thing when we did the command line parser for "git diff" (we had revision range parser, so we just reused it instead of doing our own for "git diff"). But real life may bite us back.

In any case, a declaration that does not come with code changes that are protected by WITH_BREAKING_CHANGES CPP macro is a patch that is not quite ready to be applied.

Show 24 quoted lines
> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1989%2Fmartinvonz%2Fmz%2Fwtmnpolouvvz-v1
> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1989/martinvonz/mz/wtmnpolouvvz-v1
> Pull-Request: https://github.com/gitgitgadget/git/pull/1989
>
>  Documentation/BreakingChanges.adoc | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/Documentation/BreakingChanges.adoc b/Documentation/BreakingChanges.adoc
> index 90b53abcea..93fb968840 100644
> --- a/Documentation/BreakingChanges.adoc
> +++ b/Documentation/BreakingChanges.adoc
> @@ -114,6 +114,10 @@ applications and forges.
>  +
>  There is no plan to deprecate the "sha1" object format at this point in time.
>  +
> +Support for "git diff X..Y" syntax will be removed. Use "git diff X Y" instead.
> +This will open up the syntax for a more consistent interpretation of
> +"git diff $(git merge-base X Y) Y".
> ++
>  Cf. <2f5de416-04ba-c23d-1e0b-83bb655829a7@zombino.com>,
>  <20170223155046.e7nxivfwqqoprsqj@LykOS.localdomain>,
>  <CA+EOSBncr=4a4d8n9xS4FNehyebpmX8JiUwCsXD47EQDE+DiUQ@mail.gmail.com>.
>
> base-commit: 143f58ef7535f8f8a80d810768a18bdf3807de26
Previous: Martin von Zweigbergk via GitGitGadgetNext: Martin von Zweigbergk
Message 2 of 14 in “BreakingChanges: say that `git diff X..Y` syntax will be removed in 3.0”
  1. BreakingChanges: say that `git diff X..Y` syntax will be removed in 3.0Martin von Zweigbergk via GitGitGadget, Oct 15, 2025
  2. Junio C HamanoOct 15, 2025
  3. Martin von ZweigbergkOct 15, 2025
  4. Kristoffer HaugsbakkOct 16, 2025
  5. D. Ben KnobleOct 16, 2025
  6. brian m. carlsonOct 15, 2025
  7. Junio C HamanoOct 16, 2025
  8. Martin von ZweigbergkOct 16, 2025
  9. Kristoffer HaugsbakkOct 16, 2025
  10. Martin von ZweigbergkOct 16, 2025
  11. Junio C HamanoOct 16, 2025
  12. D. Ben KnobleOct 16, 2025
  13. Justin ToblerOct 16, 2025
  14. Martin von ZweigbergkOct 16, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.