Go to file
Che-Liang Chiou 69998b0c6f Represent git-submodule as nested projects
We need a representation of git-submodule in repo; otherwise repo will
not sync submodules, and leave workspace in a broken state.  Of course
this will not be a problem if all projects are owned by the owner of the
manifest file, who may simply choose not to use git-submodule in all
projects.  However, this is not possible in practice because manifest
file owner is unlikely to own all upstream projects.

As git submodules are simply git repositories, it is natural to treat
them as plain repo projects that live inside a repo project.  That is,
we could use recursively declared projects to denote the is-submodule
relation of git repositories.

The behavior of repo remains the same to projects that do not have a
sub-project within.  As for parent projects, repo fetches them and their
sub-projects as normal projects, and then checks out subprojects at the
commit specified in parent's commit object.  The sub-project is fetched
at a path relative to parent project's working directory; so the path
specified in manifest file should match that of .gitmodules file.

If a submodule is not registered in repo manifest, repo will derive its
properties from itself and its parent project, which might not always be
correct.  In such cases, the subproject is called a derived subproject.

To a user, a sub-project is merely a git-submodule; so all tips of
working with a git-submodule apply here, too.  For example, you should
not run `repo sync` in a parent repository if its submodule is dirty.

Change-Id: I541e9e2ac1a70304272dbe09724572aa1004eb5c
2012-10-23 16:08:58 -07:00
docs Represent git-submodule as nested projects 2012-10-23 16:08:58 -07:00
hooks Update commit-msg hook to version from Gerrit v2.5-rc0 2012-10-04 10:31:09 +02:00
subcmds Represent git-submodule as nested projects 2012-10-23 16:08:58 -07:00
tests Fix error parsing a non-existant configuration file 2009-07-02 16:12:57 -07:00
.gitignore .gitignore: add an entry for repopickles 2009-06-28 15:08:56 -07:00
.project Add PyDev project files to repo 2009-06-02 00:09:07 +02:00
.pydevproject Add PyDev project files to repo 2009-06-02 00:09:07 +02:00
color.py Coding style cleanup 2012-10-09 12:45:30 +02:00
command.py Represent git-submodule as nested projects 2012-10-23 16:08:58 -07:00
COPYING Initial Contribution 2008-10-21 07:00:00 -07:00
editor.py Fix for handling values of EDITOR which contain a space. 2010-08-06 17:05:04 -07:00
error.py More coding style cleanup 2012-10-22 12:30:14 +09:00
git_command.py Rename "dir" variables 2012-10-10 08:30:15 +02:00
git_config.py Coding style cleanup 2012-10-09 12:45:30 +02:00
git_refs.py Coding style cleanup 2012-10-09 12:45:30 +02:00
git_ssh Don't allow git fetch to start ControlMaster 2010-10-29 08:15:14 -07:00
main.py More coding style cleanup 2012-10-22 12:30:14 +09:00
manifest_xml.py Represent git-submodule as nested projects 2012-10-23 16:08:58 -07:00
pager.py Coding style cleanup 2012-10-09 12:45:30 +02:00
progress.py Support units in progress messages 2011-09-19 14:52:57 -07:00
project.py Represent git-submodule as nested projects 2012-10-23 16:08:58 -07:00
repo Rename "dir" variables 2012-10-10 08:30:15 +02:00
SUBMITTING_PATCHES Patches should be submitted to master, not maint 2012-08-21 14:06:10 +02:00
trace.py Fix repo --trace to show ref and config loads 2009-04-18 09:54:51 -07:00