From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-3.7 required=3.0 tests=AWL,BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_HI,RCVD_IN_SORBS_SPAM,RP_MATCHES_RCVD shortcircuit=no autolearn=no autolearn_force=no version=3.4.0 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by dcvr.yhbt.net (Postfix) with ESMTP id 489FA1FCC7 for ; Thu, 9 Feb 2017 21:37:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752639AbdBIVhP (ORCPT ); Thu, 9 Feb 2017 16:37:15 -0500 Received: from mout.gmx.net ([212.227.17.21]:53005 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752300AbdBIVhO (ORCPT ); Thu, 9 Feb 2017 16:37:14 -0500 Received: from virtualbox ([37.201.192.48]) by mail.gmx.com (mrgmx102 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MV30j-1cuqls2pRt-00YQTl; Thu, 09 Feb 2017 22:05:25 +0100 Date: Thu, 9 Feb 2017 22:05:24 +0100 (CET) From: Johannes Schindelin X-X-Sender: virtualbox@virtualbox To: Junio C Hamano cc: git@vger.kernel.org, =?UTF-8?Q?Nguy=E1=BB=85n_Th=C3=A1i_Ng=E1=BB=8Dc_Duy?= Subject: Re: [PATCH] rev-parse --git-path: fix output when running in a subdirectory In-Reply-To: Message-ID: References: <50fe3ea3302c40f4c96eaa5a568837e3334f9dc4.1486555851.git.johannes.schindelin@gmx.de> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Provags-ID: V03:K0:WbpOK1imyW26D799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Vs GYPjyQz Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Hi Junio, On Wed, 8 Feb 2017, Junio C Hamano wrote: > How long has "rev-parse --git-path" been around? Had scripts in the > wild chance to learn to live with the "output is relative to the top of > the working tree" reality? I think the answers are "since 2.5" and > "yes". Correct. And the third question is: How did the scripts work around this feature? The answer is obvious: by switching back to `$(git rev-parse --git-dir)/filename`. This is literally on what I spent the better part of Wednesday. There is just no way you can "fix" this otherwise. As an occasional shell scripter, you may be tempted to use `$(git rev-parse --show-cdup)$(git rev-parse --git-path filename)`, but of course that breaks in worktrees and if you do not use worktrees you would not even know that your workaround introduced another bug. The current handling of --git-path is just plain wrong. The fact that I am the first person to report this here merely shows how much it is used in the wild. Ciao, Johannes