public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Michael J Gruber <git@drmicha•warpmail.net>
To: Junio C Hamano <gitster@pobox•com>
Cc: Nguyen Thai Ngoc Duy <pclouds@gmail•com>,
	Git Mailing List <git@vger•kernel.org>
Subject: Re: GIT_DIR vs. --git-dir
Date: Mon, 24 Sep 2012 16:51:25 +0200	[thread overview]
Message-ID: <5060736D.5020609@drmicha.warpmail.net> (raw)
In-Reply-To: <7vipb31o9x.fsf@alter.siamese.dyndns.org>

Junio C Hamano venit, vidit, dixit 24.09.2012 16:36:
> Nguyen Thai Ngoc Duy <pclouds@gmail•com> writes:
> 
>> "~" is a shell feature. Know your shell. If we make an exception for
>> --git-dir, we might have to support --blahblah=~/somewhere.
> 
> Correct but not entirely true.
> 
> When we know --git-dir=<path> must name a path, we should be able to
> do better.  See OPT_FILENAME in >parse-optios.h>, for inspiration.
> 
> MJG's patch later in this thread is conceptually OK but I do not
> think it should introduce a "expand and then setenv" helper that
> won't be useful unless the variable is GIT_DIR.  That pattern does
> not appear that often, and smells like a bad API design taste.

I can't quite parse. My little helper can be used for any path
environment variable, not just GIT_DIR. Granted, there aren't that many
in use.

Do you suggest tilde expansion right in fix_filename() (i.e. for all
OPT_FILE options), or some OPT_FILENAME_EXPANDED which may or may not be
used by some config? There's git_config_pathname() already which does
expansion, of course.

Michael

  reply	other threads:[~2012-09-24 14:51 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-24  7:19 GIT_DIR vs. --git-dir Michael J Gruber
2012-09-24  7:41 ` Nguyen Thai Ngoc Duy
2012-09-24  7:57   ` Michael J Gruber
2012-09-24  9:53     ` Nguyen Thai Ngoc Duy
2012-09-24 12:56       ` Michael J Gruber
2012-09-24 12:57         ` [RFC/PATCH] git: expand user path in --git-dir Michael J Gruber
2012-09-24 14:52           ` Jeff King
2012-09-24 14:57             ` Michael J Gruber
2012-09-24 17:30           ` Junio C Hamano
2012-09-25  5:33           ` Jan Engelhardt
2012-09-25  7:27             ` Michael J Gruber
2012-09-24 13:37         ` GIT_DIR vs. --git-dir Andreas Schwab
2012-09-24 14:36   ` Junio C Hamano
2012-09-24 14:51     ` Michael J Gruber [this message]
2012-09-24 14:49 ` Jeff King
2012-09-24 14:54   ` Michael J Gruber
2012-09-24 15:42   ` Andreas Schwab

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=5060736D.5020609@drmicha.warpmail.net \
    --to=git@drmicha$(echo .)warpmail.net \
    --cc=git@vger$(echo .)kernel.org \
    --cc=gitster@pobox$(echo .)com \
    --cc=pclouds@gmail$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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