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

Request: a way to ignore .gitattributes

From
SMSean MacLennan <seanm@seanm.ca>
Date
Mar 12, 2022, 18:07 UTC
Message-ID
<20220312130712.6d9d2d00@zonker.seanm.ca>
Hi,

We have a git repo that is a mirror of an svn repo. The tools create a huge .gitattribute file that is about 83,000 entries. Almost all are of the form: <path> -text

This file kills git grep. A grep that takes <1s without the file takes almost 2 minutes with the file. So git grep it unusable.

My current solution is to rename the file:

-#define GITATTRIBUTES_FILE ".gitattributes" +#define GITATTRIBUTES_FILE ".gitattributes-no"

But I would like a cleaner solution so I don't have to maintain my own git.

My request is more for what would be the best gitish way to solve this; I am willing to do the actual patch.

This needs to be something in the local config and not global. My current thoughts are:

1) A way to override the default name (much like I do now):
   gitattributesfile = .gitattributes-no
2) A flag variable:
   gitattributes = ignore
        or
   ignoreattributes = true

I personally like 1) because it would also work for the case where you want to override a bad .gitattributes file (that you have no control over) with a good .gitattributes file. I just think it would be more generally useful.

But I would like to pick a solution that is most likely to get accepted.

Cheers,
   Sean MacLennan
Next: rsbecker@nexbridge.com
Message 1 of 4 in “Request: a way to ignore .gitattributes”
  1. Sean MacLennanMar 12, 2022
  2. rsbecker@nexbridge.comMar 12, 2022
  3. Junio C HamanoMar 12, 2022
  4. Sean MacLennanMar 13, 2022

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.