git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Export GIT_DIR after setting it

From
MKmartin f. krafft <madduck@madduck.net>
Date
May 15, 2008, 10:15 UTC
Message-ID
<20080515101523.GA31719@lapse.madduck.net>
In-Reply-To
<7vod78i9r7.fsf@gitster.siamese.dyndns.org>
Thank you, Junio, for taking the time to reply to this!
also sprach Junio C Hamano <gitster@pobox.com> [2008.05.15.0325 +0100]:
> trying to solve like this patch does, but this change needs very
> careful vetting to make sure that you did not break other scripts
> with this change.

Absolutely agreed. It occured to me as I lied down to sleep that this fix could quite possibly have repercussions. And it's been in my head all the walk to my work this morning. I ended up thinking about it in this way:

If GIT_DIR is exported by git-sh-setup and we can assure that git-sh-setup gets it right, then it's effectively the same as if the user had set it explicitly, before calling the shell script: all external commands called by the shell script will have GIT_DIR set appropriately in all cases then.

The only problem I see now is when an external command (or the shell script) can't properly deal with GIT_DIR being set, but then that's a whole different bug.

I understand you're worried about this, but I can't really see specifics, now having thought about this for a bit.

> This arrangement predates separate work-tree by many months.  It
> could be that what needs fixing is the separate work-tree code.

Oh yeah, and I've been meaning to look into that for a long time. Sigh.

-- 
martin | http://madduck.net/ | http://two.sentenc.es/
 
"she was rather too intelligent and competent-looking to be
 considered entirely beautiful, but all the more attractive because
 of it."
                           -- george spencer-brown, "a lion's teeth"
 
spamtraps: madduck.bogus@madduck.net
Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 9 in “Export GIT_DIR after setting it”
  1. Export GIT_DIR after setting itmartin f. krafft, May 14, 2008
  2. Junio C HamanoMay 15, 2008
  3. martin f. krafftMay 15, 2008
  4. Junio C HamanoMay 15, 2008
  5. Björn SteinbrinkMay 15, 2008
  6. martin f. krafftMay 15, 2008
  7. Björn SteinbrinkMay 15, 2008
  8. martin f. krafftMay 16, 2008
  9. martin f. krafftMay 20, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.