3 # Copyright (c) 2005 Junio C Hamano.
6 USAGE='[-v] <upstream> [<head>] [<limit>]'
7 LONG_USAGE=' __*__*__*__*__> <upstream>
10 \__+__+__+__+__+__+__+__> <head>
12 Each commit between the fork-point (or <limit> if given) and <head> is
13 examined, and compared against the change each commit between the
14 fork-point and <upstream> introduces. If the change seems to be in
15 the upstream, it is shown on the standard output with prefix "+".
16 Otherwise it is shown with prefix "-".'
19 case "$1" in -v) verbose=t; shift ;; esac
23 upstream=$(expr "z$1" : 'z\(.*\)\.\.') ours=$(expr "z$1" : '.*\.\.\(.*\)$')
24 set x "$upstream" "$ours"
29 1) upstream=`git-rev-parse --verify "$1"` &&
30 ours=`git-rev-parse --verify HEAD` || exit
33 2) upstream=`git-rev-parse --verify "$1"` &&
34 ours=`git-rev-parse --verify "$2"` || exit
37 3) upstream=`git-rev-parse --verify "$1"` &&
38 ours=`git-rev-parse --verify "$2"` &&
39 limit=`git-rev-parse --verify "$3"` || exit
44 # Note that these list commits in reverse order;
45 # not that the order in inup matters...
46 inup=`git-rev-list ^$ours $upstream` &&
47 ours=`git-rev-list $ours ^$limit` || exit
52 trap "rm -rf $tmp-*" 0 1 2 3 15
54 _x40='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]'
55 _x40="$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40"
63 echo $name >>$patch/$id
72 set x `git-diff-tree -p $c | git-patch-id`
75 if test -f "$patch/$2"
83 c=$(git-rev-list --pretty=oneline --max-count=1 $c)
87 *) O="$sign $c$LF$O" ;;