git/stats: Expose commit-graph information on generation data
Commit-graphs optionally carry GDA2 and GCO2 information when Git is
asked to generate them via commitGraph.generationNumber=2
. While this
kind of information should've theoretically already exist in the form of
the GDAT and GCOV chunks, due to a bug in Git v2.36.0 and earlier Git
actually always ignored this kind of data.
Due to a bug that caused corruption of commit-graphs that was introduced when upgrading from v1 to v2 we disabled computing generation numbers altogether. Generation numbers are an important optimization in some contexts though, so we should aim to eventually reenable generation of them.
As a first step towards this let's start exposing information about
whether commit-graphs have generation data or not via the git/stats
package. Note that we only check for the v2 chunks GDA2 and GCO2 as the
other formats weren't actually ever consumed in the first place. And
current Git versions wouldn't know to write these anyway.
Changelog: added