Last active
March 30, 2017 07:50
-
-
Save rgolangh/b8482bafa29137478cbe60054b05fffc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
GERRIT_URL=https://gerrit.ovirt.org | |
function gerrit.change_id() { | |
git show --shortstat | grep Change-Id | gawk '{print $2}' | |
} | |
function gerrit.related.change_id() { | |
curl -s ${GERRIT_URL}/changes/$(gerrit.change_id)/revisions/current/related | sed '1d' | jq '.[][0] | .commit.commit' | tr -d '"' | |
} | |
function gerrit.related.remote_branch() { | |
git ls-remote -q | grep $(gerrit.related.change_id) | gawk '{print $2}' | |
} | |
function gerrit.remote_branch() { | |
git ls-remote -q | grep $(git rev-parse HEAD) | gawk '{print $2}' | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
co-authored with @danielerez