Giter Club home page Giter Club logo

Comments (2)

nikitalpopov avatar nikitalpopov commented on May 23, 2024

Sorry for ignoring you for so long.
If you select 'Download zip' option, then maybe you're right.
Download zip

But git clone should handle it for you since it does checksum match (correct me if I'm wrong).

Git stores snapshots not patches. Internally, Git runs SHA checksum on every file. Every commit is just a list of file names and their corresponding checksums. The database mapping checksum to its content is shared among commits. If the content of a file in two commits are the same, only the checksum needs to be stored in the two commits. If the file is modified, a new mapping of checksum to the modified file is created and stored.

Source

from vedai.

nikitalpopov avatar nikitalpopov commented on May 23, 2024

Few more details there

Everything in Git is stored as an "object". Each object has a hash ID, which we compute using some sort of checksum (SHA-1 currently but Git 2.29 already has prototype support for other hash algorithms). Git doesn't store files, just these objects. The extraction code must be told the hash ID, because that's how we look up an object in the key-value database that stores them. The extraction code then computes the hash again during extraction. This must match the key used to look up the object. If it does, the object is not corrupted.

The actual re-checking of object hash IDs during git clone is slightly deferred, but this is an implementation detail: git clone consists of six steps, the fifth step being a git fetch that obtains all reachable objects. The sender can send those objects one at a time, in which case they'd get checked as they go into storage, but that's terribly slow, so modern protocols send a so-called pack file with delta-compressed objects in it. The receiving Git then runs a pack indexer, which reads and checks all the objects. Hence clone finds any errors during the indexing.

from vedai.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.