Re: [RFC] Possibility to choose ~/.config/git/config instead of ~/.gitconfig

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [RFC] Possibility to choose ~/.config/git/config instead of ~/.gitconfig

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:53:54

Hilco Wijbenga [off-list ref] 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?

Re: [RFC] Possibility to choose ~/.config/git/config instead of ~/.gitconfig

From: Jonathan Nieder <hidden>
Date: 2016-06-15 22:53:54

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help