git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git clone fails intermittently if source repo is updated

From
Per Cederqvist <cederp@opera.com>
Date
Apr 18, 2012, 08:37 UTC
Message-ID
<4F8E7D30.2010906@opera.com>
In-Reply-To
<87vckyldrj.fsf@opera.com>
On 04/17/2012 02:54 PM, Per Cederqvist wrote:
Show 19 quoted lines
> Running "git clone master.git copy" sometimes fails if changes are being
> pushed to master.git.  Likewise, running "git clone mirror.git copy"
> sometimes fails if the mirror is currently fetching changes from
> master.git.
>
> In git 1.7.9 I sometimes get one of two fatal error messages.  In one of
> the cases, git still exits with exit code 0, but the working directory
> of "copy" is not updated with the proper files.  (See below for the
> exact error messages.)
>
> In git 1.7.10 the mirror sometimes ends up in "detached HEAD" state.
> Sometimes it prints a warning message.  (See below for the messages.)
>
> The following shell scripts can reproduce the problem.  I've been using
> a 4-core CPU on Ubuntu 11.04.  I've compiled Git from source.
>
> The first script, test-git-setup.sh, creates the directory "test-git"
> and three git repositories in it: master.git, mirror.git, and committer:
>
 > [...four shellscripts omitted...]

For your convenience, I have now set up a Git repository where you can get slightly updated versions of the above scripts. The Gitorious web page is here:

http://git.lysator.liu.se/ceder/git-clone-fail-demo
You can clone it like this:
git clone git://git.lysator.liu.se/ceder/git-clone-fail-demo.git

I have been able to reproduce the problem on Git 1.6.0 as well, so this is apparently not a recent regression.

The problem can also be reproduces when you clone, push and fetch via ssh, but it happens a lot less frequently then. See the README file in the git-clone-fail-demo repository for info on how to reproduce it.

> [...]
>
>      /ceder
     /ceder
Previous: Per Cederqvist
Message 2 of 2 in “git clone fails intermittently if source repo is updated”
  1. Per CederqvistApr 17, 2012
  2. Per CederqvistApr 18, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.