Skip to content

Instantly share code, notes, and snippets.

@rjeczalik
Created January 2, 2014 14:31
Show Gist options
  • Save rjeczalik/8219961 to your computer and use it in GitHub Desktop.
Save rjeczalik/8219961 to your computer and use it in GitHub Desktop.
utility script for creating PR for Stash
#!/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