Thread (1 message) 1 message, 1 author, 2016-06-15

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

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:44:26

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