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

How to write to the commit graph on clone?

From
KHKristoffer Haugsbakk <kristofferhaugsbakk@fastmail.com>
Date
Apr 16, 2023, 12:46 UTC
Message-ID
<743b64a0-8731-46b8-a456-aaa51e310b9b@app.fastmail.com>
In-Reply-To
<20230416070906.GA3271@szeder.dev>
> 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?
-- 
Kristoffer Haugsbakk
Previous: SZEDER GáborNext: Ævar Arnfjörð Bjarmason
Message 8 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.