summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2018-08-13 16:12:26 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2018-08-13 16:15:55 +0200
commit3ea30f4d618d1887d1457c64e26d8b25fdb03d5e (patch)
tree63486d69b91e0e6cc5f8a3b850ac87c90a2590e1 /scripts
parentaaba5c44f67b65a48b1a478b0ee072233085d25f (diff)
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
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/git-cherry-gerrit12
1 files changed, 9 insertions, 3 deletions
diff --git a/scripts/git-cherry-gerrit b/scripts/git-cherry-gerrit
index 033ca333..98de6634 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