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

[BUG] Git clone of a bundle fails, but works (somewhat) when run with strace

From
AKAlain Kalker <a.c.kalker@gmail.com>
Date
Feb 15, 2013, 19:33 UTC
Message-ID
<511E8D84.6060601@gmail.com>
tl;dr:
- `git bundle create` without <git-rev-list-args> gives git rev-list 
help, then dies.
   Should point out missing <git-rev-list-args> instead.
- `git clone <bundle> <dir> gives "ERROR: Repository not found."
- `strace ... git clone <bundle> <dir>` (magically) appears to work but
   cannot checkout files b/c of nonexistent ref.
- Heisenbug? Race condition?
- Zaphod Beeblebrox has left the building, sulking.
Full description:

When I try to clone from a bundle created from a local repository, `git clone <bundle> <dir>` fails with: "ERROR: Repository not found. fatal: Could not read from remote repository." unless I run it with strace.

OS: Arch Linux (rolling release)
Git versions: 1.8.1.3 and git://github.com/git.git master@02339dd
Steps to reproduce:
$ # Clone the Linux kernel repository
$ git clone git://github.com/torvalds/linux.git
Cloning into 'linux'...
remote: Counting objects: 2841147, done.
remote: Compressing objects: 100% (670736/670736), done.
remote: Total 2841147 (delta 2308339), reused 2657487 (delta 2143012)
Receiving objects: 100% (2841147/2841147), 797.62 MiB | 2.59 MiB/s, done.
Resolving deltas: 100% (2308339/2308339), done.
Checking out files: 100% (41521/41521), done.
$ cd linux
$ git branch -av
* master                323a72d Merge 
git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
   remotes/origin/HEAD   -> origin/master
   remotes/origin/master 323a72d Merge 
git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
$ # Try to create a bundle
$ git bundle create ../linux.bundle
usage: git rev-list [OPTION] <commit-id>... [ -- paths... ]
   limiting output:
     --max-count=<n>
     --max-age=<epoch>
     --min-age=<epoch>
     --sparse
     --no-merges
     --min-parents=<n>
     --no-min-parents
     --max-parents=<n>
     --no-max-parents
     --remove-empty
     --all
     --branches
     --tags
     --remotes
     --stdin
     --quiet
   ordering output:
     --topo-order
     --date-order
     --reverse
   formatting output:
     --parents
     --children
     --objects | --objects-edge
     --unpacked
     --header | --pretty
     --abbrev=<n> | --no-abbrev
     --abbrev-commit
     --left-right
   special purpose:
     --bisect
     --bisect-vars
     --bisect-all
error: rev-list died
$ # IMHO the error should refer to the usage of `git bundle` with a 
proper basis, not `git rev-list`.
$ # Also nothing should die loudly because of a missing parameter.
$ git bundle create ../linux.bundle master
Counting objects: 2836191, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (505627/505627), done.
Writing objects: 100% (2836191/2836191), 796.59 MiB | 16.23 MiB/s, done.
Total 2836191 (delta 2304454), reused 2834391 (delta 2303193)
$ # Try to clone a new repository from the bundle
$ cd ..
$ git clone linux.bundle linuxfrombundle
Cloning into 'linuxfrombundle'...
ERROR: Repository not found.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
$ git clone linux.bundle -b master linuxfrombundle
Cloning into 'linuxfrombundle'...
ERROR: Repository not found.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists.

# Try again using strace $ # (Replace /dev/null with a filename if you really want to try and debug this, or if you just want to torture your hard drive ;) ) $ strace -o /dev/null git clone linux.bundle linuxfrombundle Cloning into 'linuxfrombundle'... Receiving objects: 100% (2836191/2836191), 796.59 MiB | 24.64 MiB/s, done. Resolving deltas: 100% (2304454/2304454), done. warning: remote HEAD refers to nonexistent ref, unable to checkout.

$ # Let's have a look at what we cloned
$ cd linuxfrombundle
$ ls
$ git branch -av
   remotes/origin/master 323a72d Merge 
git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
$ git checkout master
Checking out files: 100% (41521/41521), done.
Branch master set up to track remote branch master from origin.
Already on 'master'
$ git branch -av
* master                323a72d Merge 
git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
   remotes/origin/master 323a72d Merge 
git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
$ # Where's my HEAD?
Kind regards,
Alain Kalker
Next: Alain Kalker
Message 1 of 9 in “[BUG] Git clone of a bundle fails, but works (somewhat) when run with strace”
  1. Alain KalkerFeb 15, 2013
  2. Alain KalkerFeb 15, 2013
  3. Alain KalkerFeb 16, 2013
  4. Junio C HamanoFeb 16, 2013
  5. Jeff KingFeb 16, 2013
  6. Alain KalkerFeb 17, 2013
  7. Philip OakleyFeb 17, 2013
  8. Junio C HamanoFeb 25, 2013
  9. Bram GeronMay 28, 2014

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.