Skip to content

Instantly share code, notes, and snippets.

@resmo
Last active December 9, 2016 18:42
Show Gist options
  • Select an option

  • Save resmo/33367af78bcbb75b42ff0fc694b00479 to your computer and use it in GitHub Desktop.

Select an option

Save resmo/33367af78bcbb75b42ff0fc694b00479 to your computer and use it in GitHub Desktop.
cherry picking a commit in ansible/ansible devel to ansible-modules-extras
#!/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