Git’s database internals II: commit history queries (GitHub blog)

Post Syndicated from original https://lwn.net/Articles/906501/

The GitHub blog has posted a
detailed look
at how Git stores the commit history to be able to
quickly answer queries.

The commit-graph file provides a location for adding new
information to our commits that do not exist in the commit object
format by default. The new information that we store is called a
generation number. There are multiple ways to compute a
generation number, but the most important property we need to
guarantee is the following:

If the generation number of a commit A is less than the generation
number of a commit B, then A cannot reach B.