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

Re: builtin command's prefix question

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Dec 6, 2007, 15:48 UTC
Message-ID
<Pine.LNX.4.64.0712061547070.27959@racer.site>
In-Reply-To
<fcaeb9bf0712060726r383c3a36j798a439b9dbb0cae@mail.gmail.com>
Hi,
On Thu, 6 Dec 2007, Nguyen Thai Ngoc Duy wrote:
Show 16 quoted lines
> On Dec 6, 2007 6:22 AM, Junio C Hamano <gitster@pobox.com> wrote:
> > However, if we define setup() to behave this way when GIT_DIR is not 
> > defined and GIT_WORK_TREE is:
> >
> >  (1) internally pretend as if GIT_DIR was specified to be the
> >      directory where the command was started from (iow, do getcwd()
> >      once upon startup);
> >
> >  (2) chdir to GIT_WORK_TREE (which means "callers of setup() always
> >      run from the top of the work tree");
> >
> >  (3) set prefix to NULL;
> 
> (1) is fine by me, even if it goes up to find a gitdir. But (3), no, 
> prefix should be set as relative path from worktree top directory to 
> user current directory, not NULL.

If you expect "git <command> <filespec>" to work correctly from GIT_DIR, you will _have_ to set the prefix to NULL.

Ciao, Dscho

Previous: Nguyen Thai Ngoc DuyNext: Junio C Hamano
Message 6 of 7 in “builtin command's prefix question”
  1. Nguyen Thai Ngoc DuyDec 5, 2007
  2. Junio C HamanoDec 5, 2007
  3. Junio C HamanoDec 5, 2007
  4. Junio C HamanoDec 5, 2007
  5. Nguyen Thai Ngoc DuyDec 6, 2007
  6. Johannes SchindelinDec 6, 2007
  7. Junio C HamanoDec 6, 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.