combo-layer pull changes
cover combo-layer pull changes
These patches are an effort to make combo-layer pull operation a bit more predictable. The first patch avoids unwanted merge commits in local component repositories by requiring fast-forward when pulling. The second patch adds a --hard-reset command line option to make sure that the local component repositories are always in sync with the remote.
The following changes since commit df6ddc4bf9795212fda87f9d401893eb254074da:
file: fix long-options (2015-07-07 23:57:14 +0100)
are available in the git repository at:
git://git.openembedded.org/openembedded-core-contrib marquiz/combo-layer
Markus Lehtonen (2):
combo-layer: only allow fast-forward when pulling
combo-layer: implement --hard-reset option
scripts/combo-layer | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-)
Signature · 1 line
2.1.4
PATCH 1/2 combo-layer: only allow fast-forward when pulling
Only allow fast-forward merges in the component repositories when doing git-pull. This makes it possible to spot problems (i.e. rewriting of history) in the component upstream . Also, this change prevents the creation of local-only merge commits in the component repositories. These merges cause "last_revision" field of the combo-layer config to point to a git commit that is only present in the users local component repository but nowhere in upstream.
--- scripts/combo-layer | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/combo-layer +1 -1
@@ -587,7 +587,7 @@ def action_pull(conf, args): 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", ldir) + output=runcmd("git pull --ff-only", ldir) logger.info(output) def action_update(conf, args):
Signature · 1 line
2.1.4
PATCH 2/2 combo-layer: implement --hard-reset option
In reply to Markus LehtonenThis 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.
--- scripts/combo-layer | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-)
scripts/combo-layer +12 -3
@@ -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)
Signature · 1 line
2.1.4
Quoted 11 lines · On Wednesday 08 July 2015 13:59:47 Markus Lehtonen wrote:
These patches are an effort to make combo-layer pull operation a bit more predictable. The first patch avoids unwanted merge commits in local component repositories by requiring fast-forward when pulling. The second patch adds a --hard-reset command line option to make sure that the local component repositories are always in sync with the remote.
The following changes since commit
df6ddc4bf9795212fda87f9d401893eb254074da:file: fix long-options (2015-07-07 23:57:14 +0100)
Quoted 8 lines
are available in the git repository at:
git://git.openembedded.org/openembedded-core-contribmarquiz/combo-layerMarkus Lehtonen (2):
combo-layer: only allow fast-forward when pulling
combo-layer: implement --hard-reset option
These look good.
Cheers,
Paul
Signature · 2 lines
Paul Eggleton Intel Open Source Technology Centre