[oe-commits] [openembedded-core] 28/32: create-pull-request: set subject automatically for cover latter

git at git.openembedded.org git at git.openembedded.org
Thu Aug 4 14:23:36 UTC 2016


rpurdie pushed a commit to branch master
in repository openembedded-core.

commit 162b80f8a4670befaf6ffd2c178671cf7370b767
Author: Robert Yang <liezhi.yang at windriver.com>
AuthorDate: Mon Apr 18 19:16:03 2016 -0700

    create-pull-request: set subject automatically for cover latter
    
    Set cover letter's subject automatically as the patch's subject when
    there is only one patch.
    
    [YOCTO #9410]
    
    Signed-off-by: Robert Yang <liezhi.yang at windriver.com>
    Signed-off-by: Ross Burton <ross.burton at intel.com>
---
 scripts/create-pull-request | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/scripts/create-pull-request b/scripts/create-pull-request
index 9ea28a1..3f30cf1 100755
--- a/scripts/create-pull-request
+++ b/scripts/create-pull-request
@@ -261,7 +261,13 @@ if [ -n "$BODY" ]; then
 	sed -i "/BLURB HERE/ d" "$CL"
 fi
 
-# If the user specified a subject, replace the SUBJECT token with it.
+# Set subject automatically if there is only one patch
+patch_cnt=`git log --pretty=oneline ${RELATIVE_TO}..${L_BRANCH} | wc -l`
+if [ -z "$SUBJECT" -a $patch_cnt -eq 1 ]; then
+    SUBJECT="`git log --format=%s ${RELATIVE_TO}..${L_BRANCH}`"
+fi
+
+# Replace the SUBJECT token with it.
 if [ -n "$SUBJECT" ]; then
 	sed -i -e "s/\*\*\* SUBJECT HERE \*\*\*/$SUBJECT/" "$CL"
 fi

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list