From: Jakub Narebski Date: Sun, 18 Mar 2012 16:36:24 GMT Subject: Re: Clone fails on a repo with too many heads/tags Message-ID: In-Reply-To: Ivan Todoroski writes: > I recently tried cloning a fresh copy of a large repo (converted from CVS, > nearly 10 years of history) and to my surprise "git clone" failed with the > following message: > > error: cannot spawn git: No such file or directory > > The problem is only reproduced using the Smart HTTP transport. [...] > I tracked down the problem to remote-curl.c:fetch_git(). That's where the > "fetch-pack" command line is being constructed with all the refs on one line: > > git fetch-pack --stateless-rpc --lock-pack ...... > > The solution is conceptually simple: if the list of refs results in a too long > command line, split the refs in batches and call fetch-pack multiple times such > that each call is under the cmdline limit: > > git fetch-pack --stateless-rpc --lock-pack ...... > git fetch-pack --stateless-rpc --lock-pack ...... > ... > git fetch-pack --stateless-rpc --lock-pack ...... That, or implement --stdin / --revs in git-fetch-pach (perhaps following git-pack-objects that implements --revs). -- Jakub Narebski