[yocto] [yocto-kernel-tools][PATCH 1/1] scc: Move merge command

David Vincent freesilicon at gmail.com
Wed Jan 25 02:37:59 PST 2017


Create a new command to merge a feature branch inside the current branch
when processing meta-series.

Signed-off-by: David Vincent <freesilicon at gmail.com>
---
 tools/kgit-meta          | 14 ++++++++++++++
 tools/scc                | 13 -------------
 tools/scc-cmds/merge.cmd | 10 ++++++++++
 3 files changed, 24 insertions(+), 13 deletions(-)
 create mode 100644 tools/scc-cmds/merge.cmd

diff --git a/tools/kgit-meta b/tools/kgit-meta
index 1c19ef5..aa5e210 100755
--- a/tools/kgit-meta
+++ b/tools/kgit-meta
@@ -254,6 +254,20 @@ for fline in `cat ${meta_series}`; do
                 fi
             fi
             ;;
+        merge:*)
+            b=$(echo ${fline} | cut -d: -f2 | sed 's%^\ %%')
+            check_branch ${b}
+            if [ $? -ne 0 ]; then
+                echo "ERROR. branch ${b} does not exist, can't merge"
+                exit 1
+            else
+                echo "[INFO]: branch merge: ${b}"
+                eval git merge -q --no-ff -m \"Merge branch ${b}\" ${b}
+                if [ $? -ne 0 ]; then
+                exit 1
+                fi
+            fi
+            ;;
         *)
             ;;
     esac
diff --git a/tools/scc b/tools/scc
index 3d17496..cee9e0d 100755
--- a/tools/scc
+++ b/tools/scc
@@ -286,19 +286,6 @@ set_kernel_version()
     KERNEL_VERSION=$1
 }
 
-# Used in feature scripts
-#  - convenience wrapper for "git merge" 
-#  - arguments are git merge <args> and are passed directly to git
-merge()
-{
-    args="$@"
-
-    # call the git wrapper function. Currently with no modification or
-    # checking on the args, but the option of checking in the future is
-    # trivial once users have converted.
-    git merge $args
-}
-
 # used in feature scripts
 #  - encodes a generic git command
 git()
diff --git a/tools/scc-cmds/merge.cmd b/tools/scc-cmds/merge.cmd
new file mode 100644
index 0000000..02be6ca
--- /dev/null
+++ b/tools/scc-cmds/merge.cmd
@@ -0,0 +1,10 @@
+# used in feature scripts
+#    arg1: the branch name
+merge()
+{
+    local text
+    local mbranch_name=$1
+
+    text="merge: ${mbranch_name}"
+    eval echo "\$text" $outfile_append
+}
-- 
2.11.0




More information about the yocto mailing list