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

How do I make 'git diff --no-index' follow symlinks?

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Mar 18, 2017, 17:55 UTC
Message-ID
<CACBZZX6Bknimu26in8YG7TbsL3hEpmXTYwQAZQ5xK-DFoSatEg@mail.gmail.com>
I'd like to (ab)use git's nice diff interface and make this work:
    git --no-pager diff --no-index <(echo foo) <(echo bar)
It just prints:
    -pipe:[203030063]
    +pipe:[203030065]
But I want:
    $ diff -u0 <(echo foo) <(echo bar)|tail -n 2
    -foo
    +bar

I went diving through the diff code for a bit, but couldn't find where it's stat()-ing the two files and deciding it's not going to follow symlinks.

Just having some option to follow symlinks would make this work.
Next: Junio C Hamano
Message 1 of 3 in “How do I make 'git diff --no-index' follow symlinks?”
  1. Ævar Arnfjörð BjarmasonMar 18, 2017
  2. Junio C HamanoMar 18, 2017
  3. Dennis KaarsemakerMar 18, 2017

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.