From cdd7c23446a0030e5b521d91cbb2d3a9c522ccc2 Mon Sep 17 00:00:00 2001 From: Stefan Beller Date: Mon, 5 Oct 2015 16:01:11 -0700 Subject: RepoCommand: Add setRecordRemoteBranch option to record upstream branch On a server also running Gerrit that is using RepoCommand to convert from an XML manifest to a git submodule superproject periodically, it would be handy to be able to use Gerrit's submodule subscription feature[1] to update the superproject automatically between RepoCommand runs as changes are merged in each subprojects. This requires setting the 'branch' field for each submodule so that Gerrit knows what branch to watch. Add an option to do that. Setting the branch field also is useful for plain Git users, since it allows them to use "git submodule update --remote" to manually update all submodules between RepoCommand runs. [1] https://gerrit-review.googlesource.com/Documentation/user-submodules.html Change-Id: I1a10861bcd0df3b3673fc2d481c8129b2bdac5f9 Signed-off-by: Stefan Beller --- org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Repo.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'org.eclipse.jgit.pgm/src') diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Repo.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Repo.java index 9b191e6796..db88008e10 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Repo.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Repo.java @@ -58,12 +58,16 @@ class Repo extends TextBuiltin { @Argument(required = true, usage = "usage_pathToXml") private String path; + @Option(name = "--record-remote-branch", usage = "usage_branches") + private boolean branches; + @Override protected void run() throws Exception { new RepoCommand(db) .setURI(uri) .setPath(path) .setGroups(groups) + .setRecordRemoteBranch(branches) .call(); } } -- cgit v1.2.3