Skip to content

Instantly share code, notes, and snippets.

@rsdy
Created September 11, 2011 23:45
Show Gist options
  • Save rsdy/1210304 to your computer and use it in GitHub Desktop.
Save rsdy/1210304 to your computer and use it in GitHub Desktop.
reppa -- review, pick, phuck around
#!/bin/ksh
#
# REview - Pick - Phuck Around
#
# Copyright (C) 2011 Peter Parkanyi <me@rhapsodhy.hu>
# 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