Re: [PATCH 7/9] commit-graph: drop count_distinct_commits() function
- From
Derrick Stolee <stolee@gmail.com>
- Date
- Dec 4, 2020, 20:06 UTC
- Message-ID
- <1103d97b-668f-8ad6-fc62-3fa09067a8bb@gmail.com>
- In-Reply-To
- <X8qGTaIdnNa5mAfC@coredump.intra.peff.net>
On 12/4/2020 1:56 PM, Jeff King wrote:
Show 5 quoted lines
> That turns out not to be a problem, though. The only things we do with > the count are: > > - check if our count will overflow our data structures. But the limit > there is 2^31 commits, so it's not likely to happen in practice.
You do point out that you are removing this logic, done in this if statement:
Show 5 quoted lines
> - if (count_distinct >= GRAPH_EDGE_LAST_MASK) {
> - error(_("the commit graph format cannot write %d commits"), count_distinct);
> - res = -1;
> - goto cleanup;
> - }What is the harm of keeping this? I know it is very unlikely, but I'd rather fail here than write a commit-graph that gets parsed as garbage.
Thanks, -Stolee