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

Re: No way to have global diff settings? (global .gitattributes feature request)

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
Apr 26, 2010, 14:48 UTC
Message-ID
<4BD5A7D5.3060203@drmicha.warpmail.net>
In-Reply-To
<vpqoch6fhoz.fsf@bauges.imag.fr>
Matthieu Moy venit, vidit, dixit 26.04.2010 15:48:
Show 13 quoted lines
> Štěpán Němec <stepnem@gmail.com> writes:
> 
>>> Hello,
>>>
>>> it seems there is no global .gitattribute equivalent to .gitignore or
>>> .gitconfig. Wouldn't it make much sense to have one? Failing that, there
>>> really should be a way to specify some global diff options at least.
> 
> I'd like this feature too. My use-case is to have antiword and odt2txt
> as textconv filters for .doc and .odt files, which I always want to
> do. But probably the feature won't get implemented until one of us
> writes a patch ;-) (I may have time later, but not before a few
> days/weeks).

I leave it up to you to do the (re)search, but there's some preexisting patches and discussion around this topic. The upshot is that currently:

SYSTEM                  | GLOBAL             | VERSIONED             | LOCAL

$(prefix)/etc/gitconfig | $(HOME)/.gitconfig | N/A | $(GIT_DIR)/config

N/A | N/A | .gitattributes (rec.) | $GIT_DIR/info/attributes

N/A | N/A | .gitignore (rec.) | $GIT_DIR/info/exclude

There's also GIT_CONFIG overriding the defaults, and core.exludesfiles (yes, with s!); and of course command line parameters.

There's been requests for versioned config, for multiple sources of system config (think config.d/*), for global and system versions of attributes and exclude/ignore, for saner naming of exclude(s) vs. ignore, and, finally, for stopping all this madness, or rather: putting all of it in a subdir, aptly named gitconfig... no-no, no-go... or following the XDG conventions, or...

So, you see: You may suggest something simple like core.attributesfile. I have a prediction how that goes.

But now, right after 1.7.1, it might be a good time to really settle this in a future-proof yet backwards-compatible way.

Michael
Previous: Matthieu Moy
Message 4 of 4 in “No way to have global diff settings? (global .gitattributes feature request)”
  1. Štěpán NěmecApr 21, 2010
  2. Štěpán NěmecApr 26, 2010
  3. Matthieu MoyApr 26, 2010
  4. Michael J GruberApr 26, 2010

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.