From: "brian m. carlson" <sandals@crustytoothpaste.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Jonathan Nieder <jrnieder@gmail.com>,
git@vger.kernel.org, Jeff King <peff@peff.net>,
Duy Nguyen <pclouds@gmail.com>
Subject: Re: [PATCH] diff: add support for reading files literally with --no-index
Date: Sat, 5 Jan 2019 17:39:44 +0000 [thread overview]
Message-ID: <20190105173944.GH423984@genre.crustytoothpaste.net> (raw)
In-Reply-To: <xmqq36q8cjgf.fsf@gitster-ct.c.googlers.com>
[-- Attachment #1: Type: text/plain, Size: 1540 bytes --]
On Fri, Jan 04, 2019 at 11:26:56AM -0800, Junio C Hamano wrote:
> "brian m. carlson" <sandals@crustytoothpaste.net> writes:
>
> >> - --dereference to control whether to follow symlinks
> >
> > This is actually surprisingly difficult. The reason I implemented this
> > only for no-index mode is because there are actually several places we
> > can stat a file in the diff code, and implementing a --dereference
> > option that catches all of those cases and getting the option passed
> > down to them is non-trivial.
>
> Another thing to worry about is symlinks that point outside the
> working tree. When a tracked content "dir/link" is a symlink to
> "/etc/motd", it probably makes sense to open("/etc/motd") and read()
> it on the working tree side of the diff, and probably even on the
> index side of the diff, but what about obtaining contents for
> "dir/link" in a year-old commit under --deference mode? I am not
> sure if it makes sense to read from the filesystem in such a case.
>
> I personally am perfectly fine if this "do not compare readlink(2),
> but read contents literally" is limited to the --no-index mode.
That's a good point. I think I'll stick with the current design, then,
since that seems like the least surprising way forward. It also means
that we don't read outside of the working tree unless --no-index is in
use, which may be beneficial for security purposes.
Thanks for a helpful perspective.
--
brian m. carlson: Houston, Texas, US
OpenPGP: https://keybase.io/bk2204
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 868 bytes --]
prev parent reply other threads:[~2019-01-05 17:39 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-20 0:26 [PATCH] diff: add support for reading files literally with --no-index brian m. carlson
2018-12-20 15:48 ` Jeff King
2018-12-21 0:25 ` brian m. carlson
2018-12-20 17:06 ` Duy Nguyen
2018-12-20 17:17 ` Jeff King
2018-12-20 17:23 ` Duy Nguyen
2018-12-20 17:32 ` Jeff King
2018-12-20 17:37 ` Duy Nguyen
2018-12-20 21:43 ` Ævar Arnfjörð Bjarmason
2018-12-20 23:54 ` brian m. carlson
2018-12-21 11:52 ` Johannes Schindelin
2018-12-21 23:20 ` brian m. carlson
2019-01-02 18:56 ` Junio C Hamano
2019-01-04 2:08 ` brian m. carlson
2019-01-04 2:18 ` Jonathan Nieder
2019-01-04 2:57 ` brian m. carlson
2019-01-04 19:26 ` Junio C Hamano
2019-01-05 17:39 ` brian m. carlson [this message]
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=20190105173944.GH423984@genre.crustytoothpaste.net \
--to=sandals@crustytoothpaste.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jrnieder@gmail.com \
--cc=pclouds@gmail.com \
--cc=peff@peff.net \
/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 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 NNTP newsgroup(s).