From: Junio C Hamano Date: Wed, 03 Dec 2008 07:20:27 GMT Subject: Re: [PATCH] git-sh-setup: Fix scripts whose PWD is a symlink into a git work-dir Message-ID: <7viqq1hghw.fsf@gitster.siamese.dyndns.org> In-Reply-To: <1228282020-2294-1-git-send-email-marcel@oak.homeunix.org> "Marcel M. Cary" writes: > If cd_to_toplevel had concatenated $(/bin/pwd) with $cdup to > avoid the separate "cd", it would require checking for $cdup > being an absolute path. I wasn't sure how to check that in > a way that is both portable and clearly faster than "cd", case "$v" in /*) : handle absolute path ;; *) : everything else ;; esac In all shells that support "case..esac", it is built-in. Having said that, I think it would probably be better to bite the bullet and start using "cd -P" soon after 1.6.1 goes final, and at the same time existing places that use "cd `pwd`" as a workaround if there are some.