[task/git-tools] Ignore git commit message comments

Git commit message comments can be contained anywhere in the message and
this change ignores where they appear.

PHPBB3-9768
This commit is contained in:
Chris Smith 2010-07-12 02:04:29 +01:00
parent a9046e5608
commit e17ffa01e6

View file

@ -87,6 +87,12 @@ do
quit $err; quit $err;
fi fi
if [ "${expecting#comment}" = "$expecting" ]
then
# Prefix comments to the expected tokens list
expecting="comment $expecting";
fi
debug 2 "Expecting: $expecting"; debug 2 "Expecting: $expecting";
# Loop over each of the expected line formats # Loop over each of the expected line formats
@ -121,6 +127,9 @@ do
# Should not end up here # Should not end up here
false false
;; ;;
"comment")
echo "$line" | grep -Eq "^#";
;;
*) *)
echo "Unrecognised token $expect" >&2; echo "Unrecognised token $expect" >&2;
quit $err; quit $err;
@ -143,7 +152,7 @@ do
if [ $result -eq 0 ] if [ $result -eq 0 ]
then then
# Have we switched out of description mode? # Have we switched out of description mode?
if [ $in_description -eq 1 ] && [ "$expect" != "description" ] && [ "$expect" != "empty" ] if [ $in_description -eq 1 ] && [ "$expect" != "description" ] && [ "$expect" != "empty" ] && [ "$expect" != "comment" ]
then then
# Yes, okay we need to backtrace one line and reanalyse # Yes, okay we need to backtrace one line and reanalyse
in_description=0; in_description=0;
@ -186,6 +195,9 @@ do
tickets="$tickets $line"; tickets="$tickets $line";
fi fi
;; ;;
"comment")
# Comments should expect the same thing again
;;
*) *)
echo "Unrecognised token $expect" >&2; echo "Unrecognised token $expect" >&2;
quit 254; quit 254;