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.
[...]
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
[...]
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.
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".
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@xxxxxxxxxx
Roxen Internet Software AB grubba@xxxxxxxxx