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

Re: [PATCH] -C/--chdir command line option

From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
Date
Oct 20, 2008, 13:59 UTC
Message-ID
<fcaeb9bf0810200659p91acb1cj58be43d3ef1c3e15@mail.gmail.com>
In-Reply-To
<20081019131745.GA8643@coredump.intra.peff.net>
On 10/19/08, Jeff King <peff@peff.net> wrote:
>  I'm not sure if the actual problem is related to the oft-discussed,
>  unresolved work-tree startup woes, or is something much simpler to fix.
>  I'll try to look closer later today.

I think all commands should be able to jump to worktree even if you are outside work-tree. git-pull and similar commands are easy because they don't take pathnames. The way pathnames are handled in git does not make it easy for outside current working directory, because if old cwd is outside worktree, the parameter "prefix" sent to those commands become "../../blah/", not a real prefix anymore. If a command expects an index pathname, then that prefix should be rejected. If they expect a filesystem pathname, it can be used with care.

-- 
Duy
Previous: Michael J Gruber
Message 10 of 10 in “-C/--chdir command line option”
  1. -C/--chdir command line optionMaciej Pasternacki, Oct 19, 2008
  2. Jeff KingOct 19, 2008
  3. Maciej PasternackiOct 19, 2008
  4. Jeff KingOct 19, 2008
  5. Maciej PasternackiOct 19, 2008
  6. Junio C HamanoOct 20, 2008
  7. Junio C HamanoOct 20, 2008
  8. Alex RiesenOct 20, 2008
  9. Michael J GruberOct 20, 2008
  10. Nguyen Thai Ngoc DuyOct 20, 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.