* [RFC] Possibility to choose ~/.config/git/config instead of ~/.gitconfig
@ 2012-05-25 16:15 nguyenhu
2012-05-25 17:01 ` Jonathan Nieder
` (2 more replies)
0 siblings, 3 replies; 26+ messages in thread
From: nguyenhu @ 2012-05-25 16:15 UTC (permalink / raw)
To: git
Cc: matthieu.moy, Valentin DUPERRAY, Franck JONAS, Lucien KONG,
Thomas NGUY, Huynh Khoi Nguyen NGUYEN
Hello,
As you know, git stores its configuration in ~/.gitconfig file and in
other hidden files at the root of the user's directory.
We would like to have a configuration directory instead of all these
configuration files by following the XDG specification because:
- not a lot of hidden files at the root, so better view
- one directory per software in ~/.config
We would like to give to users the possibility to store configuration
in ~/.config/git/config file.
git would store its configuration in ~/.config/git/config file if:
- this file exists,
- and ~/.gitconfig file doesn't.
Otherwise git would store its configuration in ~/.gitconfig as usual.
If you don't create ~/.config/git/config, there is no change.
What do you think about it ?
I will send you a patch today.
Thanks,
Lucien KONG,
Valentin DUPERRAY,
Huynh Khoi Nguyen NGUYEN,
Thomas NGUY,
Franck JONAS
Grenoble INP ENSIMAG
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [RFC] Possibility to choose ~/.config/git/config instead of ~/.gitconfig
2012-05-25 16:15 [RFC] Possibility to choose ~/.config/git/config instead of ~/.gitconfig nguyenhu
@ 2012-05-25 17:01 ` Jonathan Nieder
2012-05-25 17:29 ` Matthieu Moy
2012-05-25 17:31 ` Hilco Wijbenga
2012-05-26 10:45 ` Felipe Contreras
2 siblings, 1 reply; 26+ messages in thread
From: Jonathan Nieder @ 2012-05-25 17:01 UTC (permalink / raw)
To: nguyenhu
Cc: git, matthieu.moy, Valentin DUPERRAY, Franck JONAS, Lucien KONG,
Thomas NGUY, Huynh Khoi Nguyen NGUYEN
Hi,
nguyenhu@minatec.inpg.fr wrote:
> As you know, git stores its configuration in ~/.gitconfig file and
> in other hidden files at the root of the user's directory.
[...]
> git would store its configuration in ~/.config/git/config file if:
> - this file exists,
> - and ~/.gitconfig file doesn't.
> Otherwise git would store its configuration in ~/.gitconfig as usual.
Sounds like a worthwhile goal, so I look forward to the patch. ;-)
What other hidden files at the root of the user's directory are you
talking about?
Curious,
Jonathan
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [RFC] Possibility to choose ~/.config/git/config instead of ~/.gitconfig
2012-05-25 17:01 ` Jonathan Nieder
@ 2012-05-25 17:29 ` Matthieu Moy
2012-05-25 17:44 ` Jonathan Nieder
0 siblings, 1 reply; 26+ messages in thread
From: Matthieu Moy @ 2012-05-25 17:29 UTC (permalink / raw)
To: Jonathan Nieder
Cc: nguyenhu, git, Valentin DUPERRAY, Franck JONAS, Lucien KONG,
Thomas NGUY, Huynh Khoi Nguyen NGUYEN
Jonathan Nieder <jrnieder@gmail.com> writes:
> What other hidden files at the root of the user's directory are you
> talking about?
A typical user configuration (or at least mine ;-) ) can include:
[core]
excludesfile = ~/.gitignore
attributesfile = ~/.gitattributes
Not having a default value for these two variables is a bit painful. For
example, when I teach newbies not to version their *~ backup files, I'd
like to grab their keyboard and type for them
echo '*~' >> ~/.gitignore
but right now, it takes a bit more time than that (which multiplied by
35 students in a room is not negligible ;-) ).
Actually, I now remember trying to find a default value some time ago:
http://thread.gmane.org/gmane.comp.version-control.git/133343
The conclusion essentially boiled down to "let's drop the patch until
there's a clear consensus on what the default value should be", and
"don't default to ~/.gitsomething, because it will be painful to migrate
to a user config directory later".
Once it's official that the configuration is in stg like ~/.config/git/,
we can start thinking about a default value for core.excludesfile and
core.attributesfile, in the same directory (note: we're just talking
about default values here, so users having set the variable explicitely
won't be affected by the change).
--
Matthieu Moy
http://www-verimag.imag.fr/~moy/
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [RFC] Possibility to choose ~/.config/git/config instead of ~/.gitconfig
2012-05-25 17:29 ` Matthieu Moy
@ 2012-05-25 17:44 ` Jonathan Nieder
0 siblings, 0 replies; 26+ messages in thread
From: Jonathan Nieder @ 2012-05-25 17:44 UTC (permalink / raw)
To: Matthieu Moy
Cc: nguyenhu, git, Valentin DUPERRAY, Franck JONAS, Lucien KONG,
Thomas NGUY, Huynh Khoi Nguyen NGUYEN
Matthieu Moy wrote:
> Jonathan Nieder <jrnieder@gmail.com> writes:
>> What other hidden files at the root of the user's directory are you
>> talking about?
>
> A typical user configuration (or at least mine ;-) ) can include:
>
> [core]
> excludesfile = ~/.gitignore
> attributesfile = ~/.gitattributes
Ah, right, this line from .gitconfig: ;-)
[core] excludesfile=~/.config/gitexcludes
[...]
> Actually, I now remember trying to find a default value some time ago:
>
> http://thread.gmane.org/gmane.comp.version-control.git/133343
>
> The conclusion essentially boiled down to "let's drop the patch until
> there's a clear consensus on what the default value should be", and
> "don't default to ~/.gitsomething, because it will be painful to migrate
> to a user config directory later".
>
> Once it's official that the configuration is in stg like ~/.config/git/,
> we can start thinking about a default value for core.excludesfile and
> core.attributesfile, in the same directory (note: we're just talking
> about default values here, so users having set the variable explicitely
> won't be affected by the change).
Makes sense to me.
Thanks,
Jonathan
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [RFC] Possibility to choose ~/.config/git/config instead of ~/.gitconfig
2012-05-25 16:15 [RFC] Possibility to choose ~/.config/git/config instead of ~/.gitconfig nguyenhu
2012-05-25 17:01 ` Jonathan Nieder
@ 2012-05-25 17:31 ` Hilco Wijbenga
2012-05-25 17:42 ` Jonathan Nieder
2012-05-25 18:13 ` Junio C Hamano
2012-05-26 10:45 ` Felipe Contreras
2 siblings, 2 replies; 26+ messages in thread
From: Hilco Wijbenga @ 2012-05-25 17:31 UTC (permalink / raw)
To: nguyenhu
Cc: git, matthieu.moy, Valentin DUPERRAY, Franck JONAS, Lucien KONG,
Thomas NGUY, Huynh Khoi Nguyen NGUYEN, Jonathan Nieder
On 25 May 2012 09:15, <nguyenhu@minatec.inpg.fr> wrote:
> Hello,
>
> As you know, git stores its configuration in ~/.gitconfig file and in other
> hidden files at the root of the user's directory.
>
> We would like to have a configuration directory instead of all these
> configuration files by following the XDG specification because:
> - not a lot of hidden files at the root, so better view
> - one directory per software in ~/.config
>
> We would like to give to users the possibility to store configuration in
> ~/.config/git/config file.
This is, of course, highly OS dependent. Ironically, I'd say we need a
setting in .gitconfig for it. :-)
There is also /etc(/default|/sysconfig|)/git/config to consider
(perhaps for some settings that should be the same for everyone).
Better yet, it would be nice if at least some settings could be part
of the repository itself (whitespace handling e.g.).
> git would store its configuration in ~/.config/git/config file if:
> - this file exists,
> - and ~/.gitconfig file doesn't.
> Otherwise git would store its configuration in ~/.gitconfig as usual.
>
> If you don't create ~/.config/git/config, there is no change.
>
> What do you think about it ?
>
> I will send you a patch today.
>
> Thanks,
>
> Lucien KONG,
> Valentin DUPERRAY,
> Huynh Khoi Nguyen NGUYEN,
> Thomas NGUY,
> Franck JONAS
>
> Grenoble INP ENSIMAG
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [RFC] Possibility to choose ~/.config/git/config instead of ~/.gitconfig
2012-05-25 17:31 ` Hilco Wijbenga
@ 2012-05-25 17:42 ` Jonathan Nieder
2012-05-25 17:47 ` Hilco Wijbenga
2012-05-25 17:54 ` Matthieu Moy
2012-05-25 18:13 ` Junio C Hamano
1 sibling, 2 replies; 26+ messages in thread
From: Jonathan Nieder @ 2012-05-25 17:42 UTC (permalink / raw)
To: Hilco Wijbenga
Cc: nguyenhu, git, matthieu.moy, Valentin DUPERRAY, Franck JONAS,
Lucien KONG, Thomas NGUY, Huynh Khoi Nguyen NGUYEN, Jeff King,
Nguyễn Thái Ngọc Duy
Hi Hilco,
Hilco Wijbenga wrote:
> This is, of course, highly OS dependent. Ironically, I'd say we need a
> setting in .gitconfig for it. :-)
>
> There is also /etc(/default|/sysconfig|)/git/config to consider
> (perhaps for some settings that should be the same for everyone).
> Better yet, it would be nice if at least some settings could be part
> of the repository itself (whitespace handling e.g.).
The FILES section of git-config(1) might leave you happier. :)
Regarding $GIT_DIR/config, it says "The filename is of course relative
to the repository root, not the working directory.". Is this out of
date? (Cc-ing Peff and Duy.)
Jonathan
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [RFC] Possibility to choose ~/.config/git/config instead of ~/.gitconfig
2012-05-25 17:42 ` Jonathan Nieder
@ 2012-05-25 17:47 ` Hilco Wijbenga
2012-05-25 18:12 ` [PATCH] config doc: remove confusion about relative GIT_DIR from FILES section Jonathan Nieder
2012-05-25 18:20 ` [RFC] Possibility to choose ~/.config/git/config instead of ~/.gitconfig Junio C Hamano
2012-05-25 17:54 ` Matthieu Moy
1 sibling, 2 replies; 26+ messages in thread
From: Hilco Wijbenga @ 2012-05-25 17:47 UTC (permalink / raw)
To: Jonathan Nieder
Cc: nguyenhu, git, matthieu.moy, Valentin DUPERRAY, Franck JONAS,
Lucien KONG, Thomas NGUY, Huynh Khoi Nguyen NGUYEN, Jeff King,
Nguyễn Thái Ngọc
On 25 May 2012 10:42, Jonathan Nieder <jrnieder@gmail.com> wrote:
> Hi Hilco,
>
> Hilco Wijbenga wrote:
>
>> This is, of course, highly OS dependent. Ironically, I'd say we need a
>> setting in .gitconfig for it. :-)
>>
>> There is also /etc(/default|/sysconfig|)/git/config to consider
>> (perhaps for some settings that should be the same for everyone).
>> Better yet, it would be nice if at least some settings could be part
>> of the repository itself (whitespace handling e.g.).
>
> The FILES section of git-config(1) might leave you happier. :)
Indeed!
> Regarding $GIT_DIR/config, it says "The filename is of course relative
> to the repository root, not the working directory.". Is this out of
> date? (Cc-ing Peff and Duy.)
I'm sure it's not. Somehow, I had gotten it in my head that this
wasn't possible. I am going to start using this right away. :-)
Thanks!
^ permalink raw reply [flat|nested] 26+ messages in thread
* [PATCH] config doc: remove confusion about relative GIT_DIR from FILES section
2012-05-25 17:47 ` Hilco Wijbenga
@ 2012-05-25 18:12 ` Jonathan Nieder
2012-05-25 20:06 ` Jeff King
2012-05-25 18:20 ` [RFC] Possibility to choose ~/.config/git/config instead of ~/.gitconfig Junio C Hamano
1 sibling, 1 reply; 26+ messages in thread
From: Jonathan Nieder @ 2012-05-25 18:12 UTC (permalink / raw)
To: Hilco Wijbenga
Cc: nguyenhu, git, matthieu.moy, Valentin DUPERRAY, Franck JONAS,
Lucien KONG, Thomas NGUY, Huynh Khoi Nguyen NGUYEN, Jeff King,
Nguyễn Thái Ngọc, Junio C Hamano
From the FILES section of the git-config(1) manual:
$GIT_DIR/config::
Repository specific configuration file. (The filename is
of course relative to the repository root, not the working
directory.)
That's confusing because $GIT_DIR really is relative to the working
directory.
$ GIT_DIR=.git GIT_EDITOR='pwd; echo editing'
$ export GIT_DIR GIT_EDITOR
$ git config --edit --local
/home/jrn/src/git/Documentation
editing .git/config
It turns out that the comment is a remnant from older days when the
heading said ".git/config" (which is indeed relative to the top of the
worktree).
It was only when the heading was changed to refer more precisely to
<git dir>/config (see v1.5.3.2~18, AsciiDoc tweak to avoid leading
dot, 2007-09-14) that the parenthesis stopped making sense. Remove
it.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
Hilco Wijbenga wrote:
> On 25 May 2012 10:42, Jonathan Nieder <jrnieder@gmail.com> wrote:
>> Regarding $GIT_DIR/config, it says "The filename is of course relative
>> to the repository root, not the working directory.". Is this out of
>> date? (Cc-ing Peff and Duy.)
>
> I'm sure it's not.
You're right --- the current wording never made sense and is not an
example of accurate documentation going stale with later behavior
changes as I had suspected. Sorry for the noise.
Thanks,
Jonathan
Documentation/git-config.txt | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/Documentation/git-config.txt b/Documentation/git-config.txt
index 3f5d216a..d9463cb3 100644
--- a/Documentation/git-config.txt
+++ b/Documentation/git-config.txt
@@ -198,9 +198,7 @@ If not set explicitly with '--file', there are three files where
'git config' will search for configuration options:
$GIT_DIR/config::
- Repository specific configuration file. (The filename is
- of course relative to the repository root, not the working
- directory.)
+ Repository specific configuration file.
~/.gitconfig::
User-specific configuration file. Also called "global"
--
1.7.10
^ permalink raw reply related [flat|nested] 26+ messages in thread
* Re: [PATCH] config doc: remove confusion about relative GIT_DIR from FILES section
2012-05-25 18:12 ` [PATCH] config doc: remove confusion about relative GIT_DIR from FILES section Jonathan Nieder
@ 2012-05-25 20:06 ` Jeff King
0 siblings, 0 replies; 26+ messages in thread
From: Jeff King @ 2012-05-25 20:06 UTC (permalink / raw)
To: Jonathan Nieder
Cc: Hilco Wijbenga, nguyenhu, git, matthieu.moy, Valentin DUPERRAY,
Franck JONAS, Lucien KONG, Thomas NGUY, Huynh Khoi Nguyen NGUYEN,
Nguyễn Thái Ngọc, Junio C Hamano
On Fri, May 25, 2012 at 01:12:04PM -0500, Jonathan Nieder wrote:
> From the FILES section of the git-config(1) manual:
>
> $GIT_DIR/config::
> Repository specific configuration file. (The filename is
> of course relative to the repository root, not the working
> directory.)
>
> That's confusing because $GIT_DIR really is relative to the working
> directory.
>
> $ GIT_DIR=.git GIT_EDITOR='pwd; echo editing'
> $ export GIT_DIR GIT_EDITOR
> $ git config --edit --local
> /home/jrn/src/git/Documentation
> editing .git/config
>
> It turns out that the comment is a remnant from older days when the
> heading said ".git/config" (which is indeed relative to the top of the
> worktree).
>
> It was only when the heading was changed to refer more precisely to
> <git dir>/config (see v1.5.3.2~18, AsciiDoc tweak to avoid leading
> dot, 2007-09-14) that the parenthesis stopped making sense. Remove
> it.
Thanks for digging in the history for the answer.
> diff --git a/Documentation/git-config.txt b/Documentation/git-config.txt
> index 3f5d216a..d9463cb3 100644
> --- a/Documentation/git-config.txt
> +++ b/Documentation/git-config.txt
> @@ -198,9 +198,7 @@ If not set explicitly with '--file', there are three files where
> 'git config' will search for configuration options:
>
> $GIT_DIR/config::
> - Repository specific configuration file. (The filename is
> - of course relative to the repository root, not the working
> - directory.)
> + Repository specific configuration file.
>
> ~/.gitconfig::
> User-specific configuration file. Also called "global"
This makes a lot more sense to me.
Acked-by: Jeff King <peff@peff.net>
-Peff
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [RFC] Possibility to choose ~/.config/git/config instead of ~/.gitconfig
2012-05-25 17:47 ` Hilco Wijbenga
2012-05-25 18:12 ` [PATCH] config doc: remove confusion about relative GIT_DIR from FILES section Jonathan Nieder
@ 2012-05-25 18:20 ` Junio C Hamano
1 sibling, 0 replies; 26+ messages in thread
From: Junio C Hamano @ 2012-05-25 18:20 UTC (permalink / raw)
To: Hilco Wijbenga
Cc: Jonathan Nieder, nguyenhu, git, matthieu.moy, Valentin DUPERRAY,
Franck JONAS, Lucien KONG, Thomas NGUY, Huynh Khoi Nguyen NGUYEN,
Jeff King, Nguyễn Thái Ngọc
Hilco Wijbenga <hilco.wijbenga@gmail.com> writes:
>> Regarding $GIT_DIR/config, it says "The filename is of course relative
>> to the repository root, not the working directory.". Is this out of
>> date? (Cc-ing Peff and Duy.)
It is only worded awkwardly, I think. The above is merely trying to say
that you do not place 'config' anywhere in the working tree; in other
words, "repository" in the above refers to GIT_DIR, and the "root" means
not inside refs/, objects/, or anywhere, just next to index, HEAD, etc.
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [RFC] Possibility to choose ~/.config/git/config instead of ~/.gitconfig
2012-05-25 17:42 ` Jonathan Nieder
2012-05-25 17:47 ` Hilco Wijbenga
@ 2012-05-25 17:54 ` Matthieu Moy
2012-05-25 20:11 ` Jeff King
1 sibling, 1 reply; 26+ messages in thread
From: Matthieu Moy @ 2012-05-25 17:54 UTC (permalink / raw)
To: Jonathan Nieder
Cc: Hilco Wijbenga, nguyenhu, git, Valentin DUPERRAY, Franck JONAS,
Lucien KONG, Thomas NGUY, Huynh Khoi Nguyen NGUYEN, Jeff King,
Nguyễn Thái Ngọc Duy
Jonathan Nieder <jrnieder@gmail.com> writes:
> Regarding $GIT_DIR/config, it says "The filename is of course relative
> to the repository root, not the working directory.". Is this out of
> date? (Cc-ing Peff and Duy.)
This is a per-repository, but not "part of the repository" in the sense
"files tracked by Git" (i.e. it's not fetched by git clone).
Having a $GIT_WORKTREE/.gitconfig file would be very nice, but raises a
lot of security issues, so it's a much larger project (define which
configuration values are allowed there, possibly take them into account
at clone time, i.e. before checking out the files, and so on). Most
likely out of the scope of my students' project ;-).
--
Matthieu Moy
http://www-verimag.imag.fr/~moy/
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [RFC] Possibility to choose ~/.config/git/config instead of ~/.gitconfig
2012-05-25 17:54 ` Matthieu Moy
@ 2012-05-25 20:11 ` Jeff King
0 siblings, 0 replies; 26+ messages in thread
From: Jeff King @ 2012-05-25 20:11 UTC (permalink / raw)
To: Matthieu Moy
Cc: Jonathan Nieder, Hilco Wijbenga, nguyenhu, git, Valentin DUPERRAY,
Franck JONAS, Lucien KONG, Thomas NGUY, Huynh Khoi Nguyen NGUYEN,
Nguyễn Thái Ngọc Duy
On Fri, May 25, 2012 at 07:54:06PM +0200, Matthieu Moy wrote:
> Having a $GIT_WORKTREE/.gitconfig file would be very nice, but raises a
> lot of security issues, so it's a much larger project (define which
> configuration values are allowed there, possibly take them into account
> at clone time, i.e. before checking out the files, and so on). Most
> likely out of the scope of my students' project ;-).
Yes, I have proposed it in multiple forms, and the discussion always
ends in "gross, it's too complex".
If you really want to do it, the recommended way at this point is:
# review for any issues (1)
less .gitconfig
# assuming it's OK, copy into place (2)
cp .gitconfig .git/config-from-upstream
# include it
git config include.path config-from-upstream
And then repeat steps (1) and (2) whenever you want to update from
upstream. That fixes not only the security issues, but also means that
you won't accidentally drop back to some antique bogus config when you
"git checkout $some_old_version".
-Peff
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [RFC] Possibility to choose ~/.config/git/config instead of ~/.gitconfig
2012-05-25 17:31 ` Hilco Wijbenga
2012-05-25 17:42 ` Jonathan Nieder
@ 2012-05-25 18:13 ` Junio C Hamano
2012-05-25 18:25 ` Jonathan Nieder
1 sibling, 1 reply; 26+ messages in thread
From: Junio C Hamano @ 2012-05-25 18:13 UTC (permalink / raw)
To: Hilco Wijbenga
Cc: nguyenhu, git, matthieu.moy, Valentin DUPERRAY, Franck JONAS,
Lucien KONG, Thomas NGUY, Huynh Khoi Nguyen NGUYEN,
Jonathan Nieder
Hilco Wijbenga <hilco.wijbenga@gmail.com> writes:
> This is, of course, highly OS dependent. Ironically, I'd say we need a
> setting in .gitconfig for it. :-)
>
> There is also /etc(/default|/sysconfig|)/git/config to consider
> (perhaps for some settings that should be the same for everyone).
> Better yet, it would be nice if at least some settings could be part
> of the repository itself (whitespace handling e.g.).
As long as we make sure we have knobs for distro packagers and people
building from the source to twist so that they can easily name the places
they want us to read from and write to, what we decide in-tree does not
matter. We default to ~/.gitconfig and /etc/gitconfig as before, and that
is perfectly fine. We already have ETC_GITCONFIG, so the only thing it
might be nicer to add is the build configurability of ~/.gitconfig file,
no?
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [RFC] Possibility to choose ~/.config/git/config instead of ~/.gitconfig
2012-05-25 18:13 ` Junio C Hamano
@ 2012-05-25 18:25 ` Jonathan Nieder
2012-05-25 18:34 ` Junio C Hamano
0 siblings, 1 reply; 26+ messages in thread
From: Jonathan Nieder @ 2012-05-25 18:25 UTC (permalink / raw)
To: Junio C Hamano
Cc: Hilco Wijbenga, nguyenhu, git, matthieu.moy, Valentin DUPERRAY,
Franck JONAS, Lucien KONG, Thomas NGUY, Huynh Khoi Nguyen NGUYEN
Junio C Hamano wrote:
> We already have ETC_GITCONFIG, so the only thing it
> might be nicer to add is the build configurability of ~/.gitconfig file,
> no?
If we were trying to solve a different problem ("my filesystem does
not support filenames starting with '.' with more than three
characters afterward") then I would agree, but in this case no. HOME
directories are often shared between multiple machines, even machines
with different operating systems.
If I understand correctly, the proposal that started this thread was
to give people a chance to tidy their HOME directory by moving
personal git configuration under ~/.config/git/. Git would detect it
automatically. I think the main complication would be phasing in the
change slowly and carefully so people helping each other with git
problems do not get confused:
"Why is this setting not taking effect? It's in ~/.config/gitconfig
just like it should be. Oh, what git version do you have?"
and
"Is there no .gitconfig? Okay, we can assume all the default
settings are in use. Now let's..."
That's why I'd be happy to see how an initial patch approaches the
transition, to see how it can be improved to happen smoothly.
Jonathan
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [RFC] Possibility to choose ~/.config/git/config instead of ~/.gitconfig
2012-05-25 18:25 ` Jonathan Nieder
@ 2012-05-25 18:34 ` Junio C Hamano
2012-05-25 18:44 ` Jonathan Nieder
0 siblings, 1 reply; 26+ messages in thread
From: Junio C Hamano @ 2012-05-25 18:34 UTC (permalink / raw)
To: Jonathan Nieder
Cc: Hilco Wijbenga, nguyenhu, git, matthieu.moy, Valentin DUPERRAY,
Franck JONAS, Lucien KONG, Thomas NGUY, Huynh Khoi Nguyen NGUYEN
Jonathan Nieder <jrnieder@gmail.com> writes:
> If I understand correctly, the proposal that started this thread was
> to give people a chance to tidy their HOME directory by moving
> personal git configuration under ~/.config/git/.
So it is exactly "I do not want ~/.gitconfig, I want ~/.config/git", no?
That is something distro should be able to decide.
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [RFC] Possibility to choose ~/.config/git/config instead of ~/.gitconfig
2012-05-25 18:34 ` Junio C Hamano
@ 2012-05-25 18:44 ` Jonathan Nieder
2012-05-25 18:58 ` Junio C Hamano
2012-05-25 19:01 ` Matthieu Moy
0 siblings, 2 replies; 26+ messages in thread
From: Jonathan Nieder @ 2012-05-25 18:44 UTC (permalink / raw)
To: Junio C Hamano
Cc: Hilco Wijbenga, nguyenhu, git, matthieu.moy, Valentin DUPERRAY,
Franck JONAS, Lucien KONG, Thomas NGUY, Huynh Khoi Nguyen NGUYEN
Junio C Hamano wrote:
> Jonathan Nieder <jrnieder@gmail.com> writes:
>> If I understand correctly, the proposal that started this thread was
>> to give people a chance to tidy their HOME directory by moving
>> personal git configuration under ~/.config/git/.
>
> So it is exactly "I do not want ~/.gitconfig, I want ~/.config/git", no?
>
> That is something distro should be able to decide.
Except that there is nothing distro-specific about it. Do you really
want the config file to have a different name depending on whether one
is using Debian, Fedora, Mac OS X, Gentoo, one of the various builds of
git on Windows, Solaris, ...?
Besides, with my distro package maintainer hat on, I can tell you that
switching the config file to ~/.config/git and not reading
~/.gitconfig would be a complete nonstarter. That would mean that the
existing user configuration for everyone would just seem to disappear.
Once the code to read both files is written, why would one want that
to be distro-specific and not something shared?
Hoping that clarifies a little,
Jonathan
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [RFC] Possibility to choose ~/.config/git/config instead of ~/.gitconfig
2012-05-25 18:44 ` Jonathan Nieder
@ 2012-05-25 18:58 ` Junio C Hamano
2012-05-25 19:13 ` Matthieu Moy
2012-05-25 19:17 ` Jonathan Nieder
2012-05-25 19:01 ` Matthieu Moy
1 sibling, 2 replies; 26+ messages in thread
From: Junio C Hamano @ 2012-05-25 18:58 UTC (permalink / raw)
To: Jonathan Nieder
Cc: Junio C Hamano, Hilco Wijbenga, nguyenhu, git, matthieu.moy,
Valentin DUPERRAY, Franck JONAS, Lucien KONG, Thomas NGUY,
Huynh Khoi Nguyen NGUYEN
Jonathan Nieder <jrnieder@gmail.com> writes:
>> So it is exactly "I do not want ~/.gitconfig, I want ~/.config/git", no?
>>
>> That is something distro should be able to decide.
>
> Except that there is nothing distro-specific about it. Do you really
> want the config file to have a different name depending on whether one
> is using Debian, Fedora,...
Not me personally. But distros want to do that, it's their choice.
> Besides, with my distro package maintainer hat on, I can tell you that
> switching the config file to ~/.config/git and not reading
> ~/.gitconfig would be a complete nonstarter.
Absolutely. So don't choose to deliberately introduce backward
incompatibliity. Problem solved.
Why is it bad to keep using ~/.gitconfig in the first place? The UNIX
convention to exclude names that begin with dot is not working for you?
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [RFC] Possibility to choose ~/.config/git/config instead of ~/.gitconfig
2012-05-25 18:58 ` Junio C Hamano
@ 2012-05-25 19:13 ` Matthieu Moy
2012-05-25 19:17 ` Jonathan Nieder
1 sibling, 0 replies; 26+ messages in thread
From: Matthieu Moy @ 2012-05-25 19:13 UTC (permalink / raw)
To: Junio C Hamano
Cc: Jonathan Nieder, Hilco Wijbenga, nguyenhu, git, Valentin DUPERRAY,
Franck JONAS, Lucien KONG, Thomas NGUY, Huynh Khoi Nguyen NGUYEN
Junio C Hamano <gitster@pobox.com> writes:
>> Besides, with my distro package maintainer hat on, I can tell you that
>> switching the config file to ~/.config/git and not reading
>> ~/.gitconfig would be a complete nonstarter.
>
> Absolutely. So don't choose to deliberately introduce backward
> incompatibliity. Problem solved.
It doesn't have to be backward incompatible. The proposal is to _allow_
users to have a ~/.config/git/config file, not to _force_ them to have
one.
If Git reads both files, then ~/.gitconfig lovers can continue with it,
and are not affected.
> Why is it bad to keep using ~/.gitconfig in the first place? The UNIX
> convention to exclude names that begin with dot is not working for you?
The "It's a convention" argument doesn't work here. XDG is also a rather
widely used convention these days, so "why not follow the convention"
can be used both in favor of ~/.gitconfig or ~/.config/git/config.
~/.gitconfig alone would not be a huge problem, although personnally
hate it already. I like to version my handwritten configuration files,
but I don't want my $HOME to be a git repository. I already have a
~/etc/ directory with my configuration files in it, and ~/.gitconfig is
basically a symbolic link. I wouldn't have to re-structure my $HOME if I
had a structured and standard configuration directory like ~/.config.
Now, the real issue is that we're starting to have several user-wide
config files (core.excludesfile, core.attributesfile, maybe one day
we'll want others like user-wide hooks?), and having multiple
~/.git<something> really feels wrong. Just like we have /etc/<file> for
applications that have only one configuration file, and /etc/<directory>
for ones who need more, it seems sensible to have a configuration
directory for a user, not just a set of configuration files in $HOME.
--
Matthieu Moy
http://www-verimag.imag.fr/~moy/
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [RFC] Possibility to choose ~/.config/git/config instead of ~/.gitconfig
2012-05-25 18:58 ` Junio C Hamano
2012-05-25 19:13 ` Matthieu Moy
@ 2012-05-25 19:17 ` Jonathan Nieder
2012-05-25 19:29 ` Matthieu Moy
1 sibling, 1 reply; 26+ messages in thread
From: Jonathan Nieder @ 2012-05-25 19:17 UTC (permalink / raw)
To: Junio C Hamano
Cc: Hilco Wijbenga, nguyenhu, git, matthieu.moy, Valentin DUPERRAY,
Franck JONAS, Lucien KONG, Thomas NGUY, Huynh Khoi Nguyen NGUYEN
Junio C Hamano wrote:
> Why is it bad to keep using ~/.gitconfig in the first place? The UNIX
> convention to exclude names that begin with dot is not working for you?
Ok, now you're making more sense. :)
I don't think anyone was proposing dropping support for .gitconfig.
But:
Any patch to add support for ~/.config/git should of course take care
to include a rationale that answers this question. (I am guessing
that putting all user git configuration in one directory is part of
the goal, and separating temporary files like ~/.fontconfig/*.cache*
from configuration files like ~/.mutt/muttrc is another part.)
Ciao,
Jonathan
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [RFC] Possibility to choose ~/.config/git/config instead of ~/.gitconfig
2012-05-25 19:17 ` Jonathan Nieder
@ 2012-05-25 19:29 ` Matthieu Moy
2012-05-25 19:35 ` Jonathan Nieder
0 siblings, 1 reply; 26+ messages in thread
From: Matthieu Moy @ 2012-05-25 19:29 UTC (permalink / raw)
To: Jonathan Nieder
Cc: Junio C Hamano, Hilco Wijbenga, nguyenhu, git, Valentin DUPERRAY,
Franck JONAS, Lucien KONG, Thomas NGUY, Huynh Khoi Nguyen NGUYEN
Jonathan Nieder <jrnieder@gmail.com> writes:
> I am guessing
> that putting all user git configuration in one directory is part of
> the goal, and separating temporary files like ~/.fontconfig/*.cache*
> from configuration files like ~/.mutt/muttrc is another part.
That's another good thing with XDG (~/.config Vs ~/.cache/ for example),
but I don't think Git would have anything user-wide that would not be
configuration.
--
Matthieu Moy
http://www-verimag.imag.fr/~moy/
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [RFC] Possibility to choose ~/.config/git/config instead of ~/.gitconfig
2012-05-25 19:29 ` Matthieu Moy
@ 2012-05-25 19:35 ` Jonathan Nieder
2012-05-25 19:37 ` Jonathan Nieder
2012-05-25 19:39 ` Matthieu Moy
0 siblings, 2 replies; 26+ messages in thread
From: Jonathan Nieder @ 2012-05-25 19:35 UTC (permalink / raw)
To: Matthieu Moy
Cc: Junio C Hamano, Hilco Wijbenga, nguyenhu, git, Valentin DUPERRAY,
Franck JONAS, Lucien KONG, Thomas NGUY, Huynh Khoi Nguyen NGUYEN
Matthieu Moy wrote:
> That's another good thing with XDG (~/.config Vs ~/.cache/ for example),
> but I don't think Git would have anything user-wide that would not be
> configuration.
Of course, but your home directory that you read with "ls -A" does.
Putting configuration in ~/.config makes it easier to find amid all
that noise.
That said, as Junio wrote before[1]:
> It is not _too_ bad to treat ~/.gitconfig specially and support reading
> from ~/.$SOMEGITTTYNAME/{excludes,attributes} files.
That's what vim does --- its main configuration file is ~/.vimrc, and
there are also some supporting files in ~/.config/vim/.
Wouldn't that be a good place to start?
Jonathan
[1] http://thread.gmane.org/gmane.comp.version-control.git/133343/focus=135921
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [RFC] Possibility to choose ~/.config/git/config instead of ~/.gitconfig
2012-05-25 19:35 ` Jonathan Nieder
@ 2012-05-25 19:37 ` Jonathan Nieder
2012-05-25 19:39 ` Matthieu Moy
1 sibling, 0 replies; 26+ messages in thread
From: Jonathan Nieder @ 2012-05-25 19:37 UTC (permalink / raw)
To: Matthieu Moy
Cc: Junio C Hamano, Hilco Wijbenga, nguyenhu, git, Valentin DUPERRAY,
Franck JONAS, Lucien KONG, Thomas NGUY, Huynh Khoi Nguyen NGUYEN
Jonathan Nieder wrote:
> as Junio wrote before[1]:
>> It is not _too_ bad to treat ~/.gitconfig specially and support reading
>> from ~/.$SOMEGITTTYNAME/{excludes,attributes} files.
>
> That's what vim does --- its main configuration file is ~/.vimrc, and
> there are also some supporting files in ~/.config/vim/.
>
> Wouldn't that be a good place to start?
Correction: I meant "also some supporting files in ~/.vim/".
Sorry for the noise.
Jonathan
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [RFC] Possibility to choose ~/.config/git/config instead of ~/.gitconfig
2012-05-25 19:35 ` Jonathan Nieder
2012-05-25 19:37 ` Jonathan Nieder
@ 2012-05-25 19:39 ` Matthieu Moy
1 sibling, 0 replies; 26+ messages in thread
From: Matthieu Moy @ 2012-05-25 19:39 UTC (permalink / raw)
To: Jonathan Nieder
Cc: Junio C Hamano, Hilco Wijbenga, nguyenhu, git, Valentin DUPERRAY,
Franck JONAS, Lucien KONG, Thomas NGUY, Huynh Khoi Nguyen NGUYEN
Jonathan Nieder <jrnieder@gmail.com> writes:
> Matthieu Moy wrote:
>
>> That's another good thing with XDG (~/.config Vs ~/.cache/ for example),
>> but I don't think Git would have anything user-wide that would not be
>> configuration.
>
> Of course, but your home directory that you read with "ls -A" does.
> Putting configuration in ~/.config makes it easier to find amid all
> that noise.
Yes. My sentence above was just replying to "separating temporary files"
(i.e. putting stuff in ~/.cache/), I over-quoted your message.
--
Matthieu Moy
http://www-verimag.imag.fr/~moy/
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [RFC] Possibility to choose ~/.config/git/config instead of ~/.gitconfig
2012-05-25 18:44 ` Jonathan Nieder
2012-05-25 18:58 ` Junio C Hamano
@ 2012-05-25 19:01 ` Matthieu Moy
1 sibling, 0 replies; 26+ messages in thread
From: Matthieu Moy @ 2012-05-25 19:01 UTC (permalink / raw)
To: Jonathan Nieder
Cc: Junio C Hamano, Hilco Wijbenga, nguyenhu, git, Valentin DUPERRAY,
Franck JONAS, Lucien KONG, Thomas NGUY, Huynh Khoi Nguyen NGUYEN
Jonathan Nieder <jrnieder@gmail.com> writes:
> Junio C Hamano wrote:
>> Jonathan Nieder <jrnieder@gmail.com> writes:
>
>>> If I understand correctly, the proposal that started this thread was
>>> to give people a chance to tidy their HOME directory by moving
>>> personal git configuration under ~/.config/git/.
>>
>> So it is exactly "I do not want ~/.gitconfig, I want ~/.config/git", no?
>>
>> That is something distro should be able to decide.
>
> Except that there is nothing distro-specific about it. Do you really
> want the config file to have a different name depending on whether one
> is using Debian, Fedora, Mac OS X, Gentoo, one of the various builds of
> git on Windows, Solaris, ...?
I agree. Please don't encourage distro to make incompatible
configuration changes.
--
Matthieu Moy
http://www-verimag.imag.fr/~moy/
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [RFC] Possibility to choose ~/.config/git/config instead of ~/.gitconfig
2012-05-25 16:15 [RFC] Possibility to choose ~/.config/git/config instead of ~/.gitconfig nguyenhu
2012-05-25 17:01 ` Jonathan Nieder
2012-05-25 17:31 ` Hilco Wijbenga
@ 2012-05-26 10:45 ` Felipe Contreras
2012-05-26 10:59 ` Heiko Voigt
2 siblings, 1 reply; 26+ messages in thread
From: Felipe Contreras @ 2012-05-26 10:45 UTC (permalink / raw)
To: nguyenhu
Cc: git, matthieu.moy, Valentin DUPERRAY, Franck JONAS, Lucien KONG,
Thomas NGUY, Huynh Khoi Nguyen NGUYEN
On Fri, May 25, 2012 at 6:15 PM, <nguyenhu@minatec.inpg.fr> wrote:
> As you know, git stores its configuration in ~/.gitconfig file and in other
> hidden files at the root of the user's directory.
>
> We would like to have a configuration directory instead of all these
> configuration files by following the XDG specification because:
> - not a lot of hidden files at the root, so better view
> - one directory per software in ~/.config
>
> We would like to give to users the possibility to store configuration in
> ~/.config/git/config file.
I like this, but it shouldn't be "~/.config", it should be $XDG_CONFIG_HOME.
--
Felipe Contreras
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [RFC] Possibility to choose ~/.config/git/config instead of ~/.gitconfig
2012-05-26 10:45 ` Felipe Contreras
@ 2012-05-26 10:59 ` Heiko Voigt
0 siblings, 0 replies; 26+ messages in thread
From: Heiko Voigt @ 2012-05-26 10:59 UTC (permalink / raw)
To: Felipe Contreras
Cc: nguyenhu, git, matthieu.moy, Valentin DUPERRAY, Franck JONAS,
Lucien KONG, Thomas NGUY, Huynh Khoi Nguyen NGUYEN
Hi,
On Sat, May 26, 2012 at 12:45:52PM +0200, Felipe Contreras wrote:
> On Fri, May 25, 2012 at 6:15 PM, <nguyenhu@minatec.inpg.fr> wrote:
>
> > As you know, git stores its configuration in ~/.gitconfig file and in other
> > hidden files at the root of the user's directory.
> >
> > We would like to have a configuration directory instead of all these
> > configuration files by following the XDG specification because:
> > - not a lot of hidden files at the root, so better view
> > - one directory per software in ~/.config
> >
> > We would like to give to users the possibility to store configuration in
> > ~/.config/git/config file.
>
> I like this, but it shouldn't be "~/.config", it should be $XDG_CONFIG_HOME.
If we do that what about a fallback to .config for operating systems
that do not have XDG? E.g. Git for Windows would then also be able to
benefit from that.
Cheers Heiko
^ permalink raw reply [flat|nested] 26+ messages in thread
end of thread, other threads:[~2012-05-26 11:05 UTC | newest]
Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-25 16:15 [RFC] Possibility to choose ~/.config/git/config instead of ~/.gitconfig nguyenhu
2012-05-25 17:01 ` Jonathan Nieder
2012-05-25 17:29 ` Matthieu Moy
2012-05-25 17:44 ` Jonathan Nieder
2012-05-25 17:31 ` Hilco Wijbenga
2012-05-25 17:42 ` Jonathan Nieder
2012-05-25 17:47 ` Hilco Wijbenga
2012-05-25 18:12 ` [PATCH] config doc: remove confusion about relative GIT_DIR from FILES section Jonathan Nieder
2012-05-25 20:06 ` Jeff King
2012-05-25 18:20 ` [RFC] Possibility to choose ~/.config/git/config instead of ~/.gitconfig Junio C Hamano
2012-05-25 17:54 ` Matthieu Moy
2012-05-25 20:11 ` Jeff King
2012-05-25 18:13 ` Junio C Hamano
2012-05-25 18:25 ` Jonathan Nieder
2012-05-25 18:34 ` Junio C Hamano
2012-05-25 18:44 ` Jonathan Nieder
2012-05-25 18:58 ` Junio C Hamano
2012-05-25 19:13 ` Matthieu Moy
2012-05-25 19:17 ` Jonathan Nieder
2012-05-25 19:29 ` Matthieu Moy
2012-05-25 19:35 ` Jonathan Nieder
2012-05-25 19:37 ` Jonathan Nieder
2012-05-25 19:39 ` Matthieu Moy
2012-05-25 19:01 ` Matthieu Moy
2012-05-26 10:45 ` Felipe Contreras
2012-05-26 10:59 ` Heiko Voigt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).