git treeless-clone + wait + pull → problem, again pull → OK
- From
- Дилян Палаузов <dilyan.palauzov@aegee.org>
- Date
- Jul 1, 2025, 09:24 UTC
- Message-ID
- <e7a2fdff63d9a90ef4dc1341fa642fff5197b64a.camel@aegee.org>
Hello,
the problem is that when I do a treeless or blobless clone and some time later git pull, git prints many, many lines that it tries to fetch data, then I interrupt with Ctrl+C, then do git pull again and then it completes. However I never tried to precisely document this until now:
On 26 June 2025 I do
$ git clone --filter=tree:0 https://github.com/git/git.git … $ git show --oneline cf6f63ea6 (HEAD -> master, origin/master, origin/HEAD) The fourth batch
Today I do
$ git pull From https://github.com/git/git cf6f63ea6..83014dc05 master -> origin/master 74e6fc65d..83e99ddf4 next -> origin/next + bc3287e71...a842a7780 seen -> origin/seen (forced update) fefffbb31..7af8e2e03 todo -> origin/todo fatal: You are attempting to fetch cf6f63ea6bf35173e02e18bdc6a4ba41288acff9, which is in the commit graph file but not in the object database. This is probably due to repo corruption. If you are attempting to repair this repo corruption by refetching the missing object, use 'git fetch --refetch' with the missing object. fatal: could not fetch 5e66731277a4d791043dc51e2804dc0b496c523b from promisor remote
$ git pull Updating cf6f63ea6..83014dc05 remote: Enumerating objects: 22, done. remote: Counting objects: 100% (21/21), done. remote: Compressing objects: 100% (21/21), done. Receiving objects: 100% (22/22), 137.56 KiB | 8.60 MiB/s, done. remote: Total 22 (delta 0), reused 1 (delta 0), pack-reused 1 (from 1) Fast-forward Documentation/RelNotes/2.51.0.adoc | 15 +++ Documentation/config/merge.adoc | 14 +- Documentation/git-merge.adoc | 2 +- Documentation/git-stash.adoc | 29 ++++- Documentation/merge-options.adoc | 3 + builtin/merge.c | 66 +++++++++- builtin/pull.c | 3 + builtin/stash.c | 460 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- contrib/coccinelle/commit.cocci | 3 +- hash.h | 1 + object-name.c | 6 +- t/t0021-conversion.sh | 4 +- t/t0610-reftable-basics.sh | 6 +- t/t0612-reftable-jgit-compatibility.sh | 13 +- t/t0613-reftable-write-options.sh | 24 +--- t/t1400-update-ref.sh | 10 +- t/t3903-stash.sh | 101 +++++++++++++++ t/t5004-archive-corner-cases.sh | 5 +- t/t6422-merge-rename-corner-cases.sh | 10 +- t/t7422-submodule-output.sh | 9 +- t/t7600-merge.sh | 74 ++++++++++- t/test-lib-functions.sh | 16 ++- 22 files changed, 789 insertions(+), 85 deletions(-)
As can be seen, after treeless (or blobless) clone, git pull has to be executed twice to complete the operation, the first time calling always git fails. With always I mean over longer period of time I tried this with many different repositories.
git version 2.50.0
Kind regards Дилян