From nobody Wed Dec 18 17:12:36 2024 X-Original-To: dev-commits-src-main@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 4YD0c73qKxz5hcC1; Wed, 18 Dec 2024 17:12:39 +0000 (UTC) (envelope-from glebius@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 4YD0c73MgMz4dCn; Wed, 18 Dec 2024 17:12:39 +0000 (UTC) (envelope-from glebius@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734541959; 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: in-reply-to:in-reply-to:references:references; bh=TTAqOYEeuaHDX3Y/oH4trNs/NjVNba6Bc6gj1U5Bypc=; b=KU2Qs4aLoHxyOewqwaaMWEcz+1hc2IjKB9nfFoe1iMmxtsQBUOaS0oJVJl5uvLrmIyg2CJ s8/lGu61uN6l/XyylP2fi37++mp4PKO97Zu5TZa7qPnJ38bfJMq9Elsz4XW25ZWWdD1KDd JtMnZKvBnhWwyrmTw8+oJfX+f2ZffS5yYLgqe7X9jF9IaT3D6SqF2jTdXnneqIpr2Uf+Y7 ccMYoGJyHT6M/l3GNbxlNoP6tgbrKkGOTQ5rxxPcy4p5VbgBiCOcGadVH6mRxan9uMdZkW 4dWpVPodg6T5c5BbZYBNZvqfEXnNTUuA0mep8neKTHRYh0IGK0jYIDX7vsHZdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734541959; 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: in-reply-to:in-reply-to:references:references; bh=TTAqOYEeuaHDX3Y/oH4trNs/NjVNba6Bc6gj1U5Bypc=; b=rA6uf2ZlphGs4Fk0+347BDez1wsxAW1ILEnIemYH4ygW+bcvJ3WyHxElQ6VwhJMh7+V/m6 vaDqObE6FJOLCiRiu27jPhuiMXRyw/yQAgdFYy0mpHnBrnBeKlfQx/naDHAzKmmhzJWOUB CqYKHeOmyT4y4J82NuXcJshID4TBt2HOti73IP2lE21/OKC+pLFM2NMkA1pNPc/XdHWQ8l vndj6yNnrIROlikoK1Yo7KJkIelkqsxT9tDbir9DgTD+PrfjE3kOupkDPqinZavrIdRIUY /+me7jb0kB75ZtI8Xjo2hPTcD7JP/PR3H8gINElOge4fXt4jKTOQVhitT0gQWg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734541959; a=rsa-sha256; cv=none; b=nApD8k9jhK31vUjh+D9S/v8wRbFX9Wj6R2zdZz09o5R1Tszvv+daU2WRMQGqASiHvKhROh MVAxwhHCDc/dz/N1YB26J0Zn0LTJzZYrdaHB045J7B64VvS7WK+WGjMKJMC8h5ZdQ4bCwu GEthohke7Sc/tF5m9wlVi3uZ9cCZPfiRyzH37FnG27ngIOrctw9XQSvFqyJ57oi4w9w0Im YNrOSvPx2X84Vuucg6wiQMCiut8gyPj8V4V/YuNN7HNH53HtdYbAkiC1w7rey8v/jxCR7k +SCdYggKdf9rB3dhpcD9UmoFBeVQgLZXe08/OcPo1mPu2uiO1qKMH+SbNLGGjw== Received: from cell.glebi.us (glebi.us [162.251.186.162]) (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 did not present a certificate) (Authenticated sender: glebius) by smtp.freebsd.org (Postfix) with ESMTPSA id 4YD0c65d15z1J1W; Wed, 18 Dec 2024 17:12:38 +0000 (UTC) (envelope-from glebius@freebsd.org) Date: Wed, 18 Dec 2024 09:12:36 -0800 From: Gleb Smirnoff To: Ed Maste Cc: John Baldwin , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: a1097094c4c5 - main - newvers: Set explicit git revision length Message-ID: References: <202412131306.4BDD6bxu011253@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Wed, Dec 18, 2024 at 10:22:24AM -0500, Ed Maste wrote: E> That said, it doesn't matter what Git's algorithm chooses as the short E> hash length; specifying --short bypasses that algorithm. `git E> rev-parse --verify --short=12 HEAD` will give us a 12-character short E> hash as long as that hash is unique. The reproducibility concern is E> thus: what is the probability that the 12-character short hash is E> unique at the time and in a repo from which an image is built, but is E> not unique for the attempt to reproduce it, or vice-versa. This E> probability is rather small. E> E> If you look at arbitrary commits 6 or 7 characters are usually E> sufficient for a unique hash today. For instance, some latest -pX from E> recent releng/ branches: E> E> 13.3: 72aa3d E> 13.4: 3f40d5 E> 14.0: f10e32 E> 14.1: 74b6c98 E> 14.2: c8918d6 E> E> The status quo of --short=12 should be fine for quite some time. AFAIU John's concern is that you can't guarantee a reproducible build from a "dirty" repository. A repository that has more branches than just the official ones. I just make a quick check on Netflix repo, that has both the current FreeBSD history and the before-the-official-git history together, as well as splitted ports subdirectories and of course our own stuff. For short hashes there are roughly 2x more ambiguities than for a "clean" repo. Apparently chance of collision on a long hash is also doubled. We can of course say that we don't provide reproducible builds from a "dirty" repo. But would be a real limitation. That would cancel a legitimate scenario: git subtree add FreeBSD && cd FreeBSD && make a reproducible build -- Gleb Smirnoff