git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: 2.29.0.rc0.windows.1: Duplicate commit id error message when fetching

From
Derrick Stolee <stolee@gmail.com>
Date
Oct 8, 2020, 13:22 UTC
Message-ID
<5bbdaed5-df29-8bfe-01c2-eb2462dcca22@gmail.com>
In-Reply-To
<52782500-274e-2c72-39e2-be4252959d47@gmail.com>
On 10/8/2020 8:50 AM, Derrick Stolee wrote:
Show 31 quoted lines
> On 10/8/2020 8:06 AM, Jeff King wrote:
>> But regardless, it seems unfriendly that we can't
>> get out of it while merging the graphs. Doing this obviously makes the
>> problem go away:
>>
>> diff --git a/commit-graph.c b/commit-graph.c
>> index cb042bdba8..ae1f94ccc4 100644
>> --- a/commit-graph.c
>> +++ b/commit-graph.c
>> @@ -2023,8 +2023,11 @@ static void sort_and_scan_merged_commits(struct write_commit_graph_context *ctx)
>>  
>>  		if (i && oideq(&ctx->commits.list[i - 1]->object.oid,
>>  			  &ctx->commits.list[i]->object.oid)) {
>> -			die(_("unexpected duplicate commit id %s"),
>> -			    oid_to_hex(&ctx->commits.list[i]->object.oid));
>> +			/*
>> +			 * quietly ignore duplicates; these could come from
>> +			 * incremental graph files mentioning the same commit.
>> +			 */
>> +			continue;
>>  		} else {
>>  			unsigned int num_parents;
>>  
>>
>> but it's not clear to me if that's papering over another bug, or
>> gracefully handling a situation that we ought to be.
> 
> I think this is a good thing to do, at minimum. As I discussed above,
> the "input data" of the incremental commit-graph chain with duplicate
> commits across layers isn't actually _invalid_. It's unexpected based
> on what Git "should" be doing.

As I was working on my own version of this, I realized that just commenting here still creates duplicate commits in the new layer, which is even MORE unexpected. It could cause some confusion with the binary search, but likely that is still fine. The only "real" issue is that it is wasted data.

I'll send [1] to the list soon (after build & test validation), but it includes copying the pointers to a new "de-duplicated" list.

[1] https://github.com/gitgitgadget/git/pull/747

Thanks, -Stolee

Previous: Derrick StoleeNext: Thomas Braun
Message 6 of 14 in “2.29.0.rc0.windows.1: Duplicate commit id error message when fetching”
  1. Thomas BraunOct 7, 2020
  2. Jeff KingOct 7, 2020
  3. Thomas BraunOct 8, 2020
  4. Jeff KingOct 8, 2020
  5. Derrick StoleeOct 8, 2020
  6. Derrick StoleeOct 8, 2020
  7. Thomas BraunOct 9, 2020
  8. Derrick StoleeOct 9, 2020
  9. Thomas BraunOct 9, 2020
  10. Derrick StoleeOct 9, 2020
  11. Jeff KingOct 9, 2020
  12. Taylor BlauOct 9, 2020
  13. Derrick StoleeOct 9, 2020
  14. Taylor BlauOct 9, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.