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

Re: .git/info/attributes not cloned

From
Jeff King <peff@peff.net>
Date
Mar 27, 2008, 04:29 UTC
Message-ID
<20080327042925.GA6426@coredump.intra.peff.net>
In-Reply-To
<47EB213F.1020503@rea-group.com>
On Thu, Mar 27, 2008 at 03:23:27PM +1100, Toby Corkindale wrote:
> Ah, OK.
> I was hoping not to use .gitattributes, as then the attributes are  
> ignored when doing something like:
> git archive --remote=example.com:/path/to/repo release/v2.1 | tar xf -

I vaguely recall some discussion of this in the past, so maybe it isn't a good idea. But I would think changing git-archive to respect .gitattributes might be worth doing (presumably the version of .gitattributes from the tree that is being exported).

Show 8 quoted lines
> That gives a clue that the /info/ files are repo-specific.
> However in gitignore(5) and gitattributes(5), there is no explanation of  
> this - it simply mentions that the info version is a higher priority than 
> the .git{ignore,attributes} version.
>
> I suggest that the individual docs/man-pages should mention that too.
> I'll submit a patch in a separate email, as long as I'm not still  
> misunderstanding the mechanism.

I think you understand what is going on. A clarification to both pages would be helpful, I think, just saying "here is why you might use one over the other."

> Is there a recommended way to make attributes apply to commands run on a  
> remote repository, or is that a different bug?

I'm not sure what you mean here. Very few commands talk to remote repositories. I had assumed in your git-archive example that you wanted .gitattributes on the remote repo to affect the tarfile generated by that repo. But now it sounds like you want to edit a local file to impact the archive generated remotely. I don't think there is a way to do that.

-Peff
Previous: Toby CorkindaleNext: Toby Corkindale
Message 4 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.