News for hackers. Stuff that matters.
Re:Going down the rabbit hole of Git's new bundle-URI by yjftsjthsd-h on Monday March 17, 2025 @01:32AM (#43385458)
I can't imagine you haven't looked at this, but I'm curious: Do shallow clones help at all, or if not what was the problem with them? I'm willing to believe that there are usecases that actually use 1M commits of history, but I'd be interested to hear what they are.
Re:Going down the rabbit hole of Git's new bundle-URI by jakub_g on Monday March 17, 2025 @04:39AM (#43386310)
People really want to have history locally so that "git blame" / GitLens IDE extension work locally.
Re:Going down the rabbit hole of Git's new bundle-URI by schacon on Monday March 17, 2025 @05:14AM (#43386509)
These days if you do a blobless clone, Git will ask for missing files as it needs them. It's slower, but it's not broken.
Re:Going down the rabbit hole of Git's new bundle-URI by jakub_g on Monday March 17, 2025 @06:58AM (#43387120)
Maybe I was doing something wrong, but I had a very bad experience with - tbh don't remember, either blobless or treeless clone - when I evaluated it on a huge fast-moving monorepo (150k files, 100s of merges per day).

I cloned the repo, then was doing occasional `git fetch origin main` to keep main fresh - so far so good. At some point I wanted to `git rebase origin/main` a very outdated branch, and this made git want to fetch all the missing objects, serially one by one, which was taking extremely long compared to `git fetch` on a normal repo.

I did not find a way to to convert the repo back to "normal" full checkout and get all missing objects reasonably fast. The only way I observed happening was git enumerating / checking / fetching missing objects one by one, which in case of 1000s of missing objects takes so long that it becomes impractical.

Re:Going down the rabbit hole of Git's new bundle-URI by schacon on Monday March 17, 2025 @11:54AM (#43389853)
The brand newest version of Git has a new `git backfill` command that may help with this.

https://git-scm.com/docs/git-backfill

Re:Going down the rabbit hole of Git's new bundle-URI by jakub_g on Monday March 17, 2025 @01:48PM (#43390972)
Nice timing! Thanks!
Re:Going down the rabbit hole of Git's new bundle-URI by p_wood on Tuesday March 18, 2025 @06:41AM (#43397816)
For rebasing `--reapply-cherry-picks` will avoid the annoying fetching you saw. `git backfill` is great for fetching the history of a file before running `git blame` on that file. I'm not sure how much it will help with detecting upstream cherry-picks.
Re:Going down the rabbit hole of Git's new bundle-URI by jakub_g on Tuesday March 18, 2025 @03:41PM (#43404028)
Oh, interesting! Tbh I don't fully understand what "--reapply-cherry-picks" really does, because the docs are very concise and hand-wavy, and _why_ it doesn't need the fetches? Why it is not the default?