How to write to the commit graph on clone?
- From
- Kristoffer 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 = trueI 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.666sSo 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.013sIs there any config for writing to the commit graph on clone?
-- Kristoffer Haugsbakk