LWN: Comments on "Whatever happened to SHA-256 support in Git?" https://lwn.net/Articles/898522/ This is a special feed containing comments posted to the individual LWN article titled "Whatever happened to SHA-256 support in Git?". en-us Tue, 04 Nov 2025 07:40:29 +0000 Tue, 04 Nov 2025 07:40:29 +0000 https://www.rssboard.org/rss-specification lwn@lwn.net At this point... https://lwn.net/Articles/962015/ https://lwn.net/Articles/962015/ JeffBai <div class="FormattedComment"> (Very late reply, but!) https://git-scm.com/docs/hash-function-transition/ mentions that blake2sp-256 was a contender. I have no interest in looking through the big mail thread to find out what happened to it. Could be something about OpenMP.<br> </div> Wed, 14 Feb 2024 07:57:48 +0000 Whatever happened to SHA-256 support in Git? https://lwn.net/Articles/946500/ https://lwn.net/Articles/946500/ geert <div class="FormattedComment"> Yes it is. Both hashes are (eventually[*]) made from the same input.<br> <p> [*] For blobs (files), this is obvious, as the hash is calculated from the file contents plus some file metadata.<br> For all other objects (trees, commits), the hash is calculated from tree or commit info plus hashes calculated before.<br> </div> Wed, 04 Oct 2023 13:44:46 +0000 Whatever happened to SHA-256 support in Git? https://lwn.net/Articles/946413/ https://lwn.net/Articles/946413/ xnox <div class="FormattedComment"> Is conversion from sha1 to sha256 git format reproducible?<br> </div> Wed, 04 Oct 2023 02:37:12 +0000 Whatever happened to SHA-256 support in Git? https://lwn.net/Articles/918798/ https://lwn.net/Articles/918798/ luto <div class="FormattedComment"> I don’t understand why interoperability can’t exist. Imagine a hybrid repository: objects can be hashed with any algorithm (SHA-1 or SHA-256). Objects hashed with SHA-256 can refer to any object, but objects hashed with SHA-1 can only refer to other objects hashed with SHA-1. You can also add a rule, per-repo, that commits claiming to be after a certain date or (transitively) referring to commits past a certain date can’t refer to trees that (transitively) refer to SHA-1 objects.<br> <p> This means that conversion to SHA-256 is more or less an all-in affair. You start adding any SHA-256 objects, and you very quickly can’t add any new SHA-1 objects. But you could convert.<br> </div> Sat, 31 Dec 2022 07:29:40 +0000 Compliance nonsense https://lwn.net/Articles/901432/ https://lwn.net/Articles/901432/ epa <div class="FormattedComment"> That&#x27;s an interesting point. If the hash function is known to be weak (or you want to hedge against it becoming broken in future) then you could add an extra defence with a &#x27;normalized hash&#x27;. If the file looks like C source code then strip out the comments, normalize the whitespace, and perhaps rename all the variables that aren&#x27;t visible from outside the compilation unit. Then both the original content and the normalized one are hashed separately and both of these go into the final commit id.<br> </div> Fri, 15 Jul 2022 15:31:40 +0000 IPv6 https://lwn.net/Articles/900521/ https://lwn.net/Articles/900521/ oldtomas <p>Inspired by yours, I tried an equally precise and rigorous experiment. Context: bog standard (Debian Gnu-)Linux box. I moved a couple of weeks ago. In my old flat, I gave up on IPv6 (your bog standard DSL, one of ghe Big Providers around here). In my new flat (same setup, the other of the Big Providers, yes, we have more than one)... surprise:</p> <pre> tomas@trotzki:~$ ping lwn.net PING lwn.net(prod3.lwn.net (2600:3c03::f03c:91ff:fe82:68b2)) 56 data bytes 64 bytes from prod3.lwn.net (2600:3c03::f03c:91ff:fe82:68b2): icmp_seq=2 ttl=56 time=102 ms 64 bytes from prod3.lwn.net (2600:3c03::f03c:91ff:fe82:68b2): icmp_seq=3 ttl=56 time=102 ms ... </pre> <p>So it seems it's slowly coming, not just for smartphones</p> Sat, 09 Jul 2022 05:53:02 +0000 Whatever happened to SHA-256 support in Git? https://lwn.net/Articles/900236/ https://lwn.net/Articles/900236/ koh <div class="FormattedComment"> If I understand correctly: Merkle DAG + automated choice of the &quot;mainline&quot; branch to add nodes to + automated distribution of all nodes/commits in a network.<br> <p> Not sure about the &quot;all&quot; in the last part, but that helped, many thanks!<br> </div> Thu, 07 Jul 2022 11:06:13 +0000 Whatever happened to SHA-256 support in Git? https://lwn.net/Articles/900196/ https://lwn.net/Articles/900196/ farnz <p>To be fair, that's an issue because you're choosing between two different blockchains, each of which does the trust thing automatically. <p>And that sort of problem is what I meant by saying that it's mathematically neat, but not necessarily practical - being able to form a consensus without trust is cool, but there are other dimensions involved beyond simply forming a consensus, such as which blockchain to trust. Wed, 06 Jul 2022 15:46:01 +0000 Whatever happened to SHA-256 support in Git? https://lwn.net/Articles/900192/ https://lwn.net/Articles/900192/ excors <div class="FormattedComment"> <font class="QuotedText">&gt; in a blockchain, consensus is formed automatically and does not depend on humans choosing trusted people</font><br> <p> ...except when, say, the core developers can&#x27;t agree on a technical change for the project and so they fork the blockchain and now you&#x27;ve got two versions that both claim to be authoritative, and they have to fight it out on social media to convince users/miners/exchanges/etc to support their side. Maybe the mathematical model is trustless but that&#x27;s because it&#x27;s modeling an unrealistically abstract version of the problem - the practical implementation is never trustless, it&#x27;s just obscuring who you&#x27;re having to trust. (And as demonstrated over and over again, users often end up having to trust people who really don&#x27;t deserve that trust.)<br> </div> Wed, 06 Jul 2022 15:21:08 +0000 Whatever happened to SHA-256 support in Git? https://lwn.net/Articles/900174/ https://lwn.net/Articles/900174/ farnz <p>The distinction is that in the Linux development model, Linus is a single point of failure - the consensus algorithm in the federated git tree world is "we trust Linus". In a blockchain, the consensus algorithm will choose a tree from the set in the federation such that no individual tree in the federated set is "more trusted" than others - if Linus were to go rogue or go on vacation, a blockchain development model would choose someone else's tree as "mainline Linux" automatically. <p>This is the key to the blockchain's difference from other Merkle trees - in a blockchain, consensus is formed automatically and does not depend on humans choosing trusted people, while in most Merkle trees, the consensus decision depends on humans making trust decisions. <p>It's mathematically neat that we can have consensus without needing trust, but it's not necessarily a practical result. Wed, 06 Jul 2022 14:34:38 +0000 Whatever happened to SHA-256 support in Git? https://lwn.net/Articles/900173/ https://lwn.net/Articles/900173/ geert <div class="FormattedComment"> Sounds like Linux kernel development, where (ideally) all forks end up being merged into Linus&#x27; tree, eventually...<br> <p> See James Bottomley&#x27;s closing keynote at OLS2007 (<a href="https://www.linux.com/news/ols-closes-keynote/">https://www.linux.com/news/ols-closes-keynote/</a>).<br> </div> Wed, 06 Jul 2022 14:04:33 +0000 Whatever happened to SHA-256 support in Git? https://lwn.net/Articles/900128/ https://lwn.net/Articles/900128/ nybble41 <div class="FormattedComment"> The key element which sets a blockchain apart from an arbitrary Merkle tree (or DAG) is the Byzantine consensus system which ensures that there is only *one* dominant chain in the distributed system. Git repos are organized into one or more Merkel trees, but it&#x27;s a federated system where each node is a silo with its own data, not a distributed one where all the nodes (eventually) come to share a single Merkle root with new &quot;blocks&quot; being added to a common &quot;chain&quot;.<br> </div> Wed, 06 Jul 2022 03:18:21 +0000 Whatever happened to SHA-256 support in Git? https://lwn.net/Articles/900113/ https://lwn.net/Articles/900113/ koh <div class="FormattedComment"> Please do all of us a favour and enlighten us as to what technically (usually) are those fundamental differences you&#x27;re hinting at.<br> </div> Tue, 05 Jul 2022 22:17:18 +0000 Plan is to make it easy to transition. https://lwn.net/Articles/899490/ https://lwn.net/Articles/899490/ gmatht <div class="FormattedComment"> As jthill already mentioned, we can already do `git init --object-format=sha256`. The difficulty is making it easy to transition to a new hash. Once it is easy to transition to a new hash, there is less need to pick a future-proof hash, and in the meanwhile sha256 has more widespread hardware acceleration. See: <a href="https://stackoverflow.com/questions/60087759/git-is-moving-to-new-hashing-algorithm-sha-256-but-why-git-community-settled-on">https://stackoverflow.com/questions/60087759/git-is-movin...</a><br> </div> Thu, 30 Jun 2022 13:53:25 +0000 Whatever happened to SHA-256 support in Git? https://lwn.net/Articles/899442/ https://lwn.net/Articles/899442/ Karellen <div class="FormattedComment"> My first thought was to prefix hashes with the hash type and a separator, e.g. &quot;sha256:0123...&quot;. That way you could add new hashes whenever the devs wanted, by just adding the algorithm and assigning a new prefix. Any hash already stored inside a git repo that is not preceded by a type is automatically assumed to be sha1. A commit with an sha256 hash could have parents with either sha256 or sha1 hashes, or even both!<br> <p> The way they decided to go about things (last I checked) did seem a bit constraining.<br> </div> Thu, 30 Jun 2022 10:35:34 +0000 Compliance nonsense https://lwn.net/Articles/899219/ https://lwn.net/Articles/899219/ cortana <div class="FormattedComment"> Eagerly awaiting a tool that produces collisions by adding commented ascii art to source code... :)<br> </div> Tue, 28 Jun 2022 11:49:58 +0000 IPv6 https://lwn.net/Articles/899196/ https://lwn.net/Articles/899196/ ceplm <div class="FormattedComment"> I think the bias is that more readers are IT professionals sitting on old IPv4 networks who use IPv6 only as a back-stop.<br> </div> Mon, 27 Jun 2022 19:25:44 +0000 Whatever happened to SHA-256 support in Git? https://lwn.net/Articles/899183/ https://lwn.net/Articles/899183/ smammy Git people are so into shortened hashes that I doubt they'd go for a format that requires a four-digit prefix. Multihash <a href="https://public-inbox.org/git/?q=multihash">has been discussed</a> but obviously that never went anywhere. Mon, 27 Jun 2022 15:24:44 +0000 Whatever happened to SHA-256 support in Git? https://lwn.net/Articles/899159/ https://lwn.net/Articles/899159/ KaiRo <div class="FormattedComment"> Please do all of us a favor and don&#x27;t use the word &quot;blockchain&quot; when you obviously don&#x27;t know what makes something one. While blockchain usually use merkle trees, that doesn&#x27;t mean a merkle tree is a blockchain, it&#x27;s (usually) part of one. There is enough FUD and scamming around this area, it&#x27;s neither useful to you to join into that muddy crowd nor is it useful to those of us who are trying to make decent and honest use out of the social engineering and technology combination that actual blockchains represent.<br> </div> Mon, 27 Jun 2022 14:02:05 +0000 At this point... https://lwn.net/Articles/899115/ https://lwn.net/Articles/899115/ kilobyte <div class="FormattedComment"> BLAKE3 instead? Much faster, an earlier version of it was a SHA-3 finalist, there&#x27;s no risk the NSA picked an algorithm they know how to break (there were some irregularities during the competition), can be arbitrarily parallelized.<br> </div> Mon, 27 Jun 2022 08:56:50 +0000 Whatever happened to SHA-256 support in Git? https://lwn.net/Articles/899114/ https://lwn.net/Articles/899114/ taladar <div class="FormattedComment"> And spout nonsense like &quot;never change a running system&quot; because that is what some old person told them in the 70s.<br> </div> Mon, 27 Jun 2022 08:47:24 +0000 At this point... https://lwn.net/Articles/899099/ https://lwn.net/Articles/899099/ jd <div class="FormattedComment"> ...Switch to SHA-3. It won&#x27;t, apparently, slow adoption at all and, at least, will still be secure by the time everyone uses it.<br> </div> Sun, 26 Jun 2022 18:34:24 +0000 Compliance nonsense https://lwn.net/Articles/899080/ https://lwn.net/Articles/899080/ jthill <p>Except that exists already, it's just Git. `git init --object-format=sha256` and your repo uses sha256 only and can't talk to sha1 repos. I'd be curious how easily the web frontends' private-server options can be made to use the new object format if they don't have to talk to any poor left-behind sha1 repos either. <p>As a side note, afaik all known or suspected collision-generating methods require some place to hide gobs of carefully-chosen noise bits in both colliding texts. pdf is a binary format and can hide arbitrary noise. source code can not. There is no possibility that anyone get an engineered source file past even the most cursory code review. The garbage would appear the first time anyone so much as glanced at the diffs. Sun, 26 Jun 2022 14:49:57 +0000 IPv6 https://lwn.net/Articles/899078/ https://lwn.net/Articles/899078/ Sesse <div class="FormattedComment"> This is very much true, and it is largely due to the incumbent ISPs lagging. Most countries&#x27; status is usually very much driven by what key people in a few select ISPs choose to care about. :-/<br> </div> Sun, 26 Jun 2022 11:29:01 +0000 IPv6 https://lwn.net/Articles/899077/ https://lwn.net/Articles/899077/ jem <div class="FormattedComment"> Deployment of IPv6 in Norway is lagging six years behind the global average, though. (Based on the aforementioned Google stats: <a href="https://www.google.com/intl/en/ipv6/statistics.html#tab=per-country-ipv6-adoption">https://www.google.com/intl/en/ipv6/statistics.html#tab=p...</a>)<br> <p> </div> Sun, 26 Jun 2022 11:27:16 +0000 Whatever happened to SHA-256 support in Git? https://lwn.net/Articles/899067/ https://lwn.net/Articles/899067/ gdt <p>As a worked example, Australia's <i>Information Security Manual</i> states <blockquote> <p>Only hashing algorithms from the SHA-2 family are approved for use. When using SHA-2 for hashing, an output size of at least 224 bits is used, preferably SHA-384.</p> </blockquote> <p>To use Git you cannot make any claim that hashing in Git contributes to addressing your organisation's threat model: say the threat of subversion of the repository. Then apply for an exception, arguing that Git's use of SHA-1 is out-of-scope as it is not implicated in any threat model. You may then be asked to show how the threat of subversion of the repository is countered, which could be GPG-signing each commit from a key only held on a trusted processor (eg, a Yubikey).</p> <p>Of course this application for an exception may not be successful: not every organisation's security policy makers may have a deep technical understanding; not every application for an exception may fully address the threat model; and there may be a overarching policy of limiting exceptions in fields with large and widespread consequences, such as the supply chain threat from subversion of software builds.</p> Sun, 26 Jun 2022 03:16:43 +0000 Whatever happened to SHA-256 support in Git? https://lwn.net/Articles/899055/ https://lwn.net/Articles/899055/ salimma <div class="FormattedComment"> I&#x27;m curious too. Mercurial also hasn&#x27;t moved<br> <p> <a href="https://www.mercurial-scm.org/wiki/SHA1TransitionPlan">https://www.mercurial-scm.org/wiki/SHA1TransitionPlan</a><br> </div> Sat, 25 Jun 2022 23:13:36 +0000 IPv6 https://lwn.net/Articles/899043/ https://lwn.net/Articles/899043/ Sesse <div class="FormattedComment"> Here (Norway), the copper network (POTS, ISDN, DSL) is simply left to die; a little of it is still left, but if it breaks, it won&#x27;t be fixed. Nearly all voice is 2G/4G/5G (3G has largely been turned down). Data is DOCSIS (cable), FTTH or 4G/5G.<br> </div> Sat, 25 Jun 2022 20:05:52 +0000 IPv6 https://lwn.net/Articles/899041/ https://lwn.net/Articles/899041/ Wol <div class="FormattedComment"> <font class="QuotedText">&gt; Mobile technology is newer and faster moving, old landlines are in the category &quot;they work, so don&#x27;t fix them&quot;.</font><br> <p> In the UK, &quot;old landlines&quot; will soon be history. Our POTS here has already been upgraded to VOIP - my old POTS phone is now plugged into my broadband router and works fine (for a somewhat jaded definition of &quot;fine&quot; :-(<br> <p> Dunno about other countries in Europe, though ...<br> <p> Cheers,<br> Wol<br> </div> Sat, 25 Jun 2022 18:51:25 +0000 Whatever happened to SHA-256 support in Git? https://lwn.net/Articles/899040/ https://lwn.net/Articles/899040/ ms-tg <div class="FormattedComment"> <font class="QuotedText">&gt; There&#x27;s also Multihash, for what it&#x27;s worth.</font><br> <p> How can we get this amplified? From my understanding, adopting multihash would go a long way to future-proofing git, as there would be a single “before multihash” case to account for, and then all future iterations would be signaling the encoding in-band with the ability to add future options cleanly? Wouldn’t it?<br> </div> Sat, 25 Jun 2022 17:46:45 +0000 Whatever happened to SHA-256 support in Git? https://lwn.net/Articles/899039/ https://lwn.net/Articles/899039/ jezuch <div class="FormattedComment"> <font class="QuotedText">&gt; problems with it historically</font><br> <p> ...and people still recommend against XFS because of a data-eating bug that was fixed in 2005 *sigh*<br> </div> Sat, 25 Jun 2022 17:27:02 +0000 Whatever happened to SHA-256 support in Git? https://lwn.net/Articles/899037/ https://lwn.net/Articles/899037/ farnz <p>One fun thing about that is that you can expect to see more IPv6 traffic by byte volume or packet count than IPv4, but not necessarily by connection count. <p>A thing that drives IPv6 adoption in mobile is that data-intensive services like Netflix and YouTube are IPv6-enabled - so by enabling IPv6 for your customers, you can use stateless routing to get that traffic off your backbone and onto the video provider network nearer the cell site, whereas for CGNAT (including NAT64 and 464XLAT here), you have the complexity of maintaining distributed state to handle. Sat, 25 Jun 2022 16:20:03 +0000 Whatever happened to SHA-256 support in Git? https://lwn.net/Articles/899010/ https://lwn.net/Articles/899010/ alison <div class="FormattedComment"> <font class="QuotedText">&gt; Every git commit is the root of a merkle tree, or as the kids call it, a “blockchain”. A git </font><br> <font class="QuotedText">&gt; commit object id is the hash of a string which includes among other things the commit’s </font><br> <font class="QuotedText">&gt; immediate parent object ids, and the commit’s root tree object id.</font><br> <p> Is the algorithm used by TPMs also a merkel tree?<br> </div> Sat, 25 Jun 2022 04:46:24 +0000 IPv6 https://lwn.net/Articles/899008/ https://lwn.net/Articles/899008/ alison <div class="FormattedComment"> LWN is the funniest website that I read regularly, mostly intentionally. Keep up the good work!<br> </div> Sat, 25 Jun 2022 04:41:31 +0000 Whatever happened to SHA-256 support in Git? https://lwn.net/Articles/898981/ https://lwn.net/Articles/898981/ dvdeug <div class="FormattedComment"> My boss insists on turning off IPv6 on all computers we install. I&#x27;m not a fan, but he&#x27;s the boss, and he&#x27;s had problems with it historically.<br> </div> Fri, 24 Jun 2022 19:24:36 +0000 Whatever happened to SHA-256 support in Git? https://lwn.net/Articles/898967/ https://lwn.net/Articles/898967/ khim <p>You can even do both at the same time: “h” would mean “normal SHA256-bit hash in 65 letters” and “stuvwxyz” would start “40-letters long SHA256-bit hash” (if you take ASCII, excluse 37 “really bad” symbols, e.g. first 32, 127, “ ”, “%”, “$” and “.” then you can encode 13 bits in two characters).</p> <p>This way you would even have an option for these old tools where 40-letters space is reserved for hash.</p> <p>This should not be a default because at some point even longer hash would be needed, most likely.</p> Fri, 24 Jun 2022 17:54:21 +0000 IPv6 https://lwn.net/Articles/898965/ https://lwn.net/Articles/898965/ Lennie <div class="FormattedComment"> Maybe lwn.net has a certain regional bias when it comes to IPv6 traffic.<br> </div> Fri, 24 Jun 2022 17:04:20 +0000 Whatever happened to SHA-256 support in Git? https://lwn.net/Articles/898960/ https://lwn.net/Articles/898960/ smammy There's also <a href="https://multiformats.io/multihash/">Multihash</a>, for what it's worth. Fri, 24 Jun 2022 16:18:15 +0000 Whatever happened to SHA-256 support in Git? https://lwn.net/Articles/898930/ https://lwn.net/Articles/898930/ angelsl <div class="FormattedComment"> Yes, so you could replace the contents of a file (blob object), or the tree object, or the commit object itself, by finding a hash collision.<br> </div> Fri, 24 Jun 2022 14:17:04 +0000 Whatever happened to SHA-256 support in Git? https://lwn.net/Articles/898904/ https://lwn.net/Articles/898904/ dbnichol <div class="FormattedComment"> This part of the article is what stuck me, too. Git has been around for nearly 20 years now. There are vast amounts of existing git repos with sha1 identifiers in them.<br> <p> I&#x27;d say the project is at best 50% done if there&#x27;s no interoperability with sha1 repos. Even if you switched git to default to sha256 on new repos and convinced all the major hosting providers to rewrite the history on all their repos to sha256 today, it would be years of pain before that trickled down through all the repos in the wild.<br> <p> Unless there&#x27;s compatibility with sha1 repos and a nearly automatic way to rewrite existing repos to sha256 in a compatible way, then it&#x27;s essentially unusable. That seems like just as big a problem if not bigger than making git capable of using a different hashing algorithm.<br> </div> Fri, 24 Jun 2022 12:15:43 +0000