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

3 messages from 2017-03-18 to 2017-03-18. Participants: Ævar Arnfjörð Bjarmason, Junio C Hamano, Dennis Kaarsemaker.
Thread: https://gitlist.dev/t/45423

## Ævar Arnfjörð Bjarmason, 2017-03-18 17:55

Subject: How do I make 'git diff --no-index' follow symlinks?
Message-ID: <CACBZZX6Bknimu26in8YG7TbsL3hEpmXTYwQAZQ5xK-DFoSatEg@mail.gmail.com>
URL: https://gitlist.dev/e/CACBZZX6Bknimu26in8YG7TbsL3hEpmXTYwQAZQ5xK-DFoSatEg%40mail.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.

```

## Junio C Hamano, 2017-03-18 19:30

Subject: Re: How do I make 'git diff --no-index' follow symlinks?
Message-ID: <xmqqk27m1ixf.fsf@gitster.mtv.corp.google.com>
URL: https://gitlist.dev/e/xmqqk27m1ixf.fsf%40gitster.mtv.corp.google.com
In-Reply-To: <CACBZZX6Bknimu26in8YG7TbsL3hEpmXTYwQAZQ5xK-DFoSatEg@mail.gmail.com>

```
Sounds like

    https://public-inbox.org/git/20161111201958.2175-1-dennis@kaarsemaker.net/

to me.  A key message in the thread may be:

    https://public-inbox.org/git/alpine.DEB.2.20.1611121106110.3746@virtualbox/

```

## Dennis Kaarsemaker, 2017-03-18 22:54

Subject: Re: How do I make 'git diff --no-index' follow symlinks?
Message-ID: <1489877673.24742.1.camel@kaarsemaker.net>
URL: https://gitlist.dev/e/1489877673.24742.1.camel%40kaarsemaker.net
In-Reply-To: <xmqqk27m1ixf.fsf@gitster.mtv.corp.google.com>

```
On Sat, 2017-03-18 at 12:30 -0700, Junio C Hamano wrote:
> Sounds like
> 
>     https://public-inbox.org/git/20161111201958.2175-1-dennis@kaarsemaker.net/
> 
> to me.  A key message in the thread may be:
> 
>     https://public-inbox.org/git/alpine.DEB.2.20.1611121106110.3746@virtualbox/

Sorry for the delay in sending v3. I've had a serious case of
Lennonitis (Life is what happens to you while you're busy making other
plans).

D.

```
