public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox•com>
To: Jeff King <peff@peff•net>
Cc: Felipe Contreras <felipe.contreras@gmail•com>,
	git@vger•kernel.org, Ilya Bobyr <ilya.bobyr@gmail•com>
Subject: Re: [RFC/PATCH v2 1/3] sh-setup: export GIT_DIR
Date: Wed, 23 Apr 2014 13:18:22 -0700	[thread overview]
Message-ID: <xmqqwqefyf3l.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <20140423200150.GA31356@sigill.intra.peff.net> (Jeff King's message of "Wed, 23 Apr 2014 16:01:50 -0400")

Jeff King <peff@peff•net> writes:

> On Wed, Apr 23, 2014 at 02:42:38PM -0500, Felipe Contreras wrote:
>
>> It is what the clients of this library expect.
>
> Is it? Passing GIT_DIR to sub-invocations of git will change how they
> determine the repo and working tree. Your patch seems to cause failures
> all over the test suite.
>
> Without looking too hard, I'd guess the problems are one of:
>
>   1. Setting GIT_DIR fixes the repo directory for all sub-invocations. A
>      script that does "cd some-other-repo.git && git ...". You'd need to
>      teach calling scripts to unset GIT_DIR when trying to move to
>      another repo.
>
>   2. If GIT_DIR is set but GIT_WORK_TREE is not, then GIT_WORK_TREE will
>      default to ".". It might be sufficient to set GIT_WORK_TREE when
>      you are setting GIT_DIR here. But as I said, I didn't look too
>      hard, so there might be other complications.
>
> -Peff

I do not recall the details but I do remember that it is very
deliberate not to export GIT_DIR but only set in git-sh-setup.

  reply	other threads:[~2014-04-23 20:18 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-23 19:42 [RFC/PATCH v2 0/3] New 'update-branch' hook Felipe Contreras
2014-04-23 19:42 ` [RFC/PATCH v2 1/3] sh-setup: export GIT_DIR Felipe Contreras
2014-04-23 20:01   ` Jeff King
2014-04-23 20:18     ` Junio C Hamano [this message]
2014-04-23 19:42 ` [RFC/PATCH v2 2/3] run-command: make sure hooks have always GIT_DIR Felipe Contreras
2014-04-23 20:37   ` Junio C Hamano
2014-04-23 21:15     ` Felipe Contreras
2014-04-23 19:42 ` [RFC/PATCH v2 3/3] Add 'update-branch' hook Felipe Contreras
2014-04-23 20:28   ` Junio C Hamano
2014-04-23 21:08     ` Felipe Contreras
2014-04-23 21:22       ` Junio C Hamano
2014-04-23 21:35         ` Felipe Contreras

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=xmqqwqefyf3l.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox$(echo .)com \
    --cc=felipe.contreras@gmail$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=ilya.bobyr@gmail$(echo .)com \
    --cc=peff@peff$(echo .)net \
    /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