‹ BackHN Continuity

Thread

Git 3.0's upcoming SHA-256 default will be a costly mistake

570 points · 536 comments · chmaynard

  1. gandreani · · focus · HN ↗
    One of my favorite fun facts about Fossil SCM (another source control by the devs of sqlite) is that they patched their use of SHA1 6 days after the shattered attack was published:

    "Both Fossil and Git started out using only SHA1 hashes. But when the SHAttered attack against SHA1 was published on 2017-02-23, the need to migrate to a stronger hash algorithm was recognized. Fossil added the ability to use SHA3-256 as an alternative on 2017-03-01 (six days after the SHAttered attack was first published). SHA3-256 is now the default for all new repositories and check-ins in Fossil, though older check-ins that occurred prior to SHAttered can still use their original SHA1 hash. Hence, no repositories had to be rebuilt and no hyperlinks were broken."

    <a href="https:&#x2F;&#x2F;fossil-scm.org&#x2F;home&#x2F;doc&#x2F;trunk&#x2F;www&#x2F;hundredandone.md" rel="nofollow">https:&#x2F;&#x2F;fossil-scm.org&#x2F;home&#x2F;doc&#x2F;trunk&#x2F;www&#x2F;hundredandone.md

    To me it&#x27;s so interesting watching in realtime Git is still battling with this decision and for Fossil it was just another week of development.

    That whole page is fun to read. Another fun fact somewhere else in the docs is that Fossil uses a grow-only set to store commits. They came up with this scheme some years before it was formalized by CRDTs!

    1. schacon · · focus · HN ↗
      I mean, there are two things here. One is how difficult it is to have a different hashing mechanism. Brian and other heroes in the Git core group have done amazing work to make this _technically_ possible on a repo level. To test some of my theories, I trivially implemented MD5 and an insanely dumb and easily breakable hash backend. It&#x27;s not _hard_ to change the mechanism now. It&#x27;s about the community.

      Fossil isn&#x27;t difficult to change not because it&#x27;s technically harder for Git but because Git has a community and ecosystem that Fossil does not. The cost is not in the individual project for Git, the cost is because there is _so much_ in Git and this bifurcates everything.

      1. mook · · focus · HN ↗
        As an expansion on that, as far as I know there&#x27;s only one implementation of Fossil. There was at least a Java one for git, I believe, and I don&#x27;t think upstream git is related to libgit2 either. And GitHub is doing… something not visible from the outside.

        (… looking at the parent, though, I imagine there might be some information from the inside…)

        1. sgbeal · · focus · HN ↗
          &gt; As an expansion on that, as far as I know there&#x27;s only one implementation of Fossil.

          That&#x27;s is, since only recently, no longer strictly true: the age-old libfossil recently got client sync support, so is now (aside from _serving_ repos) essentially a standalone impl (its own developer still uses fossil(1) stash, patch, and diff -tk features, but otherwise uses libfossil&#x27;s counterparts).

          Also, Dan Mestas has &lt;<a href="https:&#x2F;&#x2F;github.com&#x2F;danmestas&#x2F;go-libfossil" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;danmestas&#x2F;go-libfossil&gt;, a Go library for working and fossil, and he is also working on &lt;<a href="https:&#x2F;&#x2F;zeitforge.app&#x2F;" rel="nofollow">https:&#x2F;&#x2F;zeitforge.app&#x2F;&gt;, a clean-room impl. of fossil (whereas libfossil is largely ported directly from fossil(1)) which even goes so far as to _not_ use an sqlite database for its file storage.

          Dan Mestas and Dan Shearer are working on finalizing RFCs for fossil&#x27;s sync protocol and artifact format, and zeitforge is created by carefully managing LLMs which are reading that draft (but not the source code of libfossil or fossil).

          1. gandreani · · focus · HN ↗
            I personally have been using `go-libfossil` in a project! It&#x27;s got some sharp edges but insanely useful in avoiding CGO and using fossil at the same time
Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.