git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anurag Priyam <anurag08priyam@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Ramkumar Ramachandra <artagnon@gmail.com>,
	Git List <git@vger.kernel.org>
Subject: Re: Configuring the location of ~/.gitconfig
Date: Thu, 27 Sep 2012 12:10:01 +0530	[thread overview]
Message-ID: <CAD1m08Wz7WqP8Yxgc6xuhBSntQ0PS6hGOzHWrcd0VAbARmkuUA@mail.gmail.com> (raw)
In-Reply-To: <7v6270t2tb.fsf@alter.siamese.dyndns.org>

On Thu, Sep 27, 2012 at 11:39 AM, Junio C Hamano <gitster@pobox.com> wrote:
> Ramkumar Ramachandra <artagnon@gmail.com> writes:
>
>> I'd like to configure the location of ~/.gitconfig through an
>> environment variable.  My usecase is a simple enough: I have a
>> repository with all my dotfiles, and I don't want to symlink
>> ~/dotfiles/.gitconfig from $HOME after cloning it.  Does anyone else
>> think the feature will be useful?
>
> Not me. For that particular use case, my approach (long before I
> switched the vcs that controls my dotfiles to git) have always been
> to have ~/src that is version controlled, with a Makefile that
> builds/adjusts dotfiles appropriately for each box and installs them
> in the proper place.

Makefile is what I wanted to avoid when I suggested Ram that maybe Git
could _optionally_ read the location of global gitconfig from an
environment variable that can be exported in zshenv or bash_profile.

I don't think either way is the best way of managing dotfiles.  Just a
matter of preference.  The environment variable approach doesn't
require you to run `make` everytime you sync your dotfiles across
different machines, and that is what I like.

Also, Git allows configuring the location of template directory via an
environment variable (GIT_TEMPLATE_DIR).  Since Git has already fixed
the location of global gitconfig, it might as well read the location
of template directory from there (init.templatedir).  Why the added
flexibility?  Well, I have been exploiting the feature to manage git
templates through my zsh configuration.

-- 
Anurag Priyam

  reply	other threads:[~2012-09-27  6:40 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-26 14:14 Configuring the location of ~/.gitconfig Ramkumar Ramachandra
2012-09-26 18:34 ` David Aguilar
2012-09-27  6:49   ` Ramkumar Ramachandra
2012-09-27 14:46     ` [PATCH] config: introduce GIT_GLOBAL_CONFIG to override ~/.gitconfig Ramkumar Ramachandra
2012-09-27 16:57       ` Matthieu Moy
2012-09-27 17:50         ` Junio C Hamano
2012-09-27 17:27       ` Junio C Hamano
2012-09-27 17:35       ` Jeff King
2012-09-27 19:57         ` Junio C Hamano
2012-09-27 20:51         ` Matthieu Moy
2012-09-28  7:05         ` Ramkumar Ramachandra
2012-09-27  6:09 ` Configuring the location of ~/.gitconfig Junio C Hamano
2012-09-27  6:40   ` Anurag Priyam [this message]
2012-09-27 17:16     ` Junio C Hamano

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=CAD1m08Wz7WqP8Yxgc6xuhBSntQ0PS6hGOzHWrcd0VAbARmkuUA@mail.gmail.com \
    --to=anurag08priyam@gmail.com \
    --cc=artagnon@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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).