git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Dennis Kaarsemaker <dennis@kaarsemaker.net>
Cc: git@vger.kernel.org
Subject: Re: [PATCH v2 1/2] diff --no-index: follow symlinks
Date: Fri, 13 Jan 2017 15:37:36 -0800	[thread overview]
Message-ID: <xmqqk29yedkv.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <20170113102021.6054-2-dennis@kaarsemaker.net> (Dennis Kaarsemaker's message of "Fri, 13 Jan 2017 11:20:20 +0100")

Dennis Kaarsemaker <dennis@kaarsemaker.net> writes:

> 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.

  reply	other threads:[~2017-01-13 23:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-13 10:20 [PATCH v2 0/2] diff --no-index: support symlinks and pipes Dennis Kaarsemaker
2017-01-13 10:20 ` [PATCH v2 1/2] diff --no-index: follow symlinks Dennis Kaarsemaker
2017-01-13 23:37   ` Junio C Hamano [this message]
2017-01-13 10:20 ` [PATCH v2 2/2] diff --no-index: support reading from pipes Dennis Kaarsemaker
2017-01-13 23:24   ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqk29yedkv.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=dennis@kaarsemaker.net \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).