git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pasha Bolokhov <pasha.bolokhov@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Jonathan Nieder <jrnieder@gmail.com>,
	Duy Nguyen <pclouds@gmail.com>,
	Git Mailing List <git@vger.kernel.org>
Subject: Re: more concerns about '--git-dir'
Date: Fri, 23 May 2014 16:02:15 -0700	[thread overview]
Message-ID: <CAKpPgvcwVuvOqAE-SvECsCfPHMJr0qBaqz9DCOXQSAZj1903jQ@mail.gmail.com> (raw)
In-Reply-To: <xmqq1tvkjo4c.fsf@gitster.dls.corp.google.com>

>> You won't notice anything different in the output of course, but the
>> environment will be odd:
>>     GIT_DIR=../tmp/./././.git
>>     GIT_WORK_TREE=$HOME/tmp
>> Notice how the work-tree has been normalized and git-dir hasn't. It's
>> kinda hard to imagine when this can lead to an error, but never know.
>
> I think this one is in the "if it hurts, don't do it then"
> territory.
I just find it inconsistent: one variable is always straightened
("normalized"), while the other one is or is not, depending on
circumstances

>> 2) "git --git-dir=meta status" complains:
>>
>> $ git --git-dir=meta init
>> $ git --git-dir=meta status
>>
>> yells that work-tree isn't setup and denies to run.
>
> Is that because meta/config does not say where the worktree is?
>
> Again, this smells like "if it hurts, don't do it then", even more
> so than the previous one.  Does it help if you add --git-work-tree
> to the command line, too?
I agree this one is on the edge, so wasn't sure. I don't specify
worktree at all, anywhere. And expect Git to guess it to be the
current directory. It does so only if GIT_DIR, whatever it is, ends
with "/.git". What's the logic? When the reader skims through the "man
git-config" page, they'll think that work-tree defaults to "." if no
value was provided. But it's only true if "core.bare" is set to false

      reply	other threads:[~2014-05-23 23:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-23 18:41 more concerns about '--git-dir' Pasha Bolokhov
2014-05-23 19:23 ` Junio C Hamano
2014-05-23 23:02   ` Pasha Bolokhov [this message]

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=CAKpPgvcwVuvOqAE-SvECsCfPHMJr0qBaqz9DCOXQSAZj1903jQ@mail.gmail.com \
    --to=pasha.bolokhov@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jrnieder@gmail.com \
    --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).