All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Sebastian Schuberth <sschuberth@gmail.com>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: Querying Git for the path to the system config file
Date: Wed, 20 May 2015 17:01:43 -0400	[thread overview]
Message-ID: <20150520210143.GC8421@peff.net> (raw)
In-Reply-To: <CAHGBnuPCZCBsBXqGo26E-pcuZXZBxL8GwAehW4UziDpB2V8Npw@mail.gmail.com>

On Wed, May 20, 2015 at 10:23:55PM +0200, Sebastian Schuberth wrote:

> I was in need to find out the path to the system-wide config file that
> Git is using. I need to do this in a platform-independent way (Linux,
> Mac OS X, Windows). What I came up with is
> 
> $ GIT_EDITOR=echo git config --system --edit
> 
> to trick Git into printing the path instead of opening the file in an editor.
> 
> Just wondering, is there a less hacky way to do that?

No, there isn't. It's baked in at compile-time, so something similar to
"git --exec-path" might make sense (but if we are going to start
exposing a lot of build flags, it might be nice to come up with some
organized system rather than haphazardly adding options).

Of course adding a new option probably won't help you, as it will take
some time before it can be used reliably. I think the hack you came up
with is pretty reasonable in the meantime.

-Peff

  reply	other threads:[~2015-05-20 21:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-20 20:23 Querying Git for the path to the system config file Sebastian Schuberth
2015-05-20 21:01 ` Jeff King [this message]
2015-05-20 21:22   ` Sebastian Schuberth

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=20150520210143.GC8421@peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=sschuberth@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.