[PATCH] Add git-request-pull-script, a short script that generates a summary of pendi...
[git.git] / git-request-pull-script
1 #!/bin/sh -e
2 # Copyright 2005, Ryan Anderson <ryan@michonline.com>
3 #
4 # This file is licensed under the GPL v2, or a later version
5 # at the discretion of Linus Torvalds.
6
7 usage()
8 {
9         echo "$0 <commit> <filename> <url>"
10         echo "  Summarizes the changes since <commit>, stores them in <filename>"
11         echo "  and includes <url> in the message generated."
12         exit 1
13 }
14
15
16 revision=$1
17 filename=$2
18 url=$3
19
20 [ "$revision" ] || usage
21 [ "$filename" ] || usage
22 [ "$url" ] || usage
23
24 baserev=`git-rev-parse $revision`
25
26 (
27         echo "The git repository at:" 
28         echo "    $url"
29         echo "contains the following changes since commit $baserev"
30         echo ""
31         git log $revision.. | git-shortlog ;
32         git diff $revision.. | diffstat ;
33 ) | tee $filename
34
35 echo "The above message is also stored in $filename"
36