Last modified: 2014-04-17 10:36:37 UTC
According to http://stackoverflow.com/questions/23095496/how-to-search-for-changesets-in-gerrit-than-need-to-be-rebased/, Gerrit 2.9 introduces the search operator "is:mergeable" which indicates whether a changeset needs a manual rebase or not. This would allow for easy searches for "all changesets that I need to rebase".
Until then a short script to determine whether a branch is rebaseable according to Gerrit: | COMMITID="$(git log -1 --format=format:%B "$1" | sed -ne 's/^Change-Id: //p;')" | MERGEABLE="$(curl -s "https://gerrit.wikimedia.org/r/changes/$COMMITID" | sed -e 1d | jq '.mergeable')" | if [ "true" = "$MERGEABLE" ]; then | exit 0 | fi | if [ "false" = "$MERGEABLE" ]; then | exit 1 | fi | echo "Unknown result: $MERGEABLE" | exit 2