Re: [PATCH] git-sh-setup: Fix scripts whose PWD is a symlink into a git work-dir
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Dec 3, 2008, 07:20 UTC
- Message-ID
- <7viqq1hghw.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <1228282020-2294-1-git-send-email-marcel@oak.homeunix.org>
"Marcel M. Cary" <marcel@oak.homeunix.org> 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 ;;
esacIn 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.