PATH:
usr
/
libexec
/
git-core
#!/bin/sh # Copyright 2005, Ryan Anderson <ryan@michonline.com> # # This file is licensed under the GPL v2, or a later version # at the discretion of Linus Torvalds. USAGE='<start> <url> [<end>]' LONG_USAGE='Summarizes the changes between two commits to the standard output, and includes the given URL in the generated summary.' SUBDIRECTORY_OK='Yes' OPTIONS_KEEPDASHDASH= OPTIONS_SPEC='git request-pull [options] start url [end] -- p show patch text as well ' . git-sh-setup GIT_PAGER= export GIT_PAGER patch= while case "$#" in 0) break ;; esac do case "$1" in -p) patch=-p ;; --) shift; break ;; -*) usage ;; *) break ;; esac shift done base=$1 url=$2 head=${3-HEAD} status=0 branch_name= headref=$(git symbolic-ref -q "$head") if git show-ref -q --verify "$headref" then branch_name=${headref#refs/heads/} if test "z$branch_name" = "z$headref" || ! git config "branch.$branch_name.description" >/dev/null then branch_name= fi fi tag_name=$(git describe --exact "$head^0" 2>/dev/null) test -n "$base" && test -n "$url" || usage baserev=$(git rev-parse --verify "$base"^0) && headrev=$(git rev-parse --verify "$head"^0) || exit merge_base=$(git merge-base $baserev $headrev) || die "fatal: No commits in common between $base and $head" # $head is the token given from the command line, and $tag_name, if # exists, is the tag we are going to show the commit information for. # If that tag exists at the remote and it points at the commit, use it. # Otherwise, if a branch with the same name as $head exists at the remote # and their values match, use that instead. # # Otherwise find a random ref that matches $headrev. find_matching_ref=' sub abbr { my $ref = shift; if ($ref =~ s|^refs/heads/|| || $ref =~ s|^refs/tags/|tags/|) { return $ref; } else { return $ref; } } my ($tagged, $branch, $found); while (<STDIN>) { my ($sha1, $ref, $deref) = /^(\S+)\s+(\S+?)(\^\{\})?$/; next unless ($sha1 eq $ARGV[1]); $found = abbr($ref); if ($deref && $ref eq "refs/tags/$ARGV[2]") { $tagged = $found; last; } if ($ref =~ m|/\Q$ARGV[0]\E$|) { $exact = $found; } } if ($tagged) { print "$tagged\n"; } elsif ($exact) { print "$exact\n"; } elsif ($found) { print "$found\n"; } ' ref=$(git ls-remote "$url" | perl -e "$find_matching_ref" "$head" "$headrev" "$tag_name") url=$(git ls-remote --get-url "$url") git show -s --format='The following changes since commit %H: %s (%ci) are available in the git repository at: ' $merge_base && echo " $url${ref+ $ref}" && git show -s --format=' for you to fetch changes up to %H: %s (%ci) ----------------------------------------------------------------' $headrev && if test -n "$branch_name" then echo "(from the branch description for $branch_name local branch)" echo git config "branch.$branch_name.description" fi && if test -n "$tag_name" then if test -z "$ref" || test "$ref" != "tags/$tag_name" then echo >&2 "warn: You locally have $tag_name but it does not (yet)" echo >&2 "warn: appear to be at $url" echo >&2 "warn: Do you want to push it there, perhaps?" fi git cat-file tag "$tag_name" | sed -n -e '1,/^$/d' -e '/^-----BEGIN PGP /q' -e p echo fi && if test -n "$branch_name" || test -n "$tag_name" then echo "----------------------------------------------------------------" fi && git shortlog ^$baserev $headrev && git diff -M --stat --summary $patch $merge_base..$headrev || status=1 if test -z "$ref" then echo "warn: No branch of $url is at:" >&2 git show -s --format='warn: %h: %s' $headrev >&2 echo "warn: Are you sure you pushed '$head' there?" >&2 status=1 fi exit $status
[+]
..
[-] git-sh-setup
[edit]
[-] git-bisect--helper
[edit]
[-] git-check-attr
[edit]
[-] git-show
[edit]
[-] git-receive-pack
[edit]
[-] git-bundle
[edit]
[-] git-config
[edit]
[-] git-merge-recursive
[edit]
[-] git-imap-send
[edit]
[-] git-remote-testpy
[edit]
[-] git-revert
[edit]
[-] git-mergetool
[edit]
[-] git-rev-parse
[edit]
[-] git-sh-i18n--envsubst
[edit]
[-] git-fast-export
[edit]
[-] git-fmt-merge-msg
[edit]
[-] git-whatchanged
[edit]
[-] git-submodule--helper
[edit]
[-] git-reflog
[edit]
[-] git-column
[edit]
[-] git-prune-packed
[edit]
[-] git-credential-cache
[edit]
[-] git-upload-pack
[edit]
[-] git
[edit]
[-] git-remote-http
[edit]
[-] git-difftool
[edit]
[-] git-request-pull
[edit]
[-] git-merge-subtree
[edit]
[-] git-parse-remote
[edit]
[-] git-fetch-pack
[edit]
[-] git-send-pack
[edit]
[-] git-diff-index
[edit]
[-] git-cherry
[edit]
[-] git-ls-files
[edit]
[-] git-show-index
[edit]
[-] git-unpack-objects
[edit]
[-] git-write-tree
[edit]
[-] git-upload-archive
[edit]
[-] git-merge-index
[edit]
[-] git-gc
[edit]
[-] git-init-db
[edit]
[-] git-diff
[edit]
[-] git-credential
[edit]
[-] git-notes
[edit]
[-] git-for-each-ref
[edit]
[-] git-symbolic-ref
[edit]
[-] git-diff-files
[edit]
[-] git-fetch
[edit]
[-] git-merge-tree
[edit]
[-] git-update-index
[edit]
[-] git-diff-tree
[edit]
[-] git-commit
[edit]
[-] git-tag
[edit]
[-] git-cat-file
[edit]
[-] git-remote-fd
[edit]
[-] git-rebase--merge
[edit]
[-] git-bisect
[edit]
[-] git-sh-i18n
[edit]
[-] git-cherry-pick
[edit]
[-] git-checkout-index
[edit]
[-] git-credential-store
[edit]
[-] git-annotate
[edit]
[-] git-stage
[edit]
[-] git-remote-https
[edit]
[-] git-patch-id
[edit]
[-] git-branch
[edit]
[-] git-var
[edit]
[-] git-rm
[edit]
[-] git-help
[edit]
[-] git-commit-tree
[edit]
[-] git-merge
[edit]
[-] git-reset
[edit]
[-] git-stripspace
[edit]
[-] git-pack-refs
[edit]
[-] git-lost-found
[edit]
[-] git-show-ref
[edit]
[-] git-update-server-info
[edit]
[-] git-check-ignore
[edit]
[-] git-am
[edit]
[-] git-check-ref-format
[edit]
[-] git-hash-object
[edit]
[-] git-ls-tree
[edit]
[-] git-apply
[edit]
[-] git-format-patch
[edit]
[-] git-verify-tag
[edit]
[-] git-fsck-objects
[edit]
[-] git-tar-tree
[edit]
[-] git-read-tree
[edit]
[-] git-update-ref
[edit]
[-] git-count-objects
[edit]
[-] git-fast-import
[edit]
[-] git-mergetool--lib
[edit]
[-] git-push
[edit]
[-] git-subtree
[edit]
[-] git-rebase--am
[edit]
[-] git-merge-ours
[edit]
[-] git-remote-ftps
[edit]
[-] git-blame
[edit]
[-] git-init
[edit]
[-] git-merge-one-file
[edit]
[-] git-show-branch
[edit]
[-] git-clone
[edit]
[-] git-rebase
[edit]
[-] git-remote
[edit]
[-] git-rerere
[edit]
[-] git-ls-remote
[edit]
[-] git-merge-resolve
[edit]
[-] git-rev-list
[edit]
[-] git-pack-objects
[edit]
[-] git-fsck
[edit]
[-] git-rebase--interactive
[edit]
[-] git-mv
[edit]
[-] git-unpack-file
[edit]
[-] git-http-fetch
[edit]
[-] git-shell
[edit]
[-] git-status
[edit]
[-] git-shortlog
[edit]
[-] git-verify-pack
[edit]
[-] git-name-rev
[edit]
[+]
mergetools
[-] git-merge-file
[edit]
[-] git-web--browse
[edit]
[-] git-remote-ext
[edit]
[-] git-grep
[edit]
[-] git-mktree
[edit]
[-] git-credential-cache--daemon
[edit]
[-] git-stash
[edit]
[-] git-add--interactive
[edit]
[-] git-checkout
[edit]
[-] git-pull
[edit]
[-] git-replace
[edit]
[-] git-merge-octopus
[edit]
[-] git-mailsplit
[edit]
[-] git-clean
[edit]
[-] git-repack
[edit]
[-] git-add
[edit]
[-] git-peek-remote
[edit]
[-] git-http-push
[edit]
[-] git-log
[edit]
[-] git-prune
[edit]
[-] git-get-tar-commit-id
[edit]
[-] git-repo-config
[edit]
[-] git-mktag
[edit]
[-] git-http-backend
[edit]
[-] git-index-pack
[edit]
[-] git-difftool--helper
[edit]
[-] git-submodule
[edit]
[-] git-relink
[edit]
[-] git-remote-ftp
[edit]
[-] git-merge-base
[edit]
[-] git-describe
[edit]
[-] git-filter-branch
[edit]
[-] git-mailinfo
[edit]
[-] git-archive
[edit]
[-] git-pack-redundant
[edit]
[-] git-quiltimport
[edit]