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

Re: [PATCH v2 1/2] diff --no-index: follow symlinks

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 13, 2017, 23:37 UTC
Message-ID
<xmqqk29yedkv.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20170113102021.6054-2-dennis@kaarsemaker.net>
Dennis Kaarsemaker <dennis@kaarsemaker.net> writes:
Show 6 quoted lines
> Git's diff machinery does not follow symlinks, which makes sense as git
> itself also does not, but stores the symlink destination.
>
> In --no-index mode however, it is useful for diff to to follow symlinks,
> matching the behaviour of ordinary diff. A new --no-dereference (name
> copied from diff) option has been added to disable this behaviour.

If you add a --no-dereference option, --dereference option should also be there, so that "--no-dereference" earlier on the command line (perhaps coming from a configured alias) can be countermanded.

While I am not opposed to giving an optional feature to treat a symlink as if it is a regular file with the contents of its link target, I am not enthused that this patch tries to make that the default behaviour. We are not matching the behaviour of ordinary diff anyway [*1*].

It probably makes more sense for our first step to introduce this feature that is only enabled when "--dereference" option is given. Making it the default for "--no-index" case should be discussed as a separate step.

[Footnote]

*1* E.g. "git diff --no-index dirA/ dirB/" does not say "Only in dirA: file". It also recurses into subdirectories of dirA/ and dirB/ without the --recursive option.

Previous: Dennis Kaarsemaker
Message 5 of 5 in “diff --no-index: support symlinks and pipes”
  1. 0/2 diff --no-index: support symlinks and pipesDennis Kaarsemaker, Jan 13, 2017
  2. 2/2 diff --no-index: support reading from pipesDennis Kaarsemaker, Jan 13, 2017
  3. Junio C HamanoJan 13, 2017
  4. 1/2 diff --no-index: follow symlinksDennis Kaarsemaker, Jan 13, 2017
  5. Junio C HamanoJan 13, 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.