From 6725ad687e57e62de7f28a78b0721349f65c9eab Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Tue, 18 Apr 2017 16:24:02 +0200 Subject: [PATCH] sys/conf/newvers.sh: Only accept git-svn-id: attributes at the start of the line This prevents incorrect subversion revision detection if "git svn" isn't being used to get the sources but git is available. Previously old subversion revisions included in commit messages were favoured over the more recent and correct revisions in the "Notes:" section. For example cf1f35574722 represents r315395 but was treated as r313908 which is referenced in the commit message. Commits following r315395/cf1f35574722 but before another commit with a git-svn-id reference in the commit message would be treated as r313908 as well. Obtained from: ElectroBSD --- sys/conf/newvers.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index 81eb69dc28a6..e613dca88ad0 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -195,7 +195,7 @@ if [ -n "$git_cmd" ] ; then svn=" r${svn}" git="=${git}" else - svn=`$git_cmd log | fgrep 'git-svn-id:' | head -1 | \ + svn=`$git_cmd log | grep '^git-svn-id:' | head -1 | \ sed -n 's/^.*@\([0-9][0-9]*\).*$/\1/p'` if [ -z "$svn" ] ; then svn=`$git_cmd log --format='format:%N' | \ -- 2.14.1