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

Regression in git diff with stdin, with -R

From
Martin Storsjö <martin@martin.st>
Date
Sep 9, 2023, 20:42 UTC
Message-ID
<d42579a0-f438-9b4c-97e4-58724dbe4a4@martin.st>
Hi,

Since 1e3f26542a6ecd3006c2c0d5ccc0bae4a700f7e5, "diff --no-index: support reading from named pipes", one usecase about diffing with stdin has broken.

I see that this patch was preceded by adding some extra tests around diffing with stdin - but one case seem to have been missed.

"git diff --no-index - regularfile" still works fine as it did before, also "git diff --no-index regularfile -" also still works. (I.e. stdin can either be the first or second file argument - both work.)

However if using the -R option to reverse the diff direction, i.e. "git diff --no-index -R - regularfile" or "git diff --no-index -R regularfile -", I'm now getting the following error:

     fatal: stat '-': No such file or directory
// Martin
Next: René Scharfe
Message 1 of 6 in “Regression in git diff with stdin, with -R”
  1. Martin StorsjöSep 9, 2023
  2. diff --no-index: fix -R with stdinRené Scharfe, Sep 9, 2023
  3. Phillip WoodSep 10, 2023
  4. Taylor BlauSep 10, 2023
  5. Martin StorsjöSep 11, 2023
  6. Junio C HamanoSep 11, 2023

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.