{"thread":{"id":"1710","subject":"[PATCH] unset CDPATH in git-clone","startedAt":"2005-09-01T15:24:41Z","lastAt":"2005-09-06T14:52:01Z","messageCount":3,"participants":["Carl Baldwin","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"7992","messageId":"20050901152441.GA8694@hpsvcnb.fc.hp.com","threadId":"1710","inReplyTo":null,"subject":"[PATCH] unset CDPATH in git-clone","fromName":"Carl Baldwin","fromEmail":"cnb@fc.hp.com","sentAt":"2005-09-01T15:24:41Z","receivedAt":"2005-09-01T15:24:41Z","isPatch":true,"sender":{"key":"cnb@fc.hp.com","avatar":null},"body":"Hello,\n\nA colleague was having problems with git clone.  It seemed to work as\nexpected for me so I went into his environment to see what was causing\nit to fail.  I found that he had set the CDPATH environment variable to\nsomething like '.:..:../..:$HOME'.  Try this (using bash) and you'll see\nthe problem:\n\nexport CDPATH=.\ngit clone (anything local)\n\nThe function get_repo_base seems to break with this CDPATH.\n\nBelow is how I solved the problem for the short-term.  Use it as you see\nfit.  I did not look into other commands to see if there are other\nimplications to using CDPATH.\n\nCheers,\nCarl\n\n-- \n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n Carl Baldwin                        Systems VLSI Laboratory\n Hewlett Packard Company\n MS 88                               work: 970 898-1523\n 3404 E. Harmony Rd.                 work: Carl.N.Baldwin@hp.com\n Fort Collins, CO 80525              home: Carl@ecBaldwin.net\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n\n---\n\n git-clone-script |    2 ++\n 1 files changed, 2 insertions(+), 0 deletions(-)\n\n50e48b03a5a82bb1e4ca95ef4e04cafc39a96f79\ndiff --git a/git-clone-script b/git-clone-script\n--- a/git-clone-script\n+++ b/git-clone-script\n@@ -5,6 +5,8 @@\n # \n # Clone a repository into a different directory that does not yet exist.\n \n+unset CDPATH\n+\n usage() {\n \techo >&2 \"* git clone [-l [-s]] [-q] [-u <upload-pack>] <repo> <dir>\"\n \texit 1\n"},{"id":"8108","messageId":"7v3boj486h.fsf@assigned-by-dhcp.cox.net","threadId":"1710","inReplyTo":"20050901152441.GA8694@hpsvcnb.fc.hp.com","subject":"Re: [PATCH] unset CDPATH in git-clone","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-09-05T19:37:58Z","receivedAt":"2005-09-05T19:37:58Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Carl Baldwin <cnb@fc.hp.com> writes:\n\n> The function get_repo_base seems to break with this CDPATH.\n\nSorry, your message somehow slipped my filtering.  Thanks for\nthe analysis.  Of course, CDPATH would break it.\n\nIs there any good reason why somebody would want to have CDPATH\nin his environment, inherited to be used by any shell scripts,\nas opposed to have it as a plain shell variable that is set only\nin interactive shells?  I do not think of any.\n"},{"id":"8127","messageId":"20050906145201.GA4551@hpsvcnb.fc.hp.com","threadId":"1710","inReplyTo":"7v3boj486h.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] unset CDPATH in git-clone","fromName":"Carl Baldwin","fromEmail":"cnb@fc.hp.com","sentAt":"2005-09-06T14:52:01Z","receivedAt":"2005-09-06T14:52:01Z","isPatch":true,"sender":{"key":"cnb@fc.hp.com","avatar":null},"body":"On Mon, Sep 05, 2005 at 12:37:58PM -0700, Junio C Hamano wrote:\n> Carl Baldwin <cnb@fc.hp.com> writes:\n> \n> > The function get_repo_base seems to break with this CDPATH.\n> \n> Sorry, your message somehow slipped my filtering.  Thanks for\n> the analysis.  Of course, CDPATH would break it.\n> \n> Is there any good reason why somebody would want to have CDPATH\n> in his environment, inherited to be used by any shell scripts,\n> as opposed to have it as a plain shell variable that is set only\n> in interactive shells?  I do not think of any.\n\nGood point.  There is no good reason at all.  It happens when one does\nnot know the difference between a plain shell variable and an\nenvironment variable.\n\nCarl\n\n-- \n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n Carl Baldwin                        Systems VLSI Laboratory\n Hewlett Packard Company\n MS 88                               work: 970 898-1523\n 3404 E. Harmony Rd.                 work: Carl.N.Baldwin@hp.com\n Fort Collins, CO 80525              home: Carl@ecBaldwin.net\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n"}]}