Created
January 2, 2014 14:31
-
-
Save rjeczalik/8219961 to your computer and use it in GitHub Desktop.
utility script for creating PR for Stash
This file contains hidden or 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
#!/usr/bin/env bash | |
BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD) | |
COMMIT_MESSAGE=$(git log --format=%B -n1 HEAD) | |
if ! echo "${BRANCH_NAME}" | perl -ne 'exit 1 unless /^(lmx|licstat)\d+$/'; then | |
echo "git-pr: invalid issue branch name: ${BRANCH_NAME}" 1>&2 | |
exit 1 | |
fi | |
stash --action createPullRequest \ | |
--server http://git/ \ | |
--user "$(whoami)" \ | |
--password "$(cat ~/.passwd | tr -d '\n')" \ | |
--project DEV \ | |
--repository x-formation-core \ | |
--from "${BRANCH_NAME}" \ | |
--to master \ | |
--name "${BRANCH_NAME}" \ | |
--description "${COMMIT_MESSAGE}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment