All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] combo-layer pull changes
@ 2015-07-08 10:59 Markus Lehtonen
  2015-07-08 10:59 ` [PATCH 1/2] combo-layer: only allow fast-forward when pulling Markus Lehtonen
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Markus Lehtonen @ 2015-07-08 10:59 UTC (permalink / raw)
  To: openembedded-core; +Cc: Paul Eggleton

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(-)

-- 
2.1.4



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] combo-layer: only allow fast-forward when pulling
  2015-07-08 10:59 [PATCH 0/2] combo-layer pull changes Markus Lehtonen
@ 2015-07-08 10:59 ` Markus Lehtonen
  2015-07-08 10:59 ` [PATCH 2/2] combo-layer: implement --hard-reset option Markus Lehtonen
  2015-07-15 13:15 ` [PATCH 0/2] combo-layer pull changes Paul Eggleton
  2 siblings, 0 replies; 4+ messages in thread
From: Markus Lehtonen @ 2015-07-08 10:59 UTC (permalink / raw)
  To: openembedded-core; +Cc: Paul Eggleton

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.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
---
 scripts/combo-layer | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/combo-layer b/scripts/combo-layer
index 2d100be..8637add 100755
--- a/scripts/combo-layer
+++ b/scripts/combo-layer
@@ -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):
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] combo-layer: implement --hard-reset option
  2015-07-08 10:59 [PATCH 0/2] combo-layer pull changes Markus Lehtonen
  2015-07-08 10:59 ` [PATCH 1/2] combo-layer: only allow fast-forward when pulling Markus Lehtonen
@ 2015-07-08 10:59 ` Markus Lehtonen
  2015-07-15 13:15 ` [PATCH 0/2] combo-layer pull changes Paul Eggleton
  2 siblings, 0 replies; 4+ messages in thread
From: Markus Lehtonen @ 2015-07-08 10:59 UTC (permalink / raw)
  To: openembedded-core; +Cc: Paul Eggleton

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>
---
 scripts/combo-layer | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/scripts/combo-layer b/scripts/combo-layer
index 8637add..6b0c56d 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)
 
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 0/2] combo-layer pull changes
  2015-07-08 10:59 [PATCH 0/2] combo-layer pull changes Markus Lehtonen
  2015-07-08 10:59 ` [PATCH 1/2] combo-layer: only allow fast-forward when pulling Markus Lehtonen
  2015-07-08 10:59 ` [PATCH 2/2] combo-layer: implement --hard-reset option Markus Lehtonen
@ 2015-07-15 13:15 ` Paul Eggleton
  2 siblings, 0 replies; 4+ messages in thread
From: Paul Eggleton @ 2015-07-15 13:15 UTC (permalink / raw)
  To: Markus Lehtonen; +Cc: openembedded-core

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)
> 
> 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

These look good.

Acked-by: Paul Eggleton <paul.eggleton@linux.intel.com>

Cheers,
Paul

-- 

Paul Eggleton
Intel Open Source Technology Centre


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-07-15 13:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-08 10:59 [PATCH 0/2] combo-layer pull changes Markus Lehtonen
2015-07-08 10:59 ` [PATCH 1/2] combo-layer: only allow fast-forward when pulling Markus Lehtonen
2015-07-08 10:59 ` [PATCH 2/2] combo-layer: implement --hard-reset option Markus Lehtonen
2015-07-15 13:15 ` [PATCH 0/2] combo-layer pull changes Paul Eggleton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.