Thread (1 message) 1 message, 1 author, 2017-01-13

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

From: Junio C Hamano <hidden>
Date: 2017-01-13 23:37:44

Dennis Kaarsemaker [off-list ref] 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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help