Subject: Re: [BUG?] git-archive ignores remote .gitattributes

From: Junio C Hamano <[email-masked]>
Date: Sun, 30 Mar 2008 20:07:25 -0700

Jeff King <[email-masked]> writes:

> I thought there was some discussion of that a while ago (or possibly of
> looking up .gitignore in the same way).

Perhaps we would want two distinct modes in dir.c (gitignore stack) and
attr.c (gitattributes stack).  The current code implements the normal mode
that uses the files from the work tree (so that you can modify .gitigore
and expect it to take effect immediately) and fall back to .index (as the
general principle, low-level part of git pretends missing files are
unmodified files when they can).  The new mode, which would be appropriate
for commands such as "archive", would be triggered by first declaring that
the program is going to work on a single tree object, and will cause the
gitignore and gitattributes to be read from that tree (and only that
tree).

Even a longer term clean-up would be (and this is probably a good GSoC
sized project):

 - Unify gitignore and gitattributes stacks;

 - Maintain two or more gitignore/gitattributes stacks in effect at the
   same time.  Things like "git diff-tree $tree1 $tree2", "git diff-index
   --cached $tree", "git diff-index $tree", and "git archive $tree" should
   take attr/ignore from their respective places.