3 # Copyright (c) 2005 Junio C Hamano.
6 usage="usage: $0 "'<upstream> [<head>]
8 __*__*__*__*__> <upstream>
11 \__+__+__+__+__+__+__+__> <head>
13 Each commit between the fork-point and <head> is examined, and
14 compared against the change each commit between the fork-point and
15 <upstream> introduces. If the change does not seem to be in the
16 upstream, it is shown on the standard output.
18 The output is intended to be used as:
20 OLD_HEAD=$(git-rev-parse HEAD)
21 git-rev-parse linus >${GIT_DIR-.}/HEAD
22 git-cherry linus OLD_HEAD |
25 GIT_EXTERNAL_DIFF=git-apply-patch-script git-diff-tree -p "$commit" &&
26 git-commit-script -m "$commit"
31 1) linus=`git-rev-parse --verify "$1"` &&
32 junio=`git-rev-parse --verify HEAD` || exit
34 2) linus=`git-rev-parse --verify "$1"` &&
35 junio=`git-rev-parse --verify "$2"` || exit
37 *) echo >&2 "$usage"; exit 1 ;;
40 # Note that these list commits in reverse order;
41 # not that the order in inup matters...
42 inup=`git-rev-list ^$junio $linus` &&
43 ours=`git-rev-list $junio ^$linus` || exit
48 trap "rm -rf $tmp-*" 0 1 2 3 15
50 _x40='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]'
51 _x40="$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40"
59 echo $name >>$patch/$id
68 set x `git-diff-tree -p $c | git-patch-id`
71 if test -f "$patch/$2"
79 *) O="$sign $c$LF$O" ;;