From 07862031591353c228c4c8be89114fc30bdae0c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Date: Mon, 12 Jul 2010 11:36:23 +0200 Subject: [PATCH] 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). --- sunrise-commit | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/sunrise-commit b/sunrise-commit index ceba016..6cea8f4 100755 --- a/sunrise-commit +++ b/sunrise-commit @@ -113,13 +113,14 @@ Options: -c, --changelog backwards compat (ignored), -C, --nocolor disable colorful output, + -t, --trivial trivial changes (do not add a ChangeLog entry), -v, --verbose enable verbose output. _EOH_ } # Guess what! main() { - local commitmsg monochrome + local commitmsg monochrome trivial unset SC_VERBOSE while [ ${#} -gt 0 ]; do @@ -139,6 +140,9 @@ main() { -C|--nocolor) monochrome=1 ;; + -t|--trivial) + trivial=1 + ;; -v|--verbose) SC_VERBOSE=1 ;; @@ -194,13 +198,18 @@ main() { 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!' + 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.' - req echangelog "${commitmsg}" + if [ -z "${trivial}" ]; then + sayv '...and appending to it.' + req echangelog "${commitmsg}" + echo + fi if [ -n "${bns}" ]; then - echo local bn cbn for bn in ${bns}; do cbn=#${WHITE}${bn}${NORMAL}