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=-2.6 required=3.0 tests=AWL,BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_HI,T_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 3A8191F404 for ; Thu, 14 Dec 2017 23:28:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754443AbdLNX2D (ORCPT ); Thu, 14 Dec 2017 18:28:03 -0500 Received: from mout.gmx.net ([212.227.17.21]:52713 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754358AbdLNX2B (ORCPT ); Thu, 14 Dec 2017 18:28:01 -0500 Received: from [192.168.0.129] ([37.201.193.73]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MK0bZ-1eQSOh0iUH-001NMw; Fri, 15 Dec 2017 00:27:58 +0100 Date: Fri, 15 Dec 2017 00:27:57 +0100 (STD) From: Johannes Schindelin X-X-Sender: virtualbox@MININT-6BKU6QN.europe.corp.microsoft.com To: Junio C Hamano cc: Jonathan Nieder , git@vger.kernel.org Subject: Re: [PATCH 2/2] version --build-options: report commit, too, if possible In-Reply-To: Message-ID: References: <908989103a06291e38c8551c447bc73eb781fb26.1512752468.git.johannes.schindelin@gmx.de> <20171208172733.GC14261@aiede.mtv.corp.google.com> User-Agent: Alpine 2.21.1 (DEB 209 2017-03-23) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Provags-ID: V03:K0:8lMuZsFxgA4bNpPZcsLigTE9bA0R0nS4p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ukoob/kNDdjp8D7h1zYnIkrffJJu362Q= Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Hi Junio, On Fri, 8 Dec 2017, Junio C Hamano wrote: > Jonathan Nieder writes: > > >> We need to be careful, though, to report when the current commit cannot be > >> determined, e.g. when building from a tarball without any associated Git > >> repository. > > > > This means that on Debian, it would always print > > > > built from commit: (unknown) > > > > Maybe I shouldn't care, but I wonder if there's a way to improve on > > that. E.g. should there be a makefile knob to allow Debian to specify > > what to put there? > > Another "interesting" possibility is to build from a tarball > extracted into a directory hierarchy that is controlled by an > unrelated Git repository. E.g. "my $HOME is under $HOME/.git > repository, and then I have a tarball extract in $HOME/src/git". > We shouldn't embed the HEAD commit of that $HOME directory project > in the resulting executable in such a case. > > We should be able to do this by being a bit more careful than the > presented patch. Make sure that the toplevel is at the same > directory as we assumed to be (i.e. where we found that Makefile) > and trust rev-parse output only when that is the case, or something > like that. Cute. I added specific handling for that. Ciao, Dscho