Bug 5288 - git repositories with submodules does not work cloned repo is renamed or moved to another location
Summary: git repositories with submodules does not work cloned repo is renamed or move...
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: All Linux
Priority: Normal major
Target Milestone: ---
Assignee: Mageia Bug Squad
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-08 14:31 CEST by Mika Laitio
Modified: 2012-05-26 11:46 CEST (History)
2 users (show)

See Also:
Source RPM: git-1.7.9.3-1.mga2.src.rpm
CVE:
Status comment:


Attachments

Description Mika Laitio 2012-04-08 14:31:57 CEST
Description of problem:
If I have git dir ("repo_a" for example) with git submodule ("submodule_1 for example) installed and then move the repo dir to another location or rename
it (for example to "repo_a2") the git repo stop working.
The bug is fixed in git 1.7.10-rc3 and newers.

Git 1.7.8 or 1.7.9 introduced a new way of handling git submodules in a way that submodule data is stored in repo_a/.git/modules/submodule_a dir
instead of storing it in repo_a/submodule_a/.git dir like earlier.
Unfortunately those first versions used fullpath for pointing to submodules
in the config files. (for example worktree variable in files like repo_a/.git/modules/submodue_a/config)

This bug is fixed in git-1.7.10-rc3 with following notion:

 * The whole directory that houses a top-level superproject managed by
   "git submodule" can be moved to another place. 

I have myself verified the fix by updating the git.spec and sources from git-1.7.9.3-1.mga2.src.rpm to 1.7.10-rc4 and then rebuilding and installing this 1.7.10-rc4 git version.

Version-Release number of selected component (if applicable):
1.7.9

How reproducible:
Always, fixed in git versions 1.7.10-rc3 and newer.

Steps to Reproduce:
1.mkdir submodule_1
2. mkdir repo_a
2.cd submodule_1
3.git init
4. cd ../repo_a
5. git init
6. git submodule add ../submodule_1
7. cd ..
8. mv repo_a repo_aa
9. cd repo_aa/submodule_1
10. git status
fatal: Could not switch to '/home/lamikr/gittest/repo_a/.git/modules': No such file or directory

--> This happens because path points still to repo_a which has been renamed to repo_aa.

cat /home/lamikr/gittest/repo_aa/.git/modules/submodule_1/config
[core]
	repositoryformatversion = 0
	filemode = true
	bare = false
	logallrefupdates = true
	worktree = /home/lamikr/gittest/repo_a/.git/modules/submodule_1
Comment 1 Thomas Backlund 2012-04-08 15:14:54 CEST

1.7.10 pushed to Cauldron

Status: NEW => RESOLVED
CC: (none) => tmb
Resolution: (none) => FIXED

Comment 2 Mika Laitio 2012-04-09 08:15:31 CEST
I verified that the bug is now fixed with 1.7.10 rpms.

Status: RESOLVED => VERIFIED

Comment 3 Marja Van Waes 2012-05-26 11:46:31 CEST
(In reply to comment #2)
> I verified that the bug is now fixed with 1.7.10 rpms.

Thanks for the feed back.

In our Bugzilla the "VERIFIED" status means it is a bug for which the fix didn't get pushed yet, so it appears in the list of existing bugs.

So setting to "RESOLVED" again

Status: VERIFIED => RESOLVED
CC: (none) => marja11


Note You need to log in before you can comment on or make changes to this bug.