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

Re: [PATCH] allow setting GIT_WORK_TREE to "no work tree"

From
Jay Soffian <jaysoffian+git@gmail.com>
Date
Feb 7, 2008, 18:06 UTC
Message-ID
<76718490802071006j9eaa4bctedc18f4a62e2b91c@mail.gmail.com>
In-Reply-To
<alpine.LSU.1.00.0802071231540.8543@racer.site>
On Feb 7, 2008 7:33 AM, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
Show 8 quoted lines
>
> On Thu, 7 Feb 2008, Jay Soffian wrote:
>
> > Is using something like "__GIT_WORK_TREE_NOT_SET__" that terrible?
>
> Yes.  First: it looks more like a C constant than a proper environment
> variable.  Second: what to do _sanely_, when both GIT_WORK_TREE and
> GIT_WORK_TREE_NOT_SET are true?

Sorry I was unclear. The discussion was about using a special value to denote "this is not set." So I meant something like:

GIT_WORK_TREE="__GIT_WORK_TREE_NOT_SET"

There may not be precedent in git, but it is not unusual to use a double-underbar prefix to denote private names and/or values. While in theory a user could have a directory named as such, it would seem highly unlikely. This looks a little cleaner to me than using ":", " ", or "/dev/null".

j.
Previous: Johannes SchindelinNext: Junio C Hamano
Message 9 of 13 in “allow setting GIT_WORK_TREE to "no work tree"”
  1. allow setting GIT_WORK_TREE to "no work tree"Jeff King, Feb 6, 2008
  2. Johannes SixtFeb 6, 2008
  3. Jeff KingFeb 6, 2008
  4. Junio C HamanoFeb 6, 2008
  5. Junio C HamanoFeb 6, 2008
  6. Jeff KingFeb 7, 2008
  7. Jay SoffianFeb 7, 2008
  8. Johannes SchindelinFeb 7, 2008
  9. Jay SoffianFeb 7, 2008
  10. Junio C HamanoFeb 7, 2008
  11. Johannes SchindelinFeb 7, 2008
  12. Johannes SixtFeb 8, 2008
  13. Johannes SchindelinFeb 8, 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.