3 # Copyright (c) 2005 Junio C Hamano.
6 usage
="usage: $0 "'<upstream> [<head>]
8 Uses output from git-cherry to rebase local commits to the new head of
14 1) linus
=`git-rev-parse --verify "$1"` &&
15 junio
=`git-rev-parse --verify HEAD` ||
exit
17 2) linus
=`git-rev-parse --verify "$1"` &&
18 junio
=`git-rev-parse --verify "$2"` ||
exit
20 *) echo >&2 "$usage"; exit 1 ;;
23 git-read-tree
-m -u $junio $linus &&
24 echo "$linus" >"$GIT_DIR/HEAD" ||
exit
28 trap "rm -rf $tmp-*" 0 1 2 3 15
32 git-cherry
$linus $junio |
33 while read sign commit
38 S
=`cat "$GIT_DIR/HEAD"` &&
39 GIT_EXTERNAL_DIFF
=git-apply-patch-script git-diff-tree
-p $commit &&
40 git-commit-script
-m "$commit" ||
{
42 git-read-tree
--reset -u $S
47 echo Some commits could not be rebased
, check by hand
: