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

Re: [PATCH/RFC] Add global and system-wide gitattributes

From
HGHenrik Grubbström <grubba@roxen.com>
Date
Aug 11, 2010, 09:20 UTC
Message-ID
<Pine.GSO.4.63.1008111059281.1471@shipon.roxen.com>
In-Reply-To
<1281488646-7108-1-git-send-email-gsvick@gmail.com>
Hi.
On Wed, 11 Aug 2010, Petr Onderka wrote:
> Allow gitattributes to be set globally and system wide in ~/.giattributes
                                                                ^^
I assume you mean "~/.gitattributes" (ie missing a 't').
> and $(prefix)/etc/gitattributes files, respectively. This way, settings
> for particular file types can be set in one place and apply for all user's
> repositories.
[...]
Show 5 quoted lines
> Hi,
>
> I thought this feature would be useful for me, so I coded it up.
> What do you think? Is it ready to be included to the official 
> repository as is?
The feature as such seems reasonable.
> diff --git a/Documentation/gitattributes.txt b/Documentation/gitattributes.txt
> index 564586b..351b014 100644
> --- a/Documentation/gitattributes.txt
> +++ b/Documentation/gitattributes.txt
[...]
Show 7 quoted lines
> When deciding what attributes are assigned to a path, git
> -consults `$GIT_DIR/info/attributes` file (which has the highest
> +consults `$GIT_DIR/info/attributes`, `~/.gitattributes`
> +and `$(prefix)/etc/gitconfig` files (in order of decreasing
> precedence), `.gitattributes` file in the same directory as the
> path in question, and its parent directories up to the toplevel of the
> work tree (the further the directory that contains `.gitattributes`

I'm not sure if the above priority order is the most desireable order, since the user may want to set a default attribute, and have it to be overridden by the .gitattributes in the repositories.

Show 6 quoted lines
> diff --git a/configure.ac b/configure.ac
> index 5601e8b..773b835 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -285,6 +285,13 @@ GIT_PARSE_WITH_SET_MAKE_VAR(gitconfig, ETC_GITCONFIG,
> 			If VALUE is not fully qualified it will be interpretted
                                                                            ^^
Spello (not your fault): "interpreted".
Show 7 quoted lines
> 			as a path relative to the computed prefix at runtime.)
>
> +# Allow user to set ETC_GITATTRIBUTS variable
> +GIT_PARSE_WITH_SET_MAKE_VAR(gitattributes, ETC_GITATTRIBUTES,
> +			Use VALUE instead of /etc/gitattributes as the
> +			global git attributes file.
> +			If VALUE is not fully qualified it will be interpretted
                                                                            ^^
Same.
> +			as a path relative to the computed prefix at runtime.)
> +

-- Henrik Grubbström grubba@grubba.org Roxen Internet Software AB grubba@roxen.com

Previous: Petr OnderkaNext: Petr Onderka
Message 2 of 36 in “Add global and system-wide gitattributes”
  1. Add global and system-wide gitattributesPetr Onderka, Aug 11, 2010
  2. Henrik GrubbströmAug 11, 2010
  3. Petr OnderkaAug 11, 2010
  4. Matthieu MoyAug 11, 2010
  5. Junio C HamanoAug 11, 2010
  6. Petr OnderkaAug 16, 2010
  7. Add global and system-wide gitattributesPetr Onderka, Aug 16, 2010
  8. Štěpán NěmecAug 25, 2010
  9. Matthieu MoyAug 28, 2010
  10. Junio C HamanoAug 30, 2010
  11. Štěpán NěmecAug 30, 2010
  12. Matthieu MoyAug 28, 2010
  13. core.attributesfile: a fix, a simplification, and a testMatthieu Moy, Aug 28, 2010
  14. Štěpán NěmecAug 29, 2010
  15. Junio C HamanoAug 30, 2010
  16. Matthieu MoyAug 30, 2010
  17. Junio C HamanoAug 30, 2010
  18. Junio C HamanoAug 30, 2010
  19. Matthieu MoyAug 30, 2010
  20. 1/3 tests: factor HOME=$(pwd) in test-lib.shMatthieu Moy, Aug 30, 2010
  21. Ævar Arnfjörð BjarmasonAug 31, 2010
  22. Ævar Arnfjörð BjarmasonSep 1, 2010
  23. Junio C HamanoSep 1, 2010
  24. Ævar Arnfjörð BjarmasonSep 1, 2010
  25. Matthieu MoySep 1, 2010
  26. 2/3 don't write to git_log_output_encoding outside git_config()Matthieu Moy, Aug 30, 2010
  27. Matthieu MoySep 2, 2010
  28. Junio C HamanoSep 2, 2010
  29. 3/3 Add global and system-wide gitattributesMatthieu Moy, Aug 30, 2010
  30. Matthieu MoyAug 31, 2010
  31. Add global and system-wide gitattributesMatthieu Moy, Aug 31, 2010
  32. Junio C HamanoAug 31, 2010
  33. tests: factor HOME=$(pwd) in test-lib.shMatthieu Moy, Aug 30, 2010
  34. Ævar Arnfjörð BjarmasonAug 30, 2010
  35. Matthieu MoyAug 30, 2010
  36. Ævar Arnfjörð BjarmasonAug 30, 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.