3 # Copyright (c) 2005 Junio C Hamano.
6 . git-sh-setup || die "Not a git archive."
8 usage="usage: $0 "'[-v] <upstream> [<head>]
10 __*__*__*__*__> <upstream>
13 \__+__+__+__+__+__+__+__> <head>
15 Each commit between the fork-point and <head> is examined, and
16 compared against the change each commit between the fork-point and
17 <upstream> introduces. If the change seems to be in the upstream,
18 it is shown on the standard output with prefix "+". Otherwise
19 it is shown with prefix "-".
22 case "$1" in -v) verbose=t; shift ;; esac
26 upstream=$(expr "$1" : '\(.*\)\.\.') ours=$(expr "$1" : '.*\.\.\(.*\)$')
27 set x "$upstream" "$ours"
32 1) upstream=`git-rev-parse --verify "$1"` &&
33 ours=`git-rev-parse --verify HEAD` || exit
35 2) upstream=`git-rev-parse --verify "$1"` &&
36 ours=`git-rev-parse --verify "$2"` || exit
38 *) echo >&2 "$usage"; exit 1 ;;
41 # Note that these list commits in reverse order;
42 # not that the order in inup matters...
43 inup=`git-rev-list ^$ours $upstream` &&
44 ours=`git-rev-list $ours ^$upstream` || exit
49 trap "rm -rf $tmp-*" 0 1 2 3 15
51 _x40='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]'
52 _x40="$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40"
60 echo $name >>$patch/$id
69 set x `git-diff-tree -p $c | git-patch-id`
72 if test -f "$patch/$2"
80 c=$(git-rev-list --pretty=oneline --max-count=1 $c)
84 *) O="$sign $c$LF$O" ;;