]>
Commit | Line | Data |
---|---|---|
af8ba428 VJ |
1 | #!/bin/bash -e |
2 | gitshow () { | |
3 | local format=$1 | |
4 | local commit=$2 | |
5 | ||
6 | git show --no-patch --format=format:"$format" "$commit" | |
7 | } | |
8 | ||
9 | main () { | |
10 | if [ $# -lt 1 ]; then | |
11 | local bn="$(basename $0)" | |
12 | echo "Usage: $bn <commit range>" >&2 | |
13 | echo "Example: $bn 0.9.7..HEAD" >&2 | |
14 | echo "Example: $bn 0.9.5..0.9.6^" >&2 | |
15 | return 1 | |
16 | fi | |
17 | ||
18 | local commitrange=$1 | |
19 | ||
20 | local commit | |
21 | for commit in $(git rev-list --reverse "$commitrange"); do | |
22 | # Skip commits with diffs that only have Makefile.am or d/ changes. | |
23 | if [ "$(git diff --name-only "${commit}^..${commit}" -- . ':^Makefile.am' ':^debian/' | wc -l)" == 0 ]; then | |
24 | continue | |
25 | fi | |
26 | ||
27 | local author_name="$(gitshow %an "$commit")" | |
28 | local author_email="$(gitshow %ae "$commit")" | |
29 | local subject="$(gitshow %s "$commit")" | |
30 | ||
31 | echo "$author_name <$author_email> $subject" | |
32 | DEBFULLNAME="$author_name" DEBEMAIL="$author_email" debchange --upstream --multimaint-merge "$subject" | |
33 | done | |
635e2853 VJ |
34 | |
35 | debchange --release '' | |
af8ba428 VJ |
36 | } |
37 | ||
38 | main "$@" || exit $? |