File: git-reconstruct-changelog

package info (click to toggle)
git-ubuntu 1.1-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,688 kB
  • sloc: python: 13,378; sh: 480; makefile: 2
file content (17 lines) | stat: -rwxr-xr-x 525 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh
set -e

tempfile=`mktemp --tmpdir git-reconstruct-changelog.XXXXXXXXXX`
cleanup() { rm -f "$tempfile"; }
trap cleanup EXIT

dch --vendor=Ubuntu PLACEHOLDER
sed -n '1,/PLACEHOLDER/{/PLACEHOLDER/!p}' debian/changelog > "$tempfile"
for rev in `git rev-list --reverse $1..HEAD`; do
	if [ "`git diff --name-only $rev^ $rev`" = debian/changelog ]; then
		continue
	fi
	git log --pretty=%B -n1 $rev|sed '/^$/d' >> "$tempfile"
done
sed -n '1,/PLACEHOLDER/!p' debian/changelog >> "$tempfile"
mv "$tempfile" debian/changelog