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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Aug 13 14:16:13 UTC 2018


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

New commits:
commit 3ea30f4d618d1887d1457c64e26d8b25fdb03d5e
Author:     Miklos Vajna <vmiklos at collabora.co.uk>
AuthorDate: Mon Aug 13 16:12:26 2018 +0200
Commit:     Miklos Vajna <vmiklos at collabora.co.uk>
CommitDate: Mon Aug 13 16:15:55 2018 +0200

    git-cherry-gerrit: small fixes
    
    1) Take info from the local vendor branch, to avoid the need to push
    frequently.
    
    2) Call the remote 'logerrit', not 'origin' to be in sync with
    .gitreview.
    
    3) Warn when a commit has no change-id.
    
    Change-Id: I1896c8b5355cad442574ae5afc1affdba8c20654

diff --git a/scripts/git-cherry-gerrit b/scripts/git-cherry-gerrit
index 033ca33..98de663 100755
--- a/scripts/git-cherry-gerrit
+++ b/scripts/git-cherry-gerrit
@@ -15,16 +15,22 @@ old=${2}
 new=${3}
 
 : > /tmp/newchanges
-newhashes=$(git rev-list ${old}-branch-point..origin/distro/${vendor}/${new})
+newhashes=$(git rev-list ${old}-branch-point..distro/${vendor}/${new})
 for hash in ${newhashes}
 do
         git cat-file commit $hash |grep Change-Id: >> /tmp/newchanges
 done
 
-oldhashes=$(git rev-list ${old}-branch-point..origin/distro/${vendor}/${old})
+oldhashes=$(git rev-list ${old}-branch-point..logerrit/distro/${vendor}/${old})
 for hash in ${oldhashes}
 do
-        if ! grep -q "$(git cat-file commit $hash |grep Change-Id:)" /tmp/newchanges; then
+        changeid="$(git cat-file commit $hash |grep Change-Id:)"
+        if [ -z "$changeid" ]; then
+            echo "WARNING: commit $hash has no Change-Id, assuming it has to be cherry-picked."
+            continue
+        fi
+
+        if ! grep -q "$changeid" /tmp/newchanges; then
                 git log -1 --pretty=oneline $hash
         fi
 done


More information about the Libreoffice-commits mailing list