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

Re: [PATCH 1/1] commit-graph: fix writing first commit-graph during fetch

From
SZEDER Gábor <szeder.dev@gmail.com>
Date
Oct 22, 2019, 23:35 UTC
Message-ID
<20191022233556.GF4348@szeder.dev>
In-Reply-To
<20191022214553.GA18314@sigill.intra.peff.net>
On Tue, Oct 22, 2019 at 05:45:54PM -0400, Jeff King wrote:
Show 38 quoted lines
> On Tue, Oct 22, 2019 at 04:33:16PM -0400, Jeff King wrote:
> 
> > > I have failed to produce a test using the file:// protocol that
> > > demonstrates this bug.
> > 
> > Hmm, from the description, it sounds like it should be easy. I might
> > poke at it a bit.
> 
> Hmph. I can reproduce it here, but it seems to depend on the repository.
> If I do this:
> 
> diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh
> index ecabbe1616..8d473a456f 100755
> --- a/t/t5510-fetch.sh
> +++ b/t/t5510-fetch.sh
> @@ -583,6 +583,14 @@ test_expect_success 'fetch.writeCommitGraph' '
>  	)
>  '
>  
> +test_expect_success 'fetch.writeCommitGraph with a bigger repo' '
> +	git clone "$TEST_DIRECTORY/.." repo &&
> +	(
> +		cd repo &&
> +		git -c fetch.writeCommitGraph fetch origin
> +	)
> +'
> +
>  # configured prune tests
>  
>  set_config_tristate () {
> 
> it reliably triggers the bug. But if I make a synthetic repo, even it
> has a lot of commits (thousands or more), it doesn't trigger. I thought
> maybe it had to do with having commits that were not at tips (since the
> tip ones presumably _are_ fed into the graph generation process). But
> that doesn't seem to help.
> 
> Puzzling...
Submodules?
  $ cd ~/src/git/
  $ git quotelog 86cfd61e6b
  86cfd61e6b (sha1dc: optionally use sha1collisiondetection as a submodule, 2017-07-01)
  $ git init --bare good.git
  Initialized empty Git repository in /home/szeder/src/git/good.git/
  $ git push -q good.git 86cfd61e6b^:refs/heads/master
  $ git clone good.git good-clone
  Cloning into 'good-clone'...
  done.
  $ git -c fetch.writeCommitGraph -C good-clone fetch origin
  Computing commit graph generation numbers: 100% (46958/46958), done.
  $ git init --bare bad.git
  Initialized empty Git repository in /home/szeder/src/git/bad.git/
  $ git push -q bad.git 86cfd61e6b:refs/heads/master
  $ git clone bad.git bad-clone
  Cloning into 'bad-clone'...
  done.
  $ git -c fetch.writeCommitGraph -C bad-clone fetch origin
  Computing commit graph generation numbers: 100% (1/1), done.
  BUG: commit-graph.c:886: missing parent 9936c1b52a39fa14fca04f937df3e75f7498ac66 for commit 86cfd61e6bc12745751c43b4f69886b290cd85cb
  Aborted

In the cover letter Derrick mentioned that he used https://github.com/derrickstolee/numbers for testing, and that repo has a submodule as well.

Previous: Jeff KingNext: Derrick Stolee
Message 5 of 23 in “[v2.24.0-rc0 BUG] fetch.writeCommitGraph fails on first fetch”
  1. 0/1 [v2.24.0-rc0 BUG] fetch.writeCommitGraph fails on first fetchDerrick Stolee via GitGitGadget, Oct 22, 2019
  2. 1/1 commit-graph: fix writing first commit-graph during fetchDerrick Stolee via GitGitGadget, Oct 22, 2019
  3. Jeff KingOct 22, 2019
  4. Jeff KingOct 22, 2019
  5. SZEDER GáborOct 22, 2019
  6. Derrick StoleeOct 23, 2019
  7. Jeff KingOct 23, 2019
  8. Jeff KingOct 23, 2019
  9. 0/2 [v2.24.0-rc0 BUG] fetch.writeCommitGraph fails on first fetchDerrick Stolee via GitGitGadget, Oct 23, 2019
  10. 1/2 t5510-fetch.sh: demonstrate fetch.writeCommitGraph bugDerrick Stolee via GitGitGadget, Oct 23, 2019
  11. SZEDER GáborOct 23, 2019
  12. Derrick StoleeOct 23, 2019
  13. SZEDER GáborOct 24, 2019
  14. 2/2 commit-graph: fix writing first commit-graph during fetchDerrick Stolee via GitGitGadget, Oct 23, 2019
  15. SZEDER GáborOct 23, 2019
  16. Derrick StoleeOct 24, 2019
  17. SZEDER GáborOct 30, 2019
  18. 0/2 [v2.24.0-rc0 BUG] fetch.writeCommitGraph fails on first fetchDerrick Stolee via GitGitGadget, Oct 24, 2019
  19. 1/2 t5510-fetch.sh: demonstrate fetch.writeCommitGraph bugDerrick Stolee via GitGitGadget, Oct 24, 2019
  20. 2/2 commit-graph: fix writing first commit-graph during fetchDerrick Stolee via GitGitGadget, Oct 24, 2019
  21. 0/2 [v2.24.0-rc0 BUG] fetch.writeCommitGraph fails on first fetchDerrick Stolee via GitGitGadget, Oct 24, 2019
  22. 1/2 t5510-fetch.sh: demonstrate fetch.writeCommitGraph bugDerrick Stolee via GitGitGadget, Oct 24, 2019
  23. 2/2 commit-graph: fix writing first commit-graph during fetchDerrick Stolee via GitGitGadget, Oct 24, 2019

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.