From: Jonathan Nieder Date: Fri, 20 Jul 2018 07:48:22 +0000 (-0700) Subject: RepoCommand: record remote branch, group, shallow bit by default X-Git-Tag: v5.1.0.201808281540-m3~53 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=fb9031c9566308794f888695cafd108f19d835be;p=jgit.git 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 --- diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoCommand.java index 80fd3cf1a4..b3eee07fb6 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoCommand.java @@ -115,9 +115,9 @@ public class RepoCommand extends GitCommand { 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;