Created
September 11, 2011 23:45
-
-
Save rsdy/1210304 to your computer and use it in GitHub Desktop.
reppa -- review, pick, phuck around
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/ksh | |
# | |
# REview - Pick - Phuck Around | |
# | |
# Copyright (C) 2011 Peter Parkanyi <[email protected]> | |
# Distributed under the MIT license | |
# | |
SHA1='[a-f0-9]{40}' | |
LISTPATCHES=$(git log HEAD..$1 |grep -E "${SHA1}\$" |sed "s/^.*\(${SHA1//@([\{\}])/\\\1}\)\$/\1/") | |
alias show='git show --patch-with-stat' | |
alias pick='git cherry-pick' | |
ask_to_pick() | |
{ | |
while echo 'Do you want to pick this? [yn]'; read cs; do | |
[[ -z ${cs//@([ynYN])} ]] && { [[ -z ${cs//@([yY])} ]]; return; } | |
done | |
} | |
for patch in $LISTPATCHES; do | |
show $patch | |
ask_to_pick && pick $patch | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment