Skip to content

Instantly share code, notes, and snippets.

@axelson
Created January 17, 2012 20:23
Show Gist options
  • Save axelson/1628673 to your computer and use it in GitHub Desktop.
Save axelson/1628673 to your computer and use it in GitHub Desktop.
Gerrit trivial rebase detector hook
#!/bin/bash
# hook downloaded from: https://www.codeaurora.org/xwiki/bin/QAEP/Gerrit
#patchset-created --change <change id> --change-url <change url> --project <project name> --branch <branch> --uploader <uploader> --commit <sha1> --patchset <patchset id>
# $1 $2 $3 $4 $5 $6 $7 $8 $9 $10 $11 $12 $13 $14
echo "patchset created `date`" >> patchset-created.log
echo "pwd `pwd`" >> patchset-created.log
DIR="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
#Usage: trivial_rebase.py <required options> [--server-port=PORT]
#
#Options:
# -h, --help show this help message and exit
# --change=CHANGEID Change identifier
# --project=PROJECT Project path in Gerrit
# --commit=COMMIT Git commit-ish for this patchset
# --patchset=PATCHSET The patchset number
# --private-key-path=PRIVATE_KEY_PATH
# Full path to Gerrit SSH daemon's private host key
# --server-port=PORT Port to connect to Gerrit's SSH daemon [default:
# 29418]
echo "site path is $site_path" >> patchset-created.log
echo $0 >> patchset-created.log
echo "./trivial_rebase.py --change=${2} --project=${6} --commit=${12} --patchset=${14} --private-key-path /media/storage/gerrit/etc/ssh_host_dsa_key" >> patchset-created.log
echo >> patchset-created.log
$DIR/trivial_rebase.py --change=${2} --project=${6} --commit=${12} --patchset=${14} --private-key=/media/storage/gerrit/etc/ssh_host_dsa_key 2> error.log >> output.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment