From: Junio C Hamano Date: Mon, 12 Sep 2005 19:53:13 GMT Subject: Re: [PATCH] Redirect cd output to /dev/null, was: git-clone seems dead Message-ID: <7v3boaawra.fsf@assigned-by-dhcp.cox.net> In-Reply-To: <20050912163637.GA22018@athame.dynamicro.on.ca> Greg Louis writes: > Or (2+1==3) detect CDPATH in the same places as (1), complain with a > brief explanation ("don't export CDPATH; it's really only useful in > interactive shells") and unset it. I like your wording above, so probably that is what is going to happen. Thanks for the suggestion. > My patch was about the equivalent of (1), and (1) is what I'd feel > was the most that git owes its users. CDPATH has two problems. 1. It takes scripts to unexpected places (somebody had CDPATH=..:../..:$HOME and the "cd" in git-clone.sh:get_repo_base took him to $HOME/.git when he said "clone foo bar" to clone a repository in "foo" which had "foo/.git"). CDPATH mechanism does not implicitly give "." at the beginning of CDPATH, which is the most irritating part. 2. the extra echo when it does its thing. I was under the impression that the patch fixed 2. without doing anything about 1., but I may be mistaken. > Option (0) could be justified on the grounds that git users > are presumably developers and ought to be able to catch that > sort of blunder, but the facts that you didn't originally twig > to it, and that it took me a couple of hours to find it > independently, suggest that that's too cavalier an attitude > (neither of us being a tyro). Maybe. I did not trigger it and did not immediately spot what was wrong when I heard the symptom because I do not use CDPATH anywhere myself -- I am old fashioned ;-).