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

[PATCH] unset CDPATH in git-clone

From
CBCarl Baldwin <cnb@fc.hp.com>
Date
Sep 1, 2005, 15:24 UTC
Message-ID
<20050901152441.GA8694@hpsvcnb.fc.hp.com>
Hello,

A colleague was having problems with git clone. It seemed to work as expected for me so I went into his environment to see what was causing it to fail. I found that he had set the CDPATH environment variable to something like '.:..:../..:$HOME'. Try this (using bash) and you'll see the problem:

export CDPATH=. git clone (anything local)

The function get_repo_base seems to break with this CDPATH.

Below is how I solved the problem for the short-term. Use it as you see fit. I did not look into other commands to see if there are other implications to using CDPATH.

Cheers, Carl

-- 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 Carl Baldwin                        Systems VLSI Laboratory
 Hewlett Packard Company
 MS 88                               work: 970 898-1523
 3404 E. Harmony Rd.                 work: Carl.N.Baldwin@hp.com
 Fort Collins, CO 80525              home: Carl@ecBaldwin.net
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

---

 git-clone-script |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

50e48b03a5a82bb1e4ca95ef4e04cafc39a96f79
diff --git a/git-clone-script b/git-clone-script
--- a/git-clone-script
+++ b/git-clone-script
@@ -5,6 +5,8 @@
 # 
 # Clone a repository into a different directory that does not yet exist.
 
+unset CDPATH
+
 usage() {
 	echo >&2 "* git clone [-l [-s]] [-q] [-u <upload-pack>] <repo> <dir>"
 	exit 1
Next: Junio C Hamano
Message 1 of 3 in “unset CDPATH in git-clone”
  1. unset CDPATH in git-cloneCarl Baldwin, Sep 1, 2005
  2. Junio C HamanoSep 5, 2005
  3. Carl BaldwinSep 6, 2005

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.