Last active
February 21, 2020 14:56
-
-
Save goneri/8ad7ca9f1ccc0bc11260faee572d735d to your computer and use it in GitHub Desktop.
Cherry pick a patch, even if the file has been renamed.
This file contains 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 | |
set -eux | |
git clone https://github.com/goneri/ansible_vmware_collection /tmp/cherry_pick_demo | |
cd /tmp/cherry_pick_demo | |
# starts a dev branch | |
git checkout -B dev origin/master | |
git mv community/vmware/plugins/modules/vmware_dvswitch.py ansible/vmware/plugins/modules/ | |
# mock some extra changes to fix the module | |
sed -i 's,destroy_dvswitch,remove_dvswitch,g' ansible/vmware/plugins/modules/vmware_dvswitch.py | |
git commit -a -m "promotion of vmware_dvswitch.py" | |
sed -i 's,update_dvswitch,update_dvswitch_status,g' ansible/vmware/plugins/modules/vmware_dvswitch.py | |
git commit -a -m "Apply a fix that will need to be cherry-picked" | |
# Open up a stable branch | |
git checkout -B stable origin/master | |
# Cherry-pick the fix | |
git cherry-pick $(git log -1 --pretty=tformat:%H dev) | |
git log |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment