summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Ohly <patrick.ohly@intel.com>2015-03-09 13:50:11 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-03-20 11:21:22 +0000
commit58c5bb28b525afb1ed1959305adee65ae7f5dba0 (patch)
tree90a087fa4153679d7c85a64f964fc32f1e6059b1
parentb1408ba706a9b3f597381078aa4d88d879635362 (diff)
downloadast2050-yocto-poky-58c5bb28b525afb1ed1959305adee65ae7f5dba0.zip
ast2050-yocto-poky-58c5bb28b525afb1ed1959305adee65ae7f5dba0.tar.gz
combo-layer: make Signed-off-by optional
It depends on the diligence of the person running the combo-layer tool whether the Signed-off-by line added to each commit actually indicates that the person was involved in validating the change. When the import is purely automatic, it is better to not add the line, because the history is more useful without it (searching for the person really only lists changes he or she was involved with) and it would be a false statement. The 'signoff' property can be set per repository, like every other property. But setting it in the special [DEFAULT] section is more useful, so that is what the example shows. (From OE-Core rev: dba34e5a6f0a4c726266654dc5f26e0f7f13db0f) Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rwxr-xr-xscripts/combo-layer7
-rw-r--r--scripts/combo-layer.conf.example10
2 files changed, 16 insertions, 1 deletions
diff --git a/scripts/combo-layer b/scripts/combo-layer
index 71fa7b1..62f2cf8 100755
--- a/scripts/combo-layer
+++ b/scripts/combo-layer
@@ -68,6 +68,11 @@ class Configuration(object):
if value.startswith("@"):
self.repos[repo][name] = eval(value.strip("@"))
else:
+ # Apply special type transformations for some properties.
+ # Type matches the RawConfigParser.get*() methods.
+ types = {'signoff': 'boolean'}
+ if name in types:
+ value = getattr(parser, 'get' + types[name])(section, name)
self.repos[repo][name] = value
logger.debug("Loading config file %s" % self.conffile)
@@ -482,7 +487,7 @@ def apply_patchlist(conf, repos):
if os.path.getsize(patchfile) == 0:
logger.info("(skipping %d/%d %s - no changes)" % (i, linecount, patchdisp))
else:
- cmd = "git am --keep-cr -s -p1 %s" % patchfile
+ cmd = "git am --keep-cr %s-p1 %s" % ('-s ' if repo.get('signoff', True) else '', patchfile)
logger.info("Applying %d/%d: %s" % (i, linecount, patchdisp))
try:
runcmd(cmd)
diff --git a/scripts/combo-layer.conf.example b/scripts/combo-layer.conf.example
index 010a692..427c1b3 100644
--- a/scripts/combo-layer.conf.example
+++ b/scripts/combo-layer.conf.example
@@ -1,7 +1,17 @@
# combo-layer example configuration file
+# Default values for all sections.
+[DEFAULT]
+
+# Add 'Signed-off-by' to all commits that get imported automatically.
+signoff = True
+
# component name
[bitbake]
+
+# Override signedoff default above (not very useful, but possible).
+signoff = False
+
# mandatory options
# git upstream uri
src_uri = git://git.openembedded.org/bitbake
OpenPOWER on IntegriCloud