summaryrefslogtreecommitdiff
path: root/scripts/combo-layer
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2015-07-08 13:59:49 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-07-16 15:08:41 +0100
commitc908a423f85a84ddd8249abd00254f29d47df74b (patch)
treeb053ed0362c4ea75575258d8cfeb008b5c5a1c7e /scripts/combo-layer
parent5207169b9c6c4b05c6b043745905a5498adca1a3 (diff)
downloadopenembedded-core-c908a423f85a84ddd8249abd00254f29d47df74b.tar.gz
openembedded-core-c908a423f85a84ddd8249abd00254f29d47df74b.tar.bz2
openembedded-core-c908a423f85a84ddd8249abd00254f29d47df74b.zip
combo-layer: implement --hard-reset option
This option causes combo-layer to do git fetch and hard reset instead of git pull in the component repositories. This makes sure that the local component repositories are always in sync with the remote - tolerating force pushes and overriding any locally made changes. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'scripts/combo-layer')
-rwxr-xr-xscripts/combo-layer15
1 files changed, 12 insertions, 3 deletions
diff --git a/scripts/combo-layer b/scripts/combo-layer
index 8637addc8e..6b0c56d37e 100755
--- a/scripts/combo-layer
+++ b/scripts/combo-layer
@@ -586,9 +586,14 @@ def action_pull(conf, args):
ldir = repo['local_repo_dir']
branch = repo.get('branch', "master")
runcmd("git checkout %s" % branch, ldir)
- logger.info("git pull for component repo %s in %s ..." % (name, ldir))
- output=runcmd("git pull --ff-only", ldir)
- logger.info(output)
+ logger.info("update component repo %s in %s ..." % (name, ldir))
+ if not args.hard_reset:
+ output=runcmd("git pull --ff-only", ldir)
+ logger.info(output)
+ else:
+ output=runcmd("git fetch", ldir)
+ logger.info(output)
+ runcmd("git reset --hard FETCH_HEAD", ldir)
def action_update(conf, args):
"""
@@ -895,6 +900,10 @@ Action:
parser.add_option("-n", "--no-pull", help = "skip pulling component repos during update",
action = "store_true", dest = "nopull", default = False)
+ parser.add_option("--hard-reset",
+ help = "instead of pull do fetch and hard-reset in component repos",
+ action = "store_true", default = False)
+
parser.add_option("-H", "--history", help = "import full history of components during init",
action = "store_true", default = False)