git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 31, 2008, 03:07 UTC
Message-ID
<7vbq4vsiaa.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<20080331024755.GA690@coredump.intra.peff.net>
Jeff King <peff@peff.net> 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.
Previous: Jeff KingNext: Toby Corkindale
Message 12 of 13 in “.git/info/attributes not cloned”
  1. Toby CorkindaleMar 27, 2008
  2. Jeff KingMar 27, 2008
  3. Toby CorkindaleMar 27, 2008
  4. Jeff KingMar 27, 2008
  5. Toby CorkindaleMar 27, 2008
  6. Jeff KingMar 27, 2008
  7. [BUG?] git-archive ignores remote .gitattributes (was: .git/info/attributes not cloned)Toby Corkindale, Mar 28, 2008
  8. Johannes SchindelinMar 28, 2008
  9. Jakub NarebskiMar 28, 2008
  10. Johannes SchindelinMar 28, 2008
  11. Jeff KingMar 31, 2008
  12. Junio C HamanoMar 31, 2008
  13. Toby CorkindaleApr 10, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.