Describe bugs in ChangeLog entries, print VCS status.
Don't count ChangeLog edits to changes. Require the first ChangeLog entry to contain a bug number for the new ebuild. Describe all bugs appearing in the ChangeLog entry. Print out VCS status before starting to commit.
This commit is contained in:
parent
a15315093e
commit
94e04f960c
@ -78,11 +78,11 @@ check_for_changes() {
|
|||||||
local output
|
local output
|
||||||
|
|
||||||
if [ ${SC_VCS%-svn} = git ]; then
|
if [ ${SC_VCS%-svn} = git ]; then
|
||||||
output="$(git diff-index --name-status --relative HEAD)"
|
output="$(git diff-index --name-only --relative HEAD)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sayv "${output}"
|
# We do not care about user mangling ChangeLog, we will reset it anyway.
|
||||||
[ -n "${output}" ]
|
echo "${output}" | grep -v ChangeLog >/dev/null
|
||||||
}
|
}
|
||||||
|
|
||||||
vcs_reset() {
|
vcs_reset() {
|
||||||
@ -92,6 +92,12 @@ vcs_reset() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
vcs_status() {
|
||||||
|
if [ ${SC_VCS%-svn} = git ]; then
|
||||||
|
git status -s .
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# Guess what!
|
# Guess what!
|
||||||
main() {
|
main() {
|
||||||
local commitmsg
|
local commitmsg
|
||||||
@ -125,13 +131,34 @@ main() {
|
|||||||
|
|
||||||
# With native git repos, we do not do ChangeLogs by default...
|
# With native git repos, we do not do ChangeLogs by default...
|
||||||
# ...at least unless they're already there.
|
# ...at least unless they're already there.
|
||||||
if [ ${SC_VCS} = git -a ! -f ChangeLog ]; then
|
if [ ${SC_VCS} != git -o -f ChangeLog ]; then
|
||||||
sayv 'Cleaning up the ChangeLog...'
|
sayv 'Cleaning up the ChangeLog...'
|
||||||
vcs_reset ChangeLog
|
vcs_reset ChangeLog
|
||||||
|
|
||||||
|
local bns
|
||||||
|
# Let's take a lucky guess bugnumbers consist of 4+ digits.
|
||||||
|
bns="$(echo "${commitmsg}" | grep -o -E '[0-9]{4,}')"
|
||||||
|
|
||||||
|
# Creating a new ChangeLog? Let's take a look at the commit message.
|
||||||
|
[ ! -f ChangeLog -a -z "${bns}" ] && die 'Please supply the bug number in the initial commit message!'
|
||||||
|
|
||||||
sayv '...and appending to it.'
|
sayv '...and appending to it.'
|
||||||
echangelog "${commitmsg}"
|
req echangelog "${commitmsg}"
|
||||||
|
|
||||||
|
if [ -n "${bns}" ]; then
|
||||||
|
echo
|
||||||
|
local bn
|
||||||
|
for bn in ${bns}; do
|
||||||
|
wget -q http://bugs.gentoo.org/show_bug.cgi?id=12345 -O - \
|
||||||
|
| sed -e 's; *<title>Gentoo Bug \([0-9]*\) - \(.*\)</title>;Bug \1: \2;gp' -e d
|
||||||
|
done
|
||||||
|
echo
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
vcs_status
|
||||||
|
echo
|
||||||
|
|
||||||
sayv "Now, let's let repoman do its job..."
|
sayv "Now, let's let repoman do its job..."
|
||||||
exec repoman commit -a -m "${SC_CP}: ${commitmsg}"
|
exec repoman commit -a -m "${SC_CP}: ${commitmsg}"
|
||||||
;;
|
;;
|
||||||
|
Loading…
Reference in New Issue
Block a user