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

[BUG] Submodules problem with subdirectories and pushing

From
Frank Lichtenheld <frank@lichtenheld.de>
Date
Aug 13, 2009, 10:32 UTC
Message-ID
<20090813103231.GY14475@mail-vs.djpig.de>
Hi.

I have a git repository where I include several submodules. This seemed to work fine until the server I push to got (finally) updated from 1.5.something to 1.6.4. Now I get an error if I try to push.

The issue is easily reproducible with a minimal repository for me:
Creating an empty repository on server:

flichtenheld@git-test:~$ git version git version 1.6.4 <---- Directly compiled from git flichtenheld@git-test:~$ mkdir test.git flichtenheld@git-test:~$ cd test.git/ flichtenheld@git-test:~/test.git$ git init --bare Initialized empty Git repository in /home/flichtenheld/test.git/

Creating repository on client:

frl@dhcp-rnd-054:~/tmp$ git version git version 1.6.3.3 <--- From Debian Package frl@dhcp-rnd-054:~/tmp$ mkdir test frl@dhcp-rnd-054:~/tmp$ cd test/ frl@dhcp-rnd-054:~/tmp/test$ git init Initialized empty Git repository in /home/frl/tmp/test/.git/

Add a random submodule:
frl@dhcp-rnd-054:~/tmp/test$ git submodule add git://repo.or.cz/git-browser.git subdir/git-browser
Initialized empty Git repository in /home/frl/tmp/test/subdir/git-browser/.git/
remote: Counting objects: 131, done.
remote: Compressing objects: 100% (67/67), done.
remote: Total 131 (delta 63), reused 131 (delta 63)
Receiving objects: 100% (131/131), 105.98 KiB, done.
Resolving deltas: 100% (63/63), done.
frl@dhcp-rnd-054:~/tmp/test$ git commit -a
[master (root-commit) 388b975] Add submodule
 2 files changed, 4 insertions(+), 0 deletions(-)
 create mode 100644 .gitmodules
 create mode 160000 subdir/git-browser
Try to push:
frl@dhcp-rnd-054:~/tmp/test$ git remote add origin ssh://gitadm/home/flichtenheld/test.git
frl@dhcp-rnd-054:~/tmp/test$ git push origin master
Counting objects: 4, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (4/4), 372 bytes, done.
Total 4 (delta 0), reused 0 (delta 0)
fatal: Error on reachable objects of 9664402120f411181d05a2f51ee06a475fb73d9b
error: unpack-objects exited with error code 128
error: unpack failed: unpack-objects abnormal exit
To ssh://gitadm/home/flichtenheld/test.git
 ! [remote rejected] master -> master (n/a (unpacker error))
error: failed to push some refs to 'ssh://gitadm/home/flichtenheld/test.git'
frl@dhcp-rnd-054:~/tmp/test$ git show 9664402120f411181d05a2f51ee06a475fb73d9b
tree 9664402120f411181d05a2f51ee06a475fb73d9b
git-browser
All seems to work fine if I add the submodule as git-browser instead of as subdir/git-browser.
Gruesse,
-- 
Frank Lichtenheld <frank@lichtenheld.de>
www: http://www.djpig.de/
Next: Frank Lichtenheld
Message 1 of 9 in “[BUG] Submodules problem with subdirectories and pushing”
  1. Frank LichtenheldAug 13, 2009
  2. Frank LichtenheldAug 13, 2009
  3. Fix "unpack-objects --strict"Junio C Hamano, Aug 13, 2009
  4. Martin KoeglerAug 14, 2009
  5. Junio C HamanoAug 14, 2009
  6. Martin KoeglerAug 14, 2009
  7. Junio C HamanoAug 14, 2009
  8. Junio C HamanoAug 14, 2009
  9. Frank LichtenheldAug 14, 2009

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.