From: Junio C Hamano <gitster@pobox.com>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: David Aguilar <davvid@gmail.com>,
Christophe Macabiau <christophemacabiau@gmail.com>,
Git ML <git@vger.kernel.org>
Subject: Re: [PATCH] difftool: handle changing symlinks in dir-diff mode
Date: Mon, 13 Mar 2017 14:33:09 -0700 [thread overview]
Message-ID: <xmqqinncrhey.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <alpine.DEB.2.20.1703132204410.3767@virtualbox> (Johannes Schindelin's message of "Mon, 13 Mar 2017 22:27:30 +0100 (CET)")
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
>> > + if (strbuf_readlink(&link, ce->name, ce_namelen(ce)) == 0) {
>> > + strbuf_add(&path, state->base_dir, state->base_dir_len);
>> > + strbuf_add(&path, ce->name, ce_namelen(ce));
>> > +
>> > + write_file_buf(path.buf, link.buf, link.len);
>>
>> This does "write content into symlink stand-in file", but why?
>
> From the commit message:
>
> > Detect the null object ID for symlinks in dir-diff so that
> > difftool can prepare temporary files that matches how git
> > handles symlinks.
Yes I read what the proposed log message said, and noticed that
symbolic link is _always_ written as a regular file.
I was questioning why. I know Git falls back to such behaviour when
the filesystem does not support symbolic links. "Why do so
unconditionally, even when the filesystem does?" was the question.
> The obvious connection: when core.symlinks = false, Git already falls back
> to writing plain files with the link target as contents. This function
> does the same, for the same motivation: it is the best we can do in this
> case.
And that "obvious connection" does not answer the question.
next prev parent reply other threads:[~2017-03-13 21:33 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-24 11:47 fatal error when diffing changed symlinks Christophe Macabiau
2017-02-24 17:53 ` Junio C Hamano
2017-02-24 19:51 ` Junio C Hamano
2017-02-24 20:35 ` Jeff King
2017-02-25 12:36 ` Johannes Schindelin
2017-03-07 18:16 ` Junio C Hamano
2017-03-07 22:34 ` Johannes Schindelin
2017-03-13 17:56 ` [PATCH] difftool: handle changing symlinks in dir-diff mode David Aguilar
2017-03-13 18:32 ` Junio C Hamano
2017-03-13 21:04 ` Johannes Schindelin
2017-03-13 21:27 ` Johannes Schindelin
2017-03-13 21:33 ` Junio C Hamano [this message]
2017-03-14 2:20 ` David Aguilar
2017-03-14 5:52 ` Junio C Hamano
2017-03-14 4:13 ` Junio C Hamano
2017-03-13 19:02 ` Junio C Hamano
2017-03-13 21:36 ` Johannes Schindelin
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqinncrhey.fsf@gitster.mtv.corp.google.com \
--to=gitster@pobox.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=christophemacabiau@gmail.com \
--cc=davvid@gmail.com \
--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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.