+9
Completed

Support for git-Repo. The multiple repository management tool built by google [SG-11200​]

Steven VanWerkhoven 8 years ago updated by cppLord 7 years ago 5

SmartGit should support git-repo. https://code.google.com/p/git-repo/

This is a multiple repository management tool built by google used by several large fortune 500 companies. It provides a easy way to sync a large number of repos (over 100 or more) to a specified commit tag that is specified in a manifest file, which is in it's own repo. This is how we are managing our software build where each project can contain hundreds of repos.

+1

A problem regarding repo tool and SmartGit is, that repo tool creates symlinks for some files from the .git dir to the .repo dir. After opening a repository using SmartGit the config symlink gets replaced with a regular file. This breaks the "repo sync" command, because repo verifies that the symlinks are still correct.


The following symlinks are created by repo tool:


anders05@ubuntu:~/Dev/build-puck$ ls -l sources/myrepo/.git/
lrwxrwxrwx 1 anders05 anders05    52 Sep 28 10:53 config -> ../../../.repo/projects/sources/myrepo.git/config
lrwxrwxrwx 1 anders05 anders05    56 Sep 28 10:53 description -> ../../../.repo/project-objects/myrepo.git/description
-rw-rw-r-- 1 anders05 anders05    41 Sep 28 10:53 HEAD
lrwxrwxrwx 1 anders05 anders05    50 Sep 28 10:53 hooks -> ../../../.repo/project-objects/myrepo.git/hooks
-rw-rw-r-- 1 anders05 anders05 28936 Sep 28 10:53 index
lrwxrwxrwx 1 anders05 anders05    49 Sep 28 10:53 info -> ../../../.repo/project-objects/myrepo.git/info
lrwxrwxrwx 1 anders05 anders05    50 Sep 28 10:53 logs -> ../../../.repo/projects/sources/myrepo.git/logs
lrwxrwxrwx 1 anders05 anders05    52 Sep 28 10:53 objects -> ../../../.repo/project-objects/myrepo.git/objects
lrwxrwxrwx 1 anders05 anders05    57 Sep 28 10:53 packed-refs -> ../../../.repo/projects/sources/myrepo.git/packed-refs
lrwxrwxrwx 1 anders05 anders05    50 Sep 28 10:53 refs -> ../../../.repo/projects/sources/myrepo.git/refs
lrwxrwxrwx 1 anders05 anders05    53 Sep 28 10:53 rr-cache -> ../../../.repo/project-objects/myrepo.git/rr-cache
lrwxrwxrwx 1 anders05 anders05    53 Sep 28 10:53 shallow -> ../../../.repo/projects/sources/myrepo.git/shallow
lrwxrwxrwx 1 anders05 anders05    48 Sep 28 10:53 svn -> ../../../.repo/project-objects/myrepo.git/svn

After opening the repository with SmartGit:


anders05@ubuntu:~/Dev/build-puck$ ls -l sources/myrepo/.git/                                                                                                                                                
-rw-rw-r-- 1 anders05 anders05   452 Sep 28 10:54 config
lrwxrwxrwx 1 anders05 anders05    55 Sep 28 10:53 description -> ../../../.repo/project-objects/myrepo.git/description
-rw-rw-r-- 1 anders05 anders05    41 Sep 28 10:53 HEAD
lrwxrwxrwx 1 anders05 anders05    49 Sep 28 10:53 hooks -> ../../../.repo/project-objects/myrepo.git/hooks
-rw-rw-r-- 1 anders05 anders05 28936 Sep 28 10:53 index
lrwxrwxrwx 1 anders05 anders05    48 Sep 28 10:53 info -> ../../../.repo/project-objects/myrepo.git/info
lrwxrwxrwx 1 anders05 anders05    49 Sep 28 10:53 logs -> ../../../.repo/projects/sources/myrepo.git/logs
lrwxrwxrwx 1 anders05 anders05    51 Sep 28 10:53 objects -> ../../../.repo/project-objects/myrepo.git/objects
lrwxrwxrwx 1 anders05 anders05    56 Sep 28 10:53 packed-refs -> ../../../.repo/projects/sources/myrepo.git/packed-refs
lrwxrwxrwx 1 anders05 anders05    49 Sep 28 10:53 refs -> ../../../.repo/projects/sources/myrepo.git/refs
lrwxrwxrwx 1 anders05 anders05    52 Sep 28 10:53 rr-cache -> ../../../.repo/project-objects/myrepo.git/rr-cache
lrwxrwxrwx 1 anders05 anders05    52 Sep 28 10:53 shallow -> ../../../.repo/projects/sources/myrepo.git/shallow
-rw-rw-r-- 1 anders05 anders05    25 Sep 28 10:54 smartgit.config
lrwxrwxrwx 1 anders05 anders05    47 Sep 28 10:53 svn -> ../../../.repo/project-objects/myrepo.git/svn

So a minimal fix for this should prevent SmartGit from replacing the config symlink with a regular file.

Yes, this is very annoying! Hope the SmartGit devs fix it asap.


Below is my experience using SmartGit v.17.1 on Ubuntu 16.04.3 LTS:


____________________________________________________

SmartGit expects a "real" .git/config file in each project (where it configures the tracking of the local branches for example).


But "repo sync" expects a symbolic link .git/config in each project and each link points to the real config file in .repo/projects/../config.


Starting the SmartGit client, it will automatically overwrite the symbolic link with a real config file.


Closing SmartGit and doing then a "repo sync" will cause the following error output:


error.GitError: --force-sync not enabled; cannot overwrite a local work tree. If

you're comfortable with the possibility of losing the work tree's git metadata,

use `repo sync --force-sync yourproject` to proceed.


Using "repo sync --force-sync" will recreate the symbolic link but starting SmartGit will again overwrite it with a real config file.

____________________________________________________


The symlink should be preserved in version 18.1.