Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 22 Aug 2017 17:57:35 +0000 (UTC)
From:      Ed Maste <emaste@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r322798 - head/sys/conf
Message-ID:  <201708221757.v7MHvZ5c025593@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: emaste
Date: Tue Aug 22 17:57:34 2017
New Revision: 322798
URL: https://svnweb.freebsd.org/changeset/base/322798

Log:
  newvers.sh: accommodate `git worktree`
  
  newvers.sh looks for a .vcs subdirectory (e.g. .git, .svn) to determine
  which vcs info tool to run (e.g., git rev-parse, svn info).
  
  (As of r308789 if a .vcs subdirectory is not found at ${TOPDIR} then
  newvers.sh walks up successive parent directories, testing for the .vcs
  subdirectory at each step.  This is done in case the FreeBSD source is
  built in a subdirectory as part of some larger project, but either way
  newvers.sh still tests for the .vcs subdirectory.)
  
  However, when using git worktree there is no .git subdirectory but
  rather a plain text .git file which contains a reference to the main
  working tree.
  
  Change findvcs() to test that the .vcs entry exists, regardless of type.
  
  MFC after:	2 weeks
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/sys/conf/newvers.sh

Modified: head/sys/conf/newvers.sh
==============================================================================
--- head/sys/conf/newvers.sh	Tue Aug 22 17:38:06 2017	(r322797)
+++ head/sys/conf/newvers.sh	Tue Aug 22 17:57:34 2017	(r322798)
@@ -62,7 +62,7 @@ findvcs()
 	savedir=$(pwd)
 	cd ${SYSDIR}/..
 	while [ $(pwd) != "/" ]; do
-		if [ -d "./$1" ]; then
+		if [ -e "./$1" ]; then
 			VCSDIR=$(pwd)"/$1"
 			cd ${savedir}
 			return 0



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201708221757.v7MHvZ5c025593>