How is git validation implemented?

At startup git checkout, the mergebase of the old HEADand the new HEADcan be arbitrarily far back. A naive implementation would be to linearly apply each diff, but the operation is instantaneous.

I have a hunch that it could be implemented with something like skiplisty for intermediate diff caching, but this is just an assumption.

Does anyone know how this is implemented? Thank you :)

+4
source share
1 answer

You have a good example of how verification (in principle) is implemented in the git javascript implementation (as an exercise) of Mary Rose Cook's Gitlet .

checkout :

  • checkout() , HEAD, ref.
    ref .
  • .
  • , ref .
  • , , .
  • , ref - . , , ref - , HEAD .
  • , .
    , .
    - , .
  • .
  • ref , , .
  • . .
  • HEAD.
    , HEAD.
    , HEAD.
  • .
  • .

, ( Git), , .

, GitMinutes # 31: Mary Rose Cook on Gitlet .

+4

All Articles