summaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorChe-Liang Chiou <clchiou@google.com>2012-01-11 11:28:42 +0800
committerChe-Liang Chiou <clchiou@google.com>2012-11-19 10:45:21 -0800
commitb2bd91c99b9435cf950ecf8efbb8439f31d3fcbc (patch)
tree5d26d3943317c11c1cd913fc5640074a5bc7910b /docs
parent3f5ea0b18207a81f58595b1a2e10e5ffb784b74f (diff)
downloadgit-repo-b2bd91c99b9435cf950ecf8efbb8439f31d3fcbc.tar.gz
Represent git-submodule as nested projects, take 2
(Previous submission of this change broke Android buildbot due to incorrect regular expression for parsing git-config output. During investigation, we also found that Android, which pulls Chromium, has a workaround for Chromium's submodules; its manifest includes Chromium's submodules. This new change, in addition to fixing the regex, also take this type of workarounds into consideration; it adds a new attribute that makes repo not fetch submodules unless submodules have a project element defined in the manifest, or this attribute is overridden by a parent project element or by the default element.) 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: I4b8344c1b9ccad2f58ad304573133e5d52e1faef
Diffstat (limited to 'docs')
-rw-r--r--docs/manifest-format.txt17
1 files changed, 14 insertions, 3 deletions
diff --git a/docs/manifest-format.txt b/docs/manifest-format.txt
index a54282c8..f6dba640 100644
--- a/docs/manifest-format.txt
+++ b/docs/manifest-format.txt
@@ -41,17 +41,20 @@ following DTD:
41 <!ATTLIST default revision CDATA #IMPLIED> 41 <!ATTLIST default revision CDATA #IMPLIED>
42 <!ATTLIST default sync-j CDATA #IMPLIED> 42 <!ATTLIST default sync-j CDATA #IMPLIED>
43 <!ATTLIST default sync-c CDATA #IMPLIED> 43 <!ATTLIST default sync-c CDATA #IMPLIED>
44 <!ATTLIST default sync-s CDATA #IMPLIED>
44 45
45 <!ELEMENT manifest-server (EMPTY)> 46 <!ELEMENT manifest-server (EMPTY)>
46 <!ATTLIST url CDATA #REQUIRED> 47 <!ATTLIST url CDATA #REQUIRED>
47 48
48 <!ELEMENT project (annotation?)> 49 <!ELEMENT project (annotation?,
50 project*)>
49 <!ATTLIST project name CDATA #REQUIRED> 51 <!ATTLIST project name CDATA #REQUIRED>
50 <!ATTLIST project path CDATA #IMPLIED> 52 <!ATTLIST project path CDATA #IMPLIED>
51 <!ATTLIST project remote IDREF #IMPLIED> 53 <!ATTLIST project remote IDREF #IMPLIED>
52 <!ATTLIST project revision CDATA #IMPLIED> 54 <!ATTLIST project revision CDATA #IMPLIED>
53 <!ATTLIST project groups CDATA #IMPLIED> 55 <!ATTLIST project groups CDATA #IMPLIED>
54 <!ATTLIST project sync-c CDATA #IMPLIED> 56 <!ATTLIST project sync-c CDATA #IMPLIED>
57 <!ATTLIST project sync-s CDATA #IMPLIED>
55 58
56 <!ELEMENT annotation (EMPTY)> 59 <!ELEMENT annotation (EMPTY)>
57 <!ATTLIST annotation name CDATA #REQUIRED> 60 <!ATTLIST annotation name CDATA #REQUIRED>
@@ -152,7 +155,10 @@ Element project
152 155
153One or more project elements may be specified. Each element 156One or more project elements may be specified. Each element
154describes a single Git repository to be cloned into the repo 157describes a single Git repository to be cloned into the repo
155client workspace. 158client workspace. You may specify Git-submodules by creating a
159nested project. Git-submodules will be automatically
160recognized and inherit their parent's attributes, but those
161may be overridden by an explicitly specified project element.
156 162
157Attribute `name`: A unique name for this project. The project's 163Attribute `name`: A unique name for this project. The project's
158name is appended onto its remote's fetch URL to generate the actual 164name is appended onto its remote's fetch URL to generate the actual
@@ -163,7 +169,8 @@ URL to configure the Git remote with. The URL gets formed as:
163where ${remote_fetch} is the remote's fetch attribute and 169where ${remote_fetch} is the remote's fetch attribute and
164${project_name} is the project's name attribute. The suffix ".git" 170${project_name} is the project's name attribute. The suffix ".git"
165is always appended as repo assumes the upstream is a forest of 171is always appended as repo assumes the upstream is a forest of
166bare Git repositories. 172bare Git repositories. If the project has a parent element, its
173name will be prefixed by the parent's.
167 174
168The project name must match the name Gerrit knows, if Gerrit is 175The project name must match the name Gerrit knows, if Gerrit is
169being used for code reviews. 176being used for code reviews.
@@ -171,6 +178,8 @@ being used for code reviews.
171Attribute `path`: An optional path relative to the top directory 178Attribute `path`: An optional path relative to the top directory
172of the repo client where the Git working directory for this project 179of the repo client where the Git working directory for this project
173should be placed. If not supplied the project name is used. 180should be placed. If not supplied the project name is used.
181If the project has a parent element, its path will be prefixed
182by the parent's.
174 183
175Attribute `remote`: Name of a previously defined remote element. 184Attribute `remote`: Name of a previously defined remote element.
176If not supplied the remote given by the default element is used. 185If not supplied the remote given by the default element is used.
@@ -190,6 +199,8 @@ its name:`name` and path:`path`. E.g. for
190definition is implicitly in the following manifest groups: 199definition is implicitly in the following manifest groups:
191default, name:monkeys, and path:barrel-of. If you place a project in the 200default, name:monkeys, and path:barrel-of. If you place a project in the
192group "notdefault", it will not be automatically downloaded by repo. 201group "notdefault", it will not be automatically downloaded by repo.
202If the project has a parent element, the `name` and `path` here
203are the prefixed ones.
193 204
194Element annotation 205Element annotation
195------------------ 206------------------