public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox•com>
To: "Nguyễn Thái Ngọc Duy" <pclouds@gmail•com>
Cc: git@vger•kernel.org, snoksrud@gmail•com
Subject: Re: [PATCH] setup: set env $GIT_WORK_TREE when work tree is set, like $GIT_DIR
Date: Fri, 26 Jun 2015 12:02:42 -0700	[thread overview]
Message-ID: <xmqqk2uqthrh.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <xmqqpp4iv1au.fsf@gitster.dls.corp.google.com> (Junio C. Hamano's message of "Fri, 26 Jun 2015 10:15:21 -0700")

Junio C Hamano <gitster@pobox•com> writes:

> But I am not sure if it is true for our children (e.g. hooks,
> filters etc. that is spawned by us).  With this change, they inherit
> GIT_WORK_TREE and no GIT_DIR, in such a case.  If they set GIT_DIR
> themselves for their own use, perhaps arranging to work in somewhere
> else they know by chdir'ing there, they did not have to set
> GIT_WORK_TREE=. before runing git in there, but now they do, because
> we start exporting GIT_WORK_TREE to interfere what they have been
> doing.
>
> "It does not harm" is probably false for our children, I would
> think.  The children can do new things to avoid the harm, though.

Actually, I think I am overly and unnecessarily worried in the
above.

We do not do anything special wrt existing GIT_ environment
variables the user exported into us when spawning hooks or filters;
if existing scripts wanted to visit a different repository and
interact with it while they do their work, they would have already
been seeing these variables in their environment inherited from us,
and they should have been protecting themselves from these settings
anyway.  So I do not think this patch breaks anything (other than
such scripts that are already broken).

So, sorry for a false alarm.  Queued.

  reply	other threads:[~2015-06-26 19:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-25 14:15 Linked workdirs break typo-correction Bjørnar Snoksrud
2015-06-26 10:37 ` [PATCH] setup: set env $GIT_WORK_TREE when work tree is set, like $GIT_DIR Nguyễn Thái Ngọc Duy
2015-06-26 11:56   ` Jeff King
2015-06-27  5:57     ` Duy Nguyen
2015-06-26 17:15   ` Junio C Hamano
2015-06-26 19:02     ` Junio C Hamano [this message]
2015-06-26 17:30   ` 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=xmqqk2uqthrh.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=pclouds@gmail$(echo .)com \
    --cc=snoksrud@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