[Libreoffice-commits] dev-tools.git: scripts/git-cherry-gerrit

Miklos Vajna (via logerrit) logerrit at kemper.freedesktop.org
Tue Jul 30 08:30:37 UTC 2019


 scripts/git-cherry-gerrit |   13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

New commits:
commit 2a2a76d9e19bdadf0518e9223244faf0c0e81d6e
Author:     Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Tue Jul 30 10:28:12 2019 +0200
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Tue Jul 30 10:30:17 2019 +0200

    git-cherry-gerrit: add support for an optional whitelist file
    
    So that in case a change-id is missing and it was reviewed once, no need
    to do it again all the time.
    
    Change-Id: I29c28b71053b5b0dd4460b3ad66cfcb96936a17c

diff --git a/scripts/git-cherry-gerrit b/scripts/git-cherry-gerrit
index 0505383..8e1d9a1 100755
--- a/scripts/git-cherry-gerrit
+++ b/scripts/git-cherry-gerrit
@@ -13,8 +13,10 @@ cherry_to=${2}
 
 branch_point=${3}
 
+whitelist_file=${4}
+
 if [ -z "$cherry_from" ] ; then
-    echo "Usage: git-cherry-gerrit cherry_from cherry_to [branch_point_from]"
+    echo "Usage: git-cherry-gerrit cherry_from cherry_to [branch_point_from] [whitelist_file]"
     exit 1;
 fi
 
@@ -37,12 +39,17 @@ do
         changeid="$(git cat-file commit $hash |grep Change-Id:)"
         if [ -z "$changeid" ]; then
             pretty=`git --no-pager log -1 --format='format:%h%x09%an%x09%s%x0a' $hash`
-            echo "WARNING: commit '$pretty' has no Change-Id, assuming it has to be cherry-picked."
+            if [ -z "${whitelist_file}" ] || ! grep -q "${pretty}" "${whitelist_file}"; then
+                echo "WARNING: commit '$pretty' has no Change-Id, assuming it has to be cherry-picked."
+            fi
             continue
         fi
 
         if ! grep -q "$changeid" /tmp/tohashes; then
-                git --no-pager log -1  --format='format:%h%x09%an%x09%s%x0a' $hash
+            pretty=`git --no-pager log -1 --format='format:%h%x09%an%x09%s%x0a' $hash`
+            if [ -z "${whitelist_file}" ] || ! grep -q "${pretty}" "${whitelist_file}"; then
+                git --no-pager log -1 --format='format:%h%x09%an%x09%s%x0a' $hash
+            fi
         fi
 done
 


More information about the Libreoffice-commits mailing list