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

Re: git-new-workdir not working right?

From
Julian Phillips <julian@quantumfyre.co.uk>
Date
Apr 15, 2009, 12:22 UTC
Message-ID
<alpine.LNX.2.00.0904151310140.11773@reaper.quantumfyre.co.uk>
In-Reply-To
<81bfc67a0904150331t6787fcfbjd391013a8235ece0@mail.gmail.com>
On Wed, 15 Apr 2009, Caleb Cushing wrote:
Show 39 quoted lines
> On Tue, Apr 14, 2009 at 10:47 AM, Julian Phillips
> <julian@quantumfyre.co.uk> wrote:
>> Works fine for me.  Are you sure you didn't have a typo in your original
>> git-new-workdir invocation?  If so, could you supply:
>>
>>  1) the complete output of running git-new-workdir
>>  2) the output of "git rev-parse --git-dir" run in path/to/repo/.git
>>
>> Also, you shouldn't need to supply the .git, so "git new-workdir
>> path/to/repo newworkdirname" should also work, have you tried that?
>>
>
> git-new-workdir portage/ test
> /home/port/portdev/.bin/git-new-workdir: line 58: cd:
> /home/port/portdev/tree/portage
> .git: No such file or directory
> /home/port/portdev/tree/test
> cp: cannot stat `/home/port/portdev/tree/HEAD': No such file or directory
> fatal: Not a git repository (or any of the parent directories): .git
>
> git-new-workdir portage/.git/ test
> /home/port/portdev/.bin/git-new-workdir: line 58: cd:
> /home/port/portdev/tree/portage/.git
> .: No such file or directory
> /home/port/portdev/tree/test
> cp: cannot stat `/home/port/portdev/tree/HEAD': No such file or directory
> fatal: Not a git repository (or any of the parent directories): .git
>
> git rev-parse --git-dir portage/
> fatal: Not a git repository (or any of the parent directories): .git
>
> cd portage/
> /home/port/portdev/tree/portage
> slave-iv portage $ git rev-parse --git-dir .
> .git
> .
>
> git-new-workdir . ../test/ << seems to work too.
>
*sighs* oh yes, that old chestnut ...

You're exporting CDPATH, this variable shouldn't be exported. This is likely to cause random shell scripts to break.

Alternatively, Putting "unset CDPATH" at the beginning of git-new-workdir should fix it.

This has come up a number of times in the past on the git list. See, for example:

http://thread.gmane.org/gmane.comp.version-control.git/52177/focus=52268
-- 
Julian

  ---
English literature's performing flea.
 		-- Sean O'Casey on P.G. Wodehouse
Previous: Caleb Cushing
Message 4 of 4 in “git-new-workdir not working right?”
  1. Caleb CushingApr 14, 2009
  2. Julian PhillipsApr 14, 2009
  3. Caleb CushingApr 15, 2009
  4. Julian PhillipsApr 15, 2009

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.