From nobody Mon Dec 16 23:16:37 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YBwn75VJSz5ggTt; Mon, 16 Dec 2024 23:16:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YBwn71R04z4FT6; Mon, 16 Dec 2024 23:16:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734391003; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xB1JK3Sh2GT8nHLfmY9K/PcDsS4leT09xcA2rSWvN/c=; b=lZG2Xzo3RqKEYeV29Gz1vvMkL61KSOVari/XVv/GOT8VFpgnpF5hrLC+ludZsnMGa6Iqqr iiE6sLVLWftakLWZnUc0KnbnA7JS6d/jeW/mAbF7/DgLUi68VHJX0ho9okZqbvL7ISekkY CACL/rJtOv1JpJp//f+buTnd6RNJwCG/3Na3er50unQVhhQ0wT/3UYj9TcV5fqGnuuapsA mM0JcX3U5h/KWDU1ysGy+FMbBg8NO8vqfWZcvEHL/aTg07d83jd1A+ibvLe0nbM6EMvZaf kall5+W8v1Jcjgbsb00XtCwr4XgdC+FYL0mQXd8/2xRY0bPHFnRvpANeaJGlEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734391003; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xB1JK3Sh2GT8nHLfmY9K/PcDsS4leT09xcA2rSWvN/c=; b=StSgHieSpxg1X9NAOiljKtRtDuaXmiWZczIaDY4T/oLQFzidHC83pg5Sae8saZ4HeWHa6C DLk9H0cwDKCeoEtwl7v8DW/8CaSX3M30U2Gh+mfxsdl/ODPwfkVSt+YZNsl3odowgA9xjF ZibaQivcdArvIZ3QSuSDhjWPD/gX1HTnSySnxLrxAI23qQBNv77F+cinOF8Khc9jKMADV+ U6JjhohDD8FaKXd1HlxoNR6xaOSX2Rs34ohGnfoxmtCLdRy2yYCsTEEDDxNkKmCNL5diAc /eMJVYulxM4YcRwFfoGDJaD44u4Ntxp2iw980da+D0tWHMhI/OSdKlbZkX0fRw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734391003; a=rsa-sha256; cv=none; b=oACgX2VeN2Ff4n2yQsCoaL2QpV496U9GTkgpbcYJYd+M8GCIWSJ6VUqsjrmRHf97hA483P RCb3zFnporItrmIU1LPutJa6x6JwawDWl3SaQqwvo2TNbtUROFRdJHqm3yZxi4fmbvIkcc 0yk8hxM14OdHPOYNiFABYngy6RfDvgyPP+TaVAk4ty2hozk37ZF9Rya3clYCH8qXkLbGlP L7nf+/nr6miBGHmJyir6O8zq2ARvSC80GLV0bp0UodyLziHJ3nRijWVoZrz4Ltxn8xT2gj vGNQW/WN5AKS5XlMrV64wv+lKG/gU69mIJRCf5dnqRV+gsuCN2fBIX9ZtrNUdw== Received: from [10.0.58.125] (unknown [144.121.72.234]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4YBwn70StPz1LHx; Mon, 16 Dec 2024 23:16:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: Date: Mon, 16 Dec 2024 18:16:37 -0500 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: a1097094c4c5 - main - newvers: Set explicit git revision length Content-Language: en-US To: Ed Maste Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202412131306.4BDD6bxu011253@gitrepo.freebsd.org> From: John Baldwin In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 12/13/24 19:14, Ed Maste wrote: > On Fri, 13 Dec 2024 at 09:53, John Baldwin wrote: >> >> On 12/13/24 08:06, Ed Maste wrote: >>> The branch main has been updated by emaste: >>> >>> URL: https://cgit.FreeBSD.org/src/commit/?id=a1097094c4c5d810287aca092f4ab5f9f86a426a >>> >>> commit a1097094c4c5d810287aca092f4ab5f9f86a426a >>> Author: Pat Maddox >>> AuthorDate: 2024-12-13 05:28:18 +0000 >>> Commit: Ed Maste >>> CommitDate: 2024-12-13 13:06:10 +0000 >>> >>> newvers: Set explicit git revision length >>> >>> The --short flag is configurable. Setting an explicit length supports >>> reproducible builds. >>> >>> Signed-off-by: Pat Maddox >>> Reviewed by: emaste, imp >>> Differential revision: https://github.com/freebsd/freebsd-src/pull/1547 >> >> Hmm, this seems to defeat the purpose of the --short flag. I think if you want >> this to be reproducible you just need to use the full hash. If we get enough commits >> that git thinks we need a longer short hash, then truncating the hash to a shorter >> length here is a bug. > > --short with no explicit length is most likely to result in > nonreproducibility due to a user setting a different default short > length in their git config. Note that --short won't truncate and > result in a conflict, it will just exceed the specified length if > necessary. For example, > > $ git rev-parse --short=4 freebsd/main > 926905 > > It's possible for this to result in occasional trouble when attempting > to reproduce an older build (if --short=12 is sufficient today, but a > future commit introduces a conflict), but I don't think it's a large > concern. We could increase it to 13 or 14 now Well, the default --short length is not based on when Git detects a conflict, it's a function of the total number of objects in a repository. This means it may be different if you just fetch some other remote with many revisions in the same clone for example. The thing I don't know is what formula git uses and how close we are/aren't to rolling over to 13 just with src.git alone. It seems to me that the most fool-proof thing though if we really want reproduciblility is to drop --short entirely. Short of that, if you can tell git to run in a mode where it ignores user configuration (though I don't see a way to do that). -- John Baldwin