From 4f97ebf2c76b8763da9f57e7ad6d1457fc97a2bd Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sat, 16 Aug 2008 10:24:21 -0300 Subject: Properly handles commit messages with date: field From: Mauro Carvalho Chehab This patch allows a better support for third party patches. Now, it will properly recognize and proccess messages with the following format: Date: From: Subject: This will help to better proccess messages received via email. Signed-off-by: Mauro Carvalho Chehab --- v4l/scripts/do_commit.sh | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100755 v4l/scripts/do_commit.sh (limited to 'v4l/scripts/do_commit.sh') diff --git a/v4l/scripts/do_commit.sh b/v4l/scripts/do_commit.sh new file mode 100755 index 000000000..4fa4e1847 --- /dev/null +++ b/v4l/scripts/do_commit.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +EDITOR=$1 +WHITESPCE=$2 + +if [ "$WHITESPCE" == "" ]; then + exit 13 +fi + +TMPMSG=$1 + +scripts/cardlist +scripts/prep_commit_msg.pl $WHITESPCE > $TMPMSG + +#trap 'rm -rf $TMPMSG' EXIT + +CHECKSUM=`md5sum "$TMPMSG"` +$EDITOR $TMPMSG || exit $? +echo "$CHECKSUM" | md5sum -c --status && echo "*** commit message not changed. Aborting. ***" && exit 13 +DATE="`scripts/hghead.pl $TMPMSG|perl -ne 'if (m/\#[dD]ate:\s+(.*)/) { print $1; }'`" + +if [ "$DATE" != "" ]; then + echo Patch date is $DATE + scripts/hghead.pl $TMPMSG| grep -v '^#' | hg commit -d "$DATE" -l - +else + scripts/hghead.pl $TMPMSG| grep -v '^#' | hg commit -l - +fi + +if [ "$?" != "0" ]; then + echo "Couldn't apply the patch" + exit 13 +fi + +echo "*** PLEASE CHECK IF LOG IS OK:" +hg log -v -r -1 +echo "*** If not ok, do \"hg rollback\" and \"make commit\" again" -- cgit v1.2.3