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

Re: "GIT_INDEX_FILE" environment variable

From
Linus Torvalds <torvalds@osdl.org>
Date
Apr 22, 2005, 05:05 UTC
Message-ID
<Pine.LNX.4.58.0504212200400.2344@ppc970.osdl.org>
In-Reply-To
<7vis2fbr0p.fsf@assigned-by-dhcp.cox.net>
On Thu, 21 Apr 2005, Junio C Hamano wrote:
Show 7 quoted lines
> 
> I am thinking about an alternative way of doing the above by
> some modifications to the git core.  I think the root of this
> problem is that there is no equivalent to GIT_INDEX_FILE and
> SHA1_FILE_DIRECTORY that tells the core git where the project
> top directory (i.e. the root of the working tree that
> corresponds to what $GIT_INDEX_FILE describes) is.

I'd _really_ prefer to just try to teach people to work from the "top" directory instead.

Show 9 quoted lines
>  - A new environment variable GIT_WORKING_TREE points at the
>    root of the working tree.
> 
>  - Each git core command [*1*] that looks at the working tree is
>    modified to take the user supplied pathname as a path
>    relative to the current working directory, and use
>    GIT_WORKING_TREE value to figure out which path the user is
>    talking about, relative to the tree structure GIT_INDEX_FILE
>    describes.

I really don't like it that much, but to some degree it obviously is exactly what "--prefix=" does to checkout-cache. It's basically saying that all normal file operations have to be prefixed with a magic string.

And git really doesn't do too many of those, so maybe it's ok. What would the patch look like? I don't really love the idea, but if the patch is clean enough...

		Linus
Previous: Junio C HamanoNext: Junio C Hamano
Message 5 of 14 in “"GIT_INDEX_FILE" environment variable”
  1. Linus TorvaldsApr 21, 2005
  2. Davide LibenziApr 21, 2005
  3. Linus TorvaldsApr 21, 2005
  4. Junio C HamanoApr 22, 2005
  5. Linus TorvaldsApr 22, 2005
  6. Junio C HamanoApr 22, 2005
  7. Petr BaudisApr 22, 2005
  8. Linus TorvaldsApr 22, 2005
  9. Junio C HamanoApr 22, 2005
  10. Linus TorvaldsApr 22, 2005
  11. Junio C HamanoApr 22, 2005
  12. Petr BaudisApr 22, 2005
  13. Linus TorvaldsApr 22, 2005
  14. Zach WelchApr 22, 2005

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.