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

git-archive --worktree-attributes (1.8.2)

From
Amit Bakshi <ambakshi@gmail.com>
Date
Apr 9, 2013, 20:43 UTC
Message-ID
<CAFGOX=VXifkn4oNkqLLF_WG5Dzf4rjd15EV7C=9a_H9CTM+w2Q@mail.gmail.com>
Hi,
 In the help for git-archive it states:
       --worktree-attributes
           Look for attributes in .gitattributes in working directory too.

This doesn't seem to be the case. I have a use case where I need to archive a remote I don't have write access too (via --remote=), and I wish to ignore certain paths. When I chdir to a temp dir, create a .gitattributes file, and call git archive --worktree-attributes, the bevaviour I see is that it is ignoring .gitattributes. I've tried setting GIT_WORK_TREE to my temp dir, without success. Is the documentation wrong about 'working directory'? Did it mean to say 'working tree'? Looking at the source for archive.c, it seems to assume a GIT_WORK_TREE.

Would you accept a patch that either adds an option to explicitly set the .gitattributes file or would let --worktree-attributes look in $PWD.

Thanks, Amit

Next: Junio C Hamano
Message 1 of 5 in “git-archive --worktree-attributes (1.8.2)”
  1. Amit BakshiApr 9, 2013
  2. Junio C HamanoApr 9, 2013
  3. archive: clarify explanation of --worktree-attributesRené Scharfe, Apr 10, 2013
  4. Eric SunshineApr 10, 2013
  5. Junio C HamanoApr 10, 2013

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.