Re: [PATCH 4/5] attr: do not respect symlinks for in-tree .gitattributes
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Nov 7, 2016, 10:03 UTC
- Message-ID
- <CACsJy8AO2KtpxFu=wRjW1DoCA9bfpF1VoJUn__2ib-ML0XT66w@mail.gmail.com>
- In-Reply-To
- <20161102130848.qpigt4hxpoyfjf7x@sigill.intra.peff.net>
On Wed, Nov 2, 2016 at 8:08 PM, Jeff King <peff@peff.net> wrote:
Show 5 quoted lines
> The attributes system may sometimes read in-tree files from > the filesystem, and sometimes from the index. In the latter > case, we do not resolve symbolic links (and are not likely > to ever start doing so). Let's open filesystem links with > O_NOFOLLOW so that the two cases behave consistently.
This sounds backward to me. The major use case is reading .gitattributes on worktree, which follows symlinks so far. Only git-archive has a special need to read index-only versions. The worktree behavior should influence the in-index one, not the other way around. If we could die("BUG" when git-archive is used on symlinks (without --worktree-attributes). If people are annoyed by it, they can implement symlink folllowing (to another version in index, not on worktree).
The story is similar for .gitignore where in-index version is merely an optimization. If it's symlinks and we can't follow, we should fall back to worktree version.
-- Duy