Created
December 21, 2012 00:33
-
-
Save joshcom/4349831 to your computer and use it in GitHub Desktop.
Jira cherry-picker galore?
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/sh | |
JIRA_ISSUE=$1 | |
BRANCH=$2 | |
if [ "$BRANCH" = "" ]; then | |
BRANCH="master" | |
fi | |
echo "Commits in branch $BRANCH for issue #$JIRA_ISSUE" | |
echo "------------------------------------------------" | |
echo "" | |
git log --grep="^$JIRA_ISSUE " --reverse $BRANCH | |
echo "------------------------------------------------" | |
echo "Would you like to cherry-pick the above commits " | |
echo "into your current branch? (yes/no) " | |
read YESNO | |
if [ "$YESNO" = "yes" ]; then | |
echo "" | |
echo "" | |
echo "" | |
COMMIT_LIST=`git rev-list --grep="^$JIRA_ISSUE " --reverse $BRANCH` | |
### | |
# Replay commits one by one, rather than piping full list to git-cherry-pick, | |
# making merge conflicts slightly less confusing. | |
### | |
for commit in $COMMIT_LIST; do | |
echo "$commit" | |
done | |
else | |
echo "Aborting..." | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
+1 Cal, +1 Wade.
I agree with the pull request/merge idea. I've mentioned that a couple times to the web dev team as well. It would also help out for getting another set of eyes on things as well.
If webdev followed this, it would go something like:
Using one branch for websrc/prod would still require something like the deploy dog though (granted that's another discussion entirely). This would at least avoid the cherry-picks on bigger change sets, but you could still use the cherry-pick method for smaller changes like bugs.
Honestly, I think our team at least needs to get better about using feature branches more often regardless.