summaryrefslogtreecommitdiffstats
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:09:17 +0100
commitb0079ec5e9c76c47b145cebf4a33aee767609c9b (patch)
tree845a01d34f519b0710e7a5b07cb89b24bd668793 /scripts/combo-layer
parentd1a1dbb8a5e761d4ed38b9840fd09c1494d11e7b (diff)
downloadpoky-b0079ec5e9c76c47b145cebf4a33aee767609c9b.tar.gz
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. (From OE-Core rev: c908a423f85a84ddd8249abd00254f29d47df74b) Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
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):
586 ldir = repo['local_repo_dir'] 586 ldir = repo['local_repo_dir']
587 branch = repo.get('branch', "master") 587 branch = repo.get('branch', "master")
588 runcmd("git checkout %s" % branch, ldir) 588 runcmd("git checkout %s" % branch, ldir)
589 logger.info("git pull for component repo %s in %s ..." % (name, ldir)) 589 logger.info("update component repo %s in %s ..." % (name, ldir))
590 output=runcmd("git pull --ff-only", ldir) 590 if not args.hard_reset:
591 logger.info(output) 591 output=runcmd("git pull --ff-only", ldir)
592 logger.info(output)
593 else:
594 output=runcmd("git fetch", ldir)
595 logger.info(output)
596 runcmd("git reset --hard FETCH_HEAD", ldir)
592 597
593def action_update(conf, args): 598def action_update(conf, args):
594 """ 599 """
@@ -895,6 +900,10 @@ Action:
895 parser.add_option("-n", "--no-pull", help = "skip pulling component repos during update", 900 parser.add_option("-n", "--no-pull", help = "skip pulling component repos during update",
896 action = "store_true", dest = "nopull", default = False) 901 action = "store_true", dest = "nopull", default = False)
897 902
903 parser.add_option("--hard-reset",
904 help = "instead of pull do fetch and hard-reset in component repos",
905 action = "store_true", default = False)
906
898 parser.add_option("-H", "--history", help = "import full history of components during init", 907 parser.add_option("-H", "--history", help = "import full history of components during init",
899 action = "store_true", default = False) 908 action = "store_true", default = False)
900 909