git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: NGUYEN Huynh Khoi Nguyen <nguyenhu@ensimag.imag.fr>,
	git@vger.kernel.org, Matthieu.Moy@grenoble-inp.fr,
	NGUYEN Huynh Khoi Nguyen <nguyenhu@ensibm.imag.fr>
Subject: Re: [PATCH 1/2] Add possibility to store configuration in ~/.config/git/config file
Date: Fri, 25 May 2012 14:25:38 -0700	[thread overview]
Message-ID: <7vd35sq7fx.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <20120525203056.GC4364@sigill.intra.peff.net> (Jeff King's message of "Fri, 25 May 2012 16:30:56 -0400")

Jeff King <peff@peff.net> writes:

> On Fri, May 25, 2012 at 09:47:18PM +0200, NGUYEN Huynh Khoi Nguyen wrote:
>
>> git will store its configuration in ~/.config/git/config file if this file
>> exists and ~/.gitconfig file doesn't, otherwise git store its configuration
>> in ~/.gitconfig as usual
>
> What about reading? For maximum compatibility, we should always read
> from _both_ of them, and choose between them only when writing, no? It
> looks like your patch will only read from one or the other.
>
> At first people will have only one or the other, but people using
> multiple versions of git, or people following already-written
> instructions on the web about modifying ~/.gitconfig could end up with
> both.

Isn't it actually much worse than that?

If you read from .gitconfig and also from the new location, but update
only the new location, people who use two versions of git will be in a
very confusing situation.  Randomly, some of their updates are always in
effect, and others only appear sometimes, and after wasting a lot of time
and hair scratching their heads, they will realize that writing with old
versions of Git will store values to a place visible to both versions,
while writing with new versions will store values to a place visible only
to new versions.

I'd rather see it ignore the new location as long as ~/.gitconfig exists
(and if only the new location exists, read from and write to it), and have
users make a conscious decision to transition.  That is:

 - If ~/.gitconfig exists, do not do anything new.  Just exercise the
   original code.  For these users, ~/.config/ does _not_ exist as far as
   Git is concerned.

 - (optional) If ~/.gitconfig exists, offer _moving_ it to the new
   location after telling the user to make sure that the user will never
   use older version of git again, and move it if the user agrees.

 - Otherwise, read from and write to the new location.

  reply	other threads:[~2012-05-25 21:25 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-25 19:47 [PATCH 1/2] Add possibility to store configuration in ~/.config/git/config file NGUYEN Huynh Khoi Nguyen
2012-05-25 19:47 ` [PATCH 2/2] Test File Name: t1306-second-config-file.sh NGUYEN Huynh Khoi Nguyen
2012-05-25 20:30 ` [PATCH 1/2] Add possibility to store configuration in ~/.config/git/config file Jeff King
2012-05-25 21:25   ` Junio C Hamano [this message]
2012-05-25 21:44     ` Jeff King
2012-05-26 10:15       ` Nguyen Thai Ngoc Duy
2012-05-26 21:54         ` Jeff King
2012-05-28 21:05           ` David Aguilar
2012-05-26  9:05     ` Matthieu Moy
2012-05-25 21:26 ` jaseem abid
2012-05-26  8:53 ` Matthieu Moy
2012-05-26 21:49   ` Jeff King
  -- strict thread matches above, loose matches on Subject: below --
2012-05-28 16:16 nguyenhu

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=7vd35sq7fx.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=Matthieu.Moy@grenoble-inp.fr \
    --cc=git@vger.kernel.org \
    --cc=nguyenhu@ensibm.imag.fr \
    --cc=nguyenhu@ensimag.imag.fr \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).