Last active
December 9, 2016 18:42
-
-
Save resmo/33367af78bcbb75b42ff0fc694b00479 to your computer and use it in GitHub Desktop.
cherry picking a commit in ansible/ansible devel to ansible-modules-extras
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
| #!/bin/bash | |
| # git-ansibull-cherry-pick <sha1> | |
| set -e | |
| ( | |
| cd /tmp | |
| if [ -e ansible ]; then | |
| cd ansible | |
| git pull origin devel | |
| else | |
| git clone -b devel --single-branch https://github.com/ansible/ansible | |
| fi | |
| ) | |
| commit=$1 | |
| git --git-dir=/tmp/ansible/.git format-patch -k -1 --stdout $commit | git am -3 -k | |
| msg="$(git rev-list --format=%B --max-count=1 HEAD | tail -n +2)" | |
| git commit --amend -m "$msg | |
| (cherry picked from https://github.com/ansible/ansible/commit/$commit)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment