Add --trivial option for trivial changes.

This one causes sunrise-commit to not update the ChangeLog on a trivial
change (e.g. a Manifest fix).
This commit is contained in:
Michał Górny 2010-07-12 11:36:23 +02:00
parent 6cfe72f59e
commit 0786203159

View File

@ -113,13 +113,14 @@ Options:
-c, --changelog backwards compat (ignored), -c, --changelog backwards compat (ignored),
-C, --nocolor disable colorful output, -C, --nocolor disable colorful output,
-t, --trivial trivial changes (do not add a ChangeLog entry),
-v, --verbose enable verbose output. -v, --verbose enable verbose output.
_EOH_ _EOH_
} }
# Guess what! # Guess what!
main() { main() {
local commitmsg monochrome local commitmsg monochrome trivial
unset SC_VERBOSE unset SC_VERBOSE
while [ ${#} -gt 0 ]; do while [ ${#} -gt 0 ]; do
@ -139,6 +140,9 @@ main() {
-C|--nocolor) -C|--nocolor)
monochrome=1 monochrome=1
;; ;;
-t|--trivial)
trivial=1
;;
-v|--verbose) -v|--verbose)
SC_VERBOSE=1 SC_VERBOSE=1
;; ;;
@ -194,13 +198,18 @@ main() {
bns=$(echo "${commitmsg}" | grep -o -E '[0-9]{4,}') bns=$(echo "${commitmsg}" | grep -o -E '[0-9]{4,}')
# Creating a new ChangeLog? Let's take a look at the commit message. # 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!' if [ ! -f ChangeLog ]; then
[ -n "${trivial}" ] && die "Trivial change for an initial commit? You're joking, right?"
[ -z "${bns}" ] && die 'Please supply the bug number in the initial commit message!'
fi
sayv '...and appending to it.' if [ -z "${trivial}" ]; then
req echangelog "${commitmsg}" sayv '...and appending to it.'
req echangelog "${commitmsg}"
echo
fi
if [ -n "${bns}" ]; then if [ -n "${bns}" ]; then
echo
local bn cbn local bn cbn
for bn in ${bns}; do for bn in ${bns}; do
cbn=#${WHITE}${bn}${NORMAL} cbn=#${WHITE}${bn}${NORMAL}