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

[BUG] "git range-diff" does not know X^! is a valid range

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 2, 2024, 17:45 UTC
Message-ID
<xmqq7chf64l1.fsf@gitster.g>

When cherry-picking an existing commit X to a different base, which may have resulted in conflicts that needed a fix-up, you would want to be able to compare X~1..X and HEAD~1..HEAD and naturally, we would expect "range-diff" to have a handy way to allow giving the command without having to type the overly long branch name X twice.

Individual "diff" for these two ranges are easy to obtain without repeating X:

    $ git diff X^!
    $ git diff HEAD^!

The "git range-diff" however does not understand that X^! is a valid range X~1..X. This command throws an error and ...

    $ git range-diff refs/merge-fix/ew/khash-to-khashl^! HEAD^!
    fatal: need two commit ranges

... to add insult to injury, it shows the huge "git range-diff -h" output after that.

Any takers?
Next: René Scharfe
Message 1 of 3 in “[BUG] "git range-diff" does not know X^! is a valid range”
  1. Junio C HamanoApr 2, 2024
  2. René ScharfeApr 2, 2024
  3. Junio C HamanoApr 2, 2024

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.