git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Nguyen Thai Ngoc Duy <pclouds@gmail.com>
Cc: Junio C Hamano <gitster@pobox.com>,
	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: Sat, 26 May 2012 17:54:05 -0400	[thread overview]
Message-ID: <20120526215405.GC29463@sigill.intra.peff.net> (raw)
In-Reply-To: <CACsJy8BD_=6PtQeuDGEt2mee9tMWZB1hL2obu2f2KUmAENTEzA@mail.gmail.com>

On Sat, May 26, 2012 at 05:15:13PM +0700, Nguyen Thai Ngoc Duy wrote:

> > So I consider it the lesser of two evils. The rule is much simpler: "old
> > versions of git do not know about this new location". Which is
> > unavoidable, and easier to explain than "Old versions of git do not know
> > about this location. New versions do, but will sometimes ignore
> > depending on whether this other file exists, which might have been
> > created by an old version".
> 
> We could amend Junio's version a bit:
> 
>  - if both versions exist, warn loudly (optionally refuse to work) and
> suggest to symlink .gitconfig to .config/git/config

Yeah, that might help. At the same time, it is not necessarily an error
condition (e.g., if I track my ~/.config directory, but want to put
one-offs in ~/.gitconfig. On the other hand, you can set that up
manually with include.path = ~/.some-not-tracked-file, so maybe it is
not a use case worth worrying about).

> >  1. Start reading from the XDG location in addition to the old
> >     location. Always write to the old location.
> >
> >  2. Wait N time units until everybody reasonable has a version that
> >     does (1).
> >
> >  3. Start writing to the XDG location by default. Keep reading from the
> >     old version for compatibility.
> 
> Hang on.. this "by default" is only for Linux, or for every other OS too?

Sorry, I overstated a bit. It would be _safe_ to do step 3 like that
after waiting N time units, but we could also do something much less
drastic (like only writing to it when it exists, or when ~/.gitconfig
does not exist, or whatever). And no, I wouldn't think following XDG on
non-Linux machines would make much sense if no other programs on that
platform do so (I don't know what OS X is like, but I can imagine nobody
uses XDG paths on Windows).

-Peff

  reply	other threads:[~2012-05-26 21:54 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
2012-05-25 21:44     ` Jeff King
2012-05-26 10:15       ` Nguyen Thai Ngoc Duy
2012-05-26 21:54         ` Jeff King [this message]
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=20120526215405.GC29463@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=Matthieu.Moy@grenoble-inp.fr \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=nguyenhu@ensibm.imag.fr \
    --cc=nguyenhu@ensimag.imag.fr \
    --cc=pclouds@gmail.com \
    /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).