public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Matthieu Moy <Matthieu.Moy@grenoble-inp•fr>
To: Petr Onderka <gsvick@gmail•com>
Cc: git@vger•kernel.org, Henrik Grubbstrm <grubba@grubba•org>
Subject: Re: [PATCH/RFC] Add global and system-wide gitattributes
Date: Wed, 11 Aug 2010 14:31:16 +0200	[thread overview]
Message-ID: <vpq39uluy97.fsf@bauges.imag.fr> (raw)
In-Reply-To: <1281488646-7108-1-git-send-email-gsvick@gmail.com> (Petr Onderka's message of "Wed\, 11 Aug 2010 01\:04\:06 +0000")

Petr Onderka <gsvick@gmail•com> writes:

> Allow gitattributes to be set globally and system wide in ~/.giattributes
> 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.

The feature is definitely useful, and I'll use it as soon as it gets
into git.git ;-).

One point: we need to make sure the choice for the the user-wide
filename is the right one, since it's a pain to change it later.

We already have ~/.gitconfig, which often points to ~/.gitexcludes or
~/.gitignored (but this filename is specified with a config variable,
for which we didn't manage to agree on a default value). We're about
to add ~/.gitattributes. That makes 3 ~/.git* files, and I think it's
time to make it a directory (similar to $GIT_DIR/info/)

I think it should be done like this:

1) Default core.excludesfile to $CONF/exclude

2) Make your user-wide gitattribute $CONF/attributes

3) Optionally, read $CONF/config as well as ~/.gitconfig so that
   people can have all their git configuration in the same directory.

Now, we need to agree on $CONF. Some non-options are:

* CONF=~/.gitconfig would clash with the file ~/.gitconfig

* CONF=~/.git would prevent people from versionning their $HOME.

I'd be in favor of following the freedesktop standard (roughly,
defaulting to ~/.config/git):

  http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html

because other applications start using it, and it allows one to easily
keep the configuration in a (typically git-versionned) ~/.config
directory. And if we are to choose a config directory, it doesn't harm
to chose one consistant with other applications and with a standard.

I never got time to implement this. If you're willing to do something
like that, that would be great. If not, I'd suggest having a config
variable to point to the user-wide gitattributes file (without a
default value), because it allows a future transition by giving a
default value to the variable.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

  parent reply	other threads:[~2010-08-11 12:35 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-11  1:04 [PATCH/RFC] Add global and system-wide gitattributes Petr Onderka
2010-08-11  9:20 ` Henrik Grubbström
2010-08-11 10:50   ` Petr Onderka
2010-08-11 12:31 ` Matthieu Moy [this message]
2010-08-11 22:19 ` Junio C Hamano
2010-08-16 16:51   ` Petr Onderka
2010-08-16 16:56     ` [PATCH v2] " Petr Onderka
2010-08-25  9:55       ` Štěpán Němec
2010-08-28 17:33         ` Matthieu Moy
2010-08-30  5:34           ` Junio C Hamano
2010-08-30  9:09             ` Štěpán Němec
2010-08-28 18:35       ` Matthieu Moy
2010-08-28 18:41         ` [PATCH] core.attributesfile: a fix, a simplification, and a test Matthieu Moy
2010-08-29 10:32           ` [PATCH v3?] Add global and system-wide gitattributes Štěpán Němec
2010-08-30  8:04             ` Junio C Hamano
2010-08-30  8:26               ` Matthieu Moy
2010-08-30 20:47                 ` Junio C Hamano
2010-08-30 21:11                   ` Junio C Hamano
2010-08-30 22:55                     ` Matthieu Moy
2010-08-30 23:15                       ` [PATCH 1/3 v2] tests: factor HOME=$(pwd) in test-lib.sh Matthieu Moy
2010-08-31  7:42                         ` Ævar Arnfjörð Bjarmason
2010-09-01  7:56                           ` Ævar Arnfjörð Bjarmason
2010-09-01 15:24                             ` Junio C Hamano
2010-09-01 15:40                               ` Ævar Arnfjörð Bjarmason
2010-09-01 16:57                                 ` Matthieu Moy
2010-08-30 23:15                       ` [PATCH 2/3] don't write to git_log_output_encoding outside git_config() Matthieu Moy
2010-09-02  8:56                         ` Matthieu Moy
2010-09-02 15:49                           ` Junio C Hamano
2010-08-30 23:15                       ` [PATCH 3/3 v4] Add global and system-wide gitattributes Matthieu Moy
2010-08-31 22:41                         ` Matthieu Moy
2010-08-31 22:42                           ` [PATCH] " Matthieu Moy
2010-08-31 23:56                           ` [PATCH 3/3 v4] " Junio C Hamano
2010-08-30  9:50               ` [PATCH] tests: factor HOME=$(pwd) in test-lib.sh Matthieu Moy
2010-08-30 10:22                 ` Ævar Arnfjörð Bjarmason
2010-08-30 10:54                   ` Matthieu Moy
2010-08-30 11:08                     ` Ævar Arnfjörð Bjarmason

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=vpq39uluy97.fsf@bauges.imag.fr \
    --to=matthieu.moy@grenoble-inp$(echo .)fr \
    --cc=git@vger$(echo .)kernel.org \
    --cc=grubba@grubba$(echo .)org \
    --cc=gsvick@gmail$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox