liaog / git-repo

Automatically exported from code.google.com/p/git-repo
Apache License 2.0
0 stars 0 forks source link

A project with a path inside another project should be excluded from the containing project #107

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Affected Version:
$ repo --version
repo version v1.7.8.2
       (from https://android.googlesource.com/tools/repo)
repo launcher version 1.14
       (from /home/wt/bin/repo)
git version 1.7.0.4
Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41) 
[GCC 4.4.3]

Environment:
I don't think there's anything special in my environment.

What steps will reproduce the problem?
1. Create manifest:
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
    <remote fetch="ssh://git@example.com/repo-path" name="repo"/>

    <default remote="repo" revision="master"/>

    <project name="containing_project" path="containing_project"/>
    <project name="subproject" path="containing_project/subproject"/>
</manifest>
and check it into a git repo. Create other repos so that they exist.
2. Repo init from the manifest.
3. cd containing_project
4. git status

What is the expected output? What do you see instead?
The git status should not contain the subproject directory, but it does.

Please provide any additional information below.
I think that the containing_project should ultimately have the config option 
core.excludesfile set to .git/info/exlcude_repo so that it automatically will 
ignore the subdirectory.

The way I see it there are a few cases that need to be handled.
1) both containing_project and subproject are newly added
2) containing_project already exists and subproject newly added
3) containing_project newly add and subproject already exists
4) both already exist
5) both exist and subproject removed
6) both exist and containing_project removed

Case 1:
Clone containing_project and set core.excludesfile to .git/info/exlcude_repo. 
Add subproject dir to .git/info/exlcude_repo. Clone subproject.

Case 2:
In containing_project, add .git/info/exlcude_repo to core.excludesfile if it 
doesn't already contain that file. Add subproject dir to 
.git/info/exlcude_repo. Clone subproject.

Case 3:
Clone containing_project and set core.excludesfile to .git/info/exlcude_repo. 
Add subproject dir to .git/info/exlcude_repo.

Case 4:
Do nothing.

Case 5:
in containing_project, remove .git/info/exlcude_repo from core.excludesfile.

Case 6:
Remove containing_project without destroying subproject.

I think that all the cases other than case 6 will be relatively easy. Case 6 is 
special in that repo currently doesn't do what I would expect when removing 
only the containing project.

Original issue reported on code.google.com by w...@ooyala.com on 13 Feb 2012 at 7:17

GoogleCodeExporter commented 9 years ago
By "relatively easy", I meant compared to case 6. I don't know how hard it will 
be to implement cases 1-5. I didn't mean to make it sound like I think it'll be 
super easy. :)

Original comment by w...@ooyala.com on 13 Feb 2012 at 7:35