svn commit: r338959 - head/sys/conf

Mateusz Piotrowski 0mp at FreeBSD.org
Thu Sep 27 12:15:32 UTC 2018


Author: 0mp (ports committer)
Date: Thu Sep 27 12:15:31 2018
New Revision: 338959
URL: https://svnweb.freebsd.org/changeset/base/338959

Log:
  newvers.sh: Unbreak building in Git repositories.
  
  Building the kernel in Git repositories when git-svn is not available and
  the "help.autocorrect" Git parameter is enabled results in Git trying to
  replace the "svn" command (it does not know) with "serve". As a result the
  output of the "git server" command is appended to the value of the
  environmental variable VERINFO, which causes the auto generated vers.c
  file to contain invalid C syntax (missing newline escapes):
  
      #define "@(#)FreeBSD 12.0-ALPHA7  r000eversion 2
      0015agent=git/2.19.0
      000cls-refs
      0012fetch=shallow
      0012server-option
      0000=5e2272613fa(splash-vt)"
      #define VERSTR "FreeBSD 12.0-ALPHA7  r000eversion 2
      0015agent=git/2.19.0
      000cls-refs
      0012fetch=shallow
      0012server-option
      0000=5e2272613fa(splash-vt)\n"
  
  Using `-c help.autocorrect=0` seems to be a good solution as it does not
  modify user's environment. I am not sure, however, if we should use
  programs (or Git commands), which we are not sure exist (we never check if
  git-svn is available on the host), as there may be more unexpected
  behaviors like this one.
  
  Reviewed by:	eadler, emaste, krion
  Approved by:	re (gjb), krion (mentor)
  Sponsored by:	Bally Wulff Games & Entertainment GmbH
  Differential Revision:	https://reviews.freebsd.org/D17271

Modified:
  head/sys/conf/newvers.sh

Modified: head/sys/conf/newvers.sh
==============================================================================
--- head/sys/conf/newvers.sh	Thu Sep 27 12:08:53 2018	(r338958)
+++ head/sys/conf/newvers.sh	Thu Sep 27 12:15:31 2018	(r338959)
@@ -183,7 +183,7 @@ done
 if findvcs .git; then
 	for dir in /usr/bin /usr/local/bin; do
 		if [ -x "${dir}/git" ] ; then
-			git_cmd="${dir}/git --git-dir=${VCSDIR}"
+			git_cmd="${dir}/git -c help.autocorrect=0 --git-dir=${VCSDIR}"
 			break
 		fi
 	done


More information about the svn-src-all mailing list