From mboxrd@z Thu Jan 1 00:00:00 1970 From: Johannes Sixt Subject: Re: [PATCH 0/2] submodules: Use relative paths to gitdir and work tree Date: Mon, 27 Feb 2012 22:19:19 +0100 Message-ID: <4F4BF357.8020407@kdbg.org> References: <4F32F252.7050105@web.de> <4F4A6DFA.5080709@kdbg.org> <4F4A8EF2.3020901@web.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Cc: Junio C Hamano , Git Mailing List , Antony Male , Phil Hord , msysGit To: Jens Lehmann X-From: git-owner@vger.kernel.org Mon Feb 27 22:19:28 2012 Return-path: Envelope-to: gcvg-git-2@plane.gmane.org Received: from vger.kernel.org ([209.132.180.67]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1S27yi-0005Zj-8g for gcvg-git-2@plane.gmane.org; Mon, 27 Feb 2012 22:19:28 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754314Ab2B0VTX (ORCPT ); Mon, 27 Feb 2012 16:19:23 -0500 Received: from bsmtp4.bon.at ([195.3.86.186]:46771 "EHLO bsmtp.bon.at" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754019Ab2B0VTX (ORCPT ); Mon, 27 Feb 2012 16:19:23 -0500 Received: from dx.sixt.local (unknown [93.83.142.38]) by bsmtp.bon.at (Postfix) with ESMTP id 6B6782C4002; Mon, 27 Feb 2012 22:19:27 +0100 (CET) Received: from [IPv6:::1] (localhost [IPv6:::1]) by dx.sixt.local (Postfix) with ESMTP id 227A919F67C; Mon, 27 Feb 2012 22:19:19 +0100 (CET) User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; de; rv:1.9.2.27) Gecko/20120215 SUSE/3.1.19 Thunderbird/3.1.19 In-Reply-To: <4F4A8EF2.3020901@web.de> Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: Am 26.02.2012 20:58, schrieb Jens Lehmann: > Am 26.02.2012 18:38, schrieb Johannes Sixt: >> - a=$(cd "$gitdir" && pwd) >> - b=$(cd "$path" && pwd) >> + a=$(cd "$gitdir" && pwd -W) >> + b=$(cd "$path" && pwd -W) >> while [ "$b" ] && [ "${a%%/*}" = "${b%%/*}" ] >> do >> a=${a#*/} b=${b#*/}; > > I don't understand why you need this. Does "pwd" sometimes return a > path starting with "c:/" and sometimes "/c/" depending on what form > you use when you cd into that directory? It looks like this is the case. I was surprised as well. I hoped that pwd -P would fix it, but it makes no difference. I should have tested pwd -L as well, but I forgot. > - gitdir=$(git rev-parse --git-dir) > + gitdir=$(git rev-parse --git-dir | sed -e 's,^\([a-z]\):/,/\1/,') I don't like pipelines of this kind because they fork yet another process. But it looks like there are not that many alternatives... -- Hannes