Argument list too long when fetching many missing objects from partial clone
Thank you for filling out a Git bug report!
Please answer the following questions to help us understand your issue.
What did you do before the bug happened? (Steps to reproduce your issue)
I'm poking around with partial clone. On my local server on my computer I have full clone of Git (git.git) repo.
I do partial clone from that server as remote (which is actually on the same computer):
git clone https://my-local-server.git/myself/git.git --filter=blob:none
Inside the partial clone, I tried to convert it to full clone. First, I gather list of missing objects:
git rev-list --objects --all --missing=print | grep -oP '^\?\K\w+' > .git/missing.list
Then I fetched those:
git fetch origin $(cat .git/missing.list)
What did you expect to happen? (Expected behavior)
All missing objects fetched successfully
What happened instead? (Actual behavior)
Git returned:
-bash: /opt/git/bin/git: Argument list too long
What's different between what you expected and what actually happened?
(nothing)
Anything else you want to add:
I think the problem lies on how to feed list of 110K+ objects to git fetch.
Note: Both the local server and the computer use Git 2.30.1
Please review the rest of the bug report below.
You can delete any lines you don't wish to share.
[System Info]
git version:
git version 2.30.1
cpu: x86_64
built from commit: 773e25afc41b1b6533fa9ae2cd825d0b4a697fad
sizeof-long: 8
sizeof-size_t: 8
shell-path: /bin/sh
uname: Linux 5.10.11-kernelorg-upstream-generic #1 SMP Fri Jan 29 12:56:19 WIB 2021 x86_64 compiler info: gnuc: 9.3
libc info: glibc: 2.31
$SHELL (typically, interactive shell): /bin/bash
[Enabled Hooks]
(none)
Signature · 1 line
An old man doll... just what I always wanted! - Clara
Quoted 16 lines · Bagas Sanjaya
Thank you for filling out a Git bug report!
Please answer the following questions to help us understand your issue.What did you do before the bug happened? (Steps to reproduce your issue)
I'm poking around with partial clone. On my local server on my computer I have full clone of Git (git.git) repo.
I do partial clone from that server as remote (which is actually on the same computer):
git clone https://my-local-server.git/myself/git.git --filter=blob:none
Inside the partial clone, I tried to convert it to full clone. First, I gather list of missing objects:
Quoted 7 lines
git rev-list --objects --all --missing=print | grep -oP '^\?\K\w+' >
.git/missing.listThen I fetched those:
git fetch origin $(cat .git/missing.list)
That command will build a very very long command line and cause the shell to complain. Instead, try passing the list of objects via stdin.
$ cat .git/missing.list | git fetch --stdin origin
Quoted 39 lines
What did you expect to happen? (Expected behavior)
All missing objects fetched successfully
What happened instead? (Actual behavior)
Git returned:
-bash:
/opt/git/bin/git: Argument list too longWhat's different between what you expected and what actually happened?
(nothing)
Anything else you want to add:
I think the problem lies on how to feed list of 110K+ objects to
git fetch.Note: Both the local server and the computer use Git 2.30.1
Please review the rest of the bug report below.
You can delete any lines you don't wish to share.[System Info]
git version:
git version 2.30.1
cpu:x86_64
built from commit:773e25afc41b1b6533fa9ae2cd825d0b4a697fad
sizeof-long: 8
sizeof-size_t: 8
shell-path:/bin/sh
uname: Linux 5.10.11-kernelorg-upstream-generic #1 SMP Fri Jan 29 12:56:19 WIB 2021x86_64compiler info: gnuc: 9.3
libc info: glibc: 2.31
$SHELL (typically, interactive shell):/bin/bash[Enabled Hooks]
(none)
Quoted 14 lines · Bagas Sanjaya
Thank you for filling out a Git bug report!
Please answer the following questions to help us understand your issue.What did you do before the bug happened? (Steps to reproduce your issue)
I'm poking around with partial clone. On my local server on my computer I have full clone of Git (git.git) repo.
I do partial clone from that server as remote (which is actually on the same computer):
git clone https://my-local-server.git/myself/git.git --filter=blob:none
Quoted 8 lines
Inside the partial clone, I tried to convert it to full clone. First, I gather list of missing objects:
git rev-list --objects --all --missing=print | grep -oP '^\?\K\w+' > .git/missing.listThen I fetched those:
git fetch origin $(cat .git/missing.list)
Since you're on Git 2.30, instead of trying to place all the object IDs on the git fetch command line, have you tried adding --stdin and having it read from your missing.list directly? Something like git fetch --stdin origin <.git/missing.list might do what you need.
Quoted 42 lines
What did you expect to happen? (Expected behavior)
All missing objects fetched successfully
What happened instead? (Actual behavior)
Git returned:
-bash:
/opt/git/bin/git: Argument list too longWhat's different between what you expected and what actually happened?
(nothing)
Anything else you want to add:
I think the problem lies on how to feed list of 110K+ objects to
git fetch.Note: Both the local server and the computer use Git 2.30.1
Please review the rest of the bug report below.
You can delete any lines you don't wish to share.[System Info]
git version:
git version 2.30.1
cpu:x86_64
built from commit:773e25afc41b1b6533fa9ae2cd825d0b4a697fad
sizeof-long: 8
sizeof-size_t: 8
shell-path:/bin/sh
uname: Linux 5.10.11-kernelorg-upstream-generic #1 SMP Fri Jan 29 12:56:19 WIB 2021x86_64compiler info: gnuc: 9.3
libc info: glibc: 2.31
$SHELL (typically, interactive shell):/bin/bash[Enabled Hooks]
(none)--
An old man doll... just what I always wanted! - Clara
After trying your suggestion, I now get:
error: RPC failed; HTTP 413 curl 22 The requested URL returned error: 413
fatal: unable to write request to remote: Broken pipe
Quoted 71 lines · Bryan Turner
Quoted 14 lines · Bagas Sanjaya
Thank you for filling out a Git bug report!
Please answer the following questions to help us understand your issue.What did you do before the bug happened? (Steps to reproduce your issue)
I'm poking around with partial clone. On my local server on my computer I have full clone of Git (git.git) repo.
I do partial clone from that server as remote (which is actually on the same computer):
git clone https://my-local-server.git/myself/git.git --filter=blob:noneQuoted 8 lines
Inside the partial clone, I tried to convert it to full clone. First, I gather list of missing objects:
git rev-list --objects --all --missing=print | grep -oP '^\?\K\w+' > .git/missing.listThen I fetched those:
git fetch origin $(cat .git/missing.list)Since you're on Git 2.30, instead of trying to place all the object IDs on the
git fetchcommand line, have you tried adding--stdinand having it read from yourmissing.listdirectly? Something likegit fetch --stdin origin <.git/missing.listmight do what you need.Quoted 42 lines
What did you expect to happen? (Expected behavior)
All missing objects fetched successfully
What happened instead? (Actual behavior)
Git returned:
-bash:
/opt/git/bin/git: Argument list too longWhat's different between what you expected and what actually happened?
(nothing)
Anything else you want to add:
I think the problem lies on how to feed list of 110K+ objects to
git fetch.Note: Both the local server and the computer use Git 2.30.1
Please review the rest of the bug report below.
You can delete any lines you don't wish to share.[System Info]
git version:
git version 2.30.1
cpu:x86_64
built from commit:773e25afc41b1b6533fa9ae2cd825d0b4a697fad
sizeof-long: 8
sizeof-size_t: 8
shell-path:/bin/sh
uname: Linux 5.10.11-kernelorg-upstream-generic #1 SMP Fri Jan 29 12:56:19 WIB 2021x86_64compiler info: gnuc: 9.3
libc info: glibc: 2.31
$SHELL (typically, interactive shell):/bin/bash[Enabled Hooks]
(none)--
An old man doll... just what I always wanted! - Clara
Signature · 1 line
An old man doll... just what I always wanted! - Clara
[Note: we generally prefer inline responses.]
Quoted 4 lines · Bagas Sanjaya
After trying your suggestion, I now get:
error: RPC failed; HTTP 413 curl 22 The requested URL returned error: 413
fatal: unable to write request to remote: Broken pipe
Hmmm, this means that your local Git server is unhappy with the size of the request. That means your request is probably very large, and it's likely that it is kindly asking you not to DoS it.
Quoted 7 lines · Bryan Turner
Quoted 6 lines · Bagas Sanjaya
Quoted 5 lines
Inside the partial clone, I tried to convert it to full clone. First, I gather list of missing objects:
git rev-list --objects --all --missing=print | grep -oP '^\?\K\w+' > .git/missing.list
Quoted 8 lines
Quoted 8 lines
Quoted 3 lines
Then I fetched those:
git fetch origin $(cat .git/missing.list)Since you're on Git 2.30, instead of trying to place all the object IDs on the
git fetchcommand line, have you tried adding--stdinand having it read from yourmissing.listdirectly? Something likegit fetch --stdin origin <.git/missing.listmight do what you need.
You may want to try this:
xargs git fetch origin < .git/missing.list
That will batch the requests to fit on the command line, which will probably also have the pleasant side effect that it makes each individual request smaller to avoid the 413.
Signature · 2 lines
brian m. carlson (he/him or they/them) Houston, Texas, US