Go to file
Yestin Sun b292b98c3e Add remote alias support in manifest
The `alias` is an optional attribute in element `remote`. It can be
used to override attibute `name` to be set as the remote name in each
project's .git/config. Its value can be duplicated while attribute
`name` has to be unique across the manifest file. This helps each
project to be able to have same remote name which actually points
to different remote url.

It eases some automation scripts to be able to checkout/push to same
remote name but actually different remote url, like:

repo forall -c "git checkout -b work same_remote/work"
repo forall -c "git push same_remote work:work"

for example:
The manifest with 'alias' will look like:

<?xml version='1.0' encoding='UTF-8'?>
<manifest>
  <remote alias="same_alias" fetch="git://git.external1.org/" name="ext1"
      review="http://review.external1.org"/>
  <remote alias="same_alias" fetch="git://git.external2.org/" name="ext2"
      review="http://review.external2.org"/>
  <remote alias="same_alias" fetch="ssh://git.internal.com:29418" name="int"
      review="http://review.internal.com"/>
  <default remote="int" revision="int-branch" sync-j="2"/>
  <project name="path/to/project1" path="project1" remote="ext1"/>
  <project name="path/to/project2" path="project2" remote="ext2"/>
  <project name="path/to/project3" path="project3"/>
  ...
</manifest>

In each project, use command "git remote -v"

project1:
same_alias  git://git.external1.org/project1 (fetch)
same_alias  git://git.external1.org/project1 (push)

project2:
same_alias  git://git.external2.org/project2 (fetch)
same_alias  git://git.external2.org/project2 (push)

project3:
same_alias  ssh://git.internal.com:29418/project3 (fetch)
same_alias  ssh://git.internal.com:29418/project3 (push)

Change-Id: I2c48263097ff107f0c978f3e83966ae71d06cb90
2012-07-31 22:13:13 -07:00
docs Add remote alias support in manifest 2012-07-31 22:13:13 -07:00
hooks hooks/pre-auto-gc: look in sysfs to see if a battery is known. 2012-05-25 02:25:59 -07:00
subcmds Add "repo overview" command. 2012-07-31 22:08:32 -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 Add -p to repo forall to improve output formatting 2009-04-18 13:49:13 -07:00
command.py Treat groups= as default 2012-04-23 13:43:41 -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 Add manifest groups 2012-04-13 09:46:00 -07:00
git_command.py Single quote http.proxy in GIT_CONFIG_PARAMETERS 2012-06-13 10:42:16 -07:00
git_config.py Permit - in URL schemes for special URLs 2012-03-14 15:28:22 -07:00
git_refs.py Improve error handling when reading loose refs 2011-11-29 14:43:04 -08:00
git_ssh Don't allow git fetch to start ControlMaster 2010-10-29 08:15:14 -07:00
main.py Add support for Apache Digest authentication for repo init. 2012-03-14 15:01:34 -07:00
manifest_xml.py Add remote alias support in manifest 2012-07-31 22:13:13 -07:00
pager.py Don't start the pager if stdout is a pipe 2009-04-01 07:24:22 -07:00
progress.py Support units in progress messages 2011-09-19 14:52:57 -07:00
project.py upload: add --draft option. 2012-07-28 15:44:05 -07:00
repo Use gerrit.googlesource.com/git-repo as the default URL 2012-06-05 07:57:24 -07:00
SUBMITTING_PATCHES Update SUBMITTING_PATCHES 2012-02-28 18:54:33 -08:00
trace.py Fix repo --trace to show ref and config loads 2009-04-18 09:54:51 -07:00