X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=git-cherry;h=fe8c1090e97faa0fd0a34c2a12d748916aaa6b05;hb=6e7722e6f88c049f43a1c00c45c502542d1a5752;hp=f14f017efeacdeef01ff871f4f2ff1949463ee90;hpb=4282c4fbddfeae3383c6c327e2ca98b25500ea31;p=git.git diff --git a/git-cherry b/git-cherry index f14f017e..fe8c1090 100755 --- a/git-cherry +++ b/git-cherry @@ -5,7 +5,7 @@ . git-sh-setup-script || die "Not a git archive." -usage="usage: $0 "' [] +usage="usage: $0 "'[-v] [] __*__*__*__*__> / @@ -14,21 +14,13 @@ usage="usage: $0 "' [] Each commit between the fork-point and is examined, and compared against the change each commit between the fork-point and - introduces. If the change does not seem to be in the -upstream, it is shown on the standard output. - -The output is intended to be used as: - - OLD_HEAD=$(git-rev-parse HEAD) - git-rev-parse upstream >${GIT_DIR-.}/HEAD - git-cherry upstream $OLD_HEAD | - while read commit - do - GIT_EXTERNAL_DIFF=git-apply-patch-script git-diff-tree -p "$commit" && - git-commit-script -C "$commit" - done + introduces. If the change seems to be in the upstream, +it is shown on the standard output with prefix "+". Otherwise +it is shown with prefix "-". ' +case "$1" in -v) verbose=t; shift ;; esac + case "$#,$1" in 1,*..*) upstream=$(expr "$1" : '\(.*\)\.\.') ours=$(expr "$1" : '.*\.\.\(.*\)$') @@ -83,6 +75,10 @@ do else sign=+ fi + case "$verbose" in + t) + c=$(git-rev-list --pretty=oneline --max-count=1 $c) + esac case "$O" in '') O="$sign $c" ;; *) O="$sign $c$LF$O" ;;