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

Re: How to write to the commit graph on clone?

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Apr 16, 2023, 15:24 UTC
Message-ID
<230416.86edojsvc6.gmgdl@evledraar.gmail.com>
In-Reply-To
<743b64a0-8731-46b8-a456-aaa51e310b9b@app.fastmail.com>
On Sun, Apr 16 2023, Kristoffer Haugsbakk wrote:
Show 40 quoted lines
>> The commit-graph has been enabled by default in v2.24.0, released over
>> three years ago.  I wonder why Rohit's and/or Kristoffer's repos
>> didn't have it already?!
>
> I might have done a fresh clone of Linux right before I replied to this
> email thread, or else it might have just been lying around. (I don’t
> work on Linux. ;)
>
> I found out that I need to add this to my Git config in order for the
> commit graph to be updated on `git fetch`, so I added it:
>
>     [fetch]
>             writeCommitGraph = true
>
> I was wondering if this would help with cloning, so I did a fresh one:
>
>     $ git clone https://github.com/torvalds/linux/ linux-github-2
>     $ cd linux-github-2/
>     $ time git log --oneline --graph | head -1
>     *   3e7bb4f24617 Merge tag '6.3-rc6-smb311-client-negcontext-fix' of git://git.samba.org/sfrench/cifs-2.6
>
>     real	0m10.364s
>     user	0m9.700s
>     sys	0m0.666s
>
> So no.
>
> But doing a `git fetch origin` fixed it:
>
>     $ git fetch origin
>     Expanding reachable commits in commit graph: 1171056, done.
>     Writing out commit graph in 5 passes: 100% (5855280/5855280), done.
>     $ time git log --oneline --graph | head -1
>     *   3e7bb4f24617 Merge tag '6.3-rc6-smb311-client-negcontext-fix' of git://git.samba.org/sfrench/cifs-2.6
>
>     real	0m0.017s
>     user	0m0.007s
>     sys	0m0.013s
>
> Is there any config for writing to the commit graph on clone?

I don't think there is, but here's a lengthy discussion I started a while ago about having some "on glone gc", which would cover this: https://lore.kernel.org/git/87tvm3go42.fsf@evledraar.gmail.com/

I haven't re-read it just now, but if you're interested that should be a good place to start.

Previous: Kristoffer Haugsbakk
Message 9 of 9 in “git log causing hang while browsing upstream linux”
  1. Rohit NerApr 4, 2023
  2. Kristoffer HaugsbakkApr 4, 2023
  3. Kristoffer HaugsbakkApr 4, 2023
  4. Rohit NerApr 10, 2023
  5. Taylor BlauApr 11, 2023
  6. Kristoffer HaugsbakkApr 11, 2023
  7. SZEDER GáborApr 16, 2023
  8. How to write to the commit graph on clone?Kristoffer Haugsbakk, Apr 16, 2023
  9. Ævar Arnfjörð BjarmasonApr 16, 2023

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.