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

Re: how to access working tree from .git dir?

From
JEJosh England <jjengla@comcast.net>
Date
Sep 8, 2007, 01:02 UTC
Message-ID
<1189213361.15140.13.camel@beauty>
In-Reply-To
<7vr6la11q9.fsf@gitster.siamese.dyndns.org>
On Fri, 2007-09-07 at 16:42 -0700, Junio C Hamano wrote:
Show 19 quoted lines
> Josh England <jjengla@comcast.net> writes:
> 
> > On Fri, 2007-09-07 at 15:12 -0700, Junio C Hamano wrote:
> >> Josh England <jjengla@comcast.net> writes:
> >> 
> >> > OK. Fair enough.  Maybe it would be good to note in git-sh-setup.sh that
> >> > many of the supplied functions will not work when called from within
> >> > $GIT_DIR.
> >> 
> >> Sorry, "supplied functions"?  Care to clarify with a patch?
> >
> > I guess really just the cd_to_topdir() function.  It will silently fail
> > when run from within $GIT_DIR.
> 
> Ah, I see what you meant.
> 
> I think you probably are supposed to check with is_bare_repository
> or something before calling that, as asking to cd to toplevel
> implies you know there is such a thing as toplevel ;-)

That's fine. I guess using `$GIT_DIR/../` as you mentioned before will just have to work.

-JE
Previous: Junio C Hamano
Message 9 of 9 in “how to access working tree from .git dir?”
  1. Josh EnglandSep 6, 2007
  2. Junio C HamanoSep 7, 2007
  3. Josh EnglandSep 7, 2007
  4. Junio C HamanoSep 7, 2007
  5. Josh EnglandSep 7, 2007
  6. Junio C HamanoSep 7, 2007
  7. Josh EnglandSep 7, 2007
  8. Junio C HamanoSep 7, 2007
  9. Josh EnglandSep 8, 2007

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.