Browse Source

RepoCommand: record remote branch, group, shallow bit by default

Propagating more information from the manifest to the superproject
tends to work out well.  These particular settings mean:

Recording the remote branch in .gitmodules allows
- "git submodule update --remote" to fetch the right branch
- Gerrit's submodule subscription feature to subscribe from the
  right branch, if requested

Recording groups in .gitattributes allows commands like "git clone
--recurse-submodules=:(attr:platform-linux) $superproject" to clone
the correct set of projects.

Recording the shallow bit in .gitmodules means that "git clone
--recurse-submodules" will use shallow clone in submodules where that
was requested in the manifest.

Gerrit's supermanifest plugin records the remote branch and shallow
bit by default already, and most users of that plugin configure it to
record groups in .gitattributes as well, so for most users this will
be a no-op.

Change-Id: Id2ed47cbca5ce822bde517494673c86ab8c58da9
Signed-off-by: Jonathan Nieder <jrn@google.com>
stable-5.1
Jonathan Nieder 6 years ago
parent
commit
fb9031c956
  1. 6
      org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoCommand.java

6
org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoCommand.java

@ -115,9 +115,9 @@ public class RepoCommand extends GitCommand<RevCommit> {
private String groupsParam;
private String branch;
private String targetBranch = Constants.HEAD;
private boolean recordRemoteBranch = false;
private boolean recordSubmoduleLabels = false;
private boolean recordShallowSubmodules = false;
private boolean recordRemoteBranch = true;
private boolean recordSubmoduleLabels = true;
private boolean recordShallowSubmodules = true;
private PersonIdent author;
private RemoteReader callback;
private InputStream inputStream;

Loading…
Cancel
Save