Skip to content

Commit

Permalink
Add cherrypull script here
Browse files Browse the repository at this point in the history
  • Loading branch information
radare committed Aug 10, 2014
1 parent 1314f67 commit a9aa825
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions cherrypull.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/sh

[ "$1" = git ] && shift
[ "$1" = pull ] && shift

RR=$1
RB=$2
N=$3

if [ -z "$N" ]; then
echo "Usage: sys/cherrypull.sh [url] [branch] [ncommits]"
exit 1
fi

git branch -D branch
git co -b branch
git reset --hard @~100
git pull $RR $RB
C=`git log | grep ^commit | head -n $N | cut -d ' ' -f2`
RC=""
git co master
for a in $C ; do
RC="$a $RC"
done
for a in $RC ; do
git cherry-pick $a
done
git branch -D branch

0 comments on commit a9aa825

Please sign in to comment.