Git’s database internals II: commit history queries (GitHub blog)
The GitHub blog has posted adetailed look at how Git stores the commit history to be able toquickly answer queries.
The commit-graph file provides a location for adding newinformation to our commits that do not exist in the commit objectformat by default. The new information that we store is called ageneration number. There are multiple ways to compute ageneration number, but the most important property we need toguarantee is the following:If the generation number of a commit A is less than the generationnumber of a commit B, then A cannot reach B.