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

[RFC] gitattributes on a bare repo

From
Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Date
Aug 3, 2008, 08:34 UTC
Message-ID
<cb7bb73a0808030134j5760d627i4180a6ff8f2cde6c@mail.gmail.com>
Hello all,

I realized recently that gitattributes don't work on a bare repo. It's easy to see why (no .gitattributes file to look into) and the 'official' solution is to use .git/info/attributes for that, which has the obvious problem of being local and not carried over to other repos (so that e.g. you have to recreate it and keep it up to date on remote repos too).

I was discussing this on IRC with pasky and he suggested that the best way to approach the matter was to use the .gitattributes from the relevant head. For example, a diff-tree would use the first .gitattributes from the first tree-ish parameter. I have actually looked into implementing this myself, but I'm afraid my git mojo isn't strong enough yet.

A similar discussion would hold of course for .gitignore and the corresponding info/excludes file.

I'm not sure how widespread the need for such a possibility (using .gitignore and .gitattributes on bare repos) is, but at least .gitattributes it would allow gitweb to use the correct diff funcnames.

-- 
Giuseppe "Oblomov" Bilotta
Message 1 of 1 in “[RFC] gitattributes on a bare repo”
  1. Giuseppe BilottaAug 3, 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.