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
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Feb 7, 2008, 12:33 UTC
Message-ID
<alpine.LSU.1.00.0802071231540.8543@racer.site>
In-Reply-To
<76718490802062313jdbd0e84xc9f36d703bb86c44@mail.gmail.com>
Hi,
On Thu, 7 Feb 2008, Jay Soffian wrote:
Show 12 quoted lines
> On Feb 7, 2008 12:13 AM, Jeff King <peff@peff.net> wrote:
> >
> > On Wed, Feb 06, 2008 at 12:59:32PM -0800, Junio C Hamano wrote:
> > >
> > > I was tempted to suggest GIT_WORK_TREE=/dev/null because that is
> > > what "diff" uses to mark "this does not even exist", but that
> > > feels dirty.
> >
> > It feels dirty to me, too. I would rather choose something that doesn't
> > even look like a path. I think GIT_WORK_TREE=" " is too ugly, too.
> 
> 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?

Of course, you could argue that one should override the other. But the consequence will be user errors that could be prevented, thus it is a design error.

Ciao, Dscho

Previous: Jay SoffianNext: Jay Soffian
Message 8 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.