Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 21 Jan 2021 11:36:43 +0100
From:      Mateusz Guzik <mjguzik@gmail.com>
To:        =?UTF-8?Q?Ulrich_Sp=C3=B6rlein?= <uqs@freebsd.org>
Cc:        src-committers@freebsd.org, dev-commits-src-all@freebsd.org,  dev-commits-src-main@freebsd.org
Subject:   Re: git: a9fc14fbf445 - main - newvers.sh: add support for gitup(1)
Message-ID:  <CAGudoHG9KGDH0d23d6F1pCmfApYGFc37ZYmK-gxqgY3Ua_80CA@mail.gmail.com>
In-Reply-To: <202101200949.10K9nmkZ029085@gitrepo.freebsd.org>
References:  <202101200949.10K9nmkZ029085@gitrepo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
I'm getting an error with this:

$ make -s buildkernel MODULES_OVERRIDE=3D""

/tank/users/mjg/src/freebsd/sys/conf/newvers.sh: git: not found


On 1/20/21, Ulrich Sp=C3=B6rlein <uqs@freebsd.org> wrote:
> The branch main has been updated by uqs:
>
> URL:
> https://cgit.FreeBSD.org/src/commit/?id=3Da9fc14fbf445cffd18f34f6a602bdba=
84bb5a867
>
> commit a9fc14fbf445cffd18f34f6a602bdba84bb5a867
> Author:     Michael Osipov <michael.osipov@siemens.com>
> AuthorDate: 2021-01-05 10:48:39 +0000
> Commit:     Ulrich Sp=C3=B6rlein <uqs@FreeBSD.org>
> CommitDate: 2021-01-20 09:48:27 +0000
>
>     newvers.sh: add support for gitup(1)
>
>     gitup writes a .gituprevision file into the shallow clone directory.
> Read that
>     file and print commit information only.
>
>     Submitted by:   Michael Osipov <michael.osipov@siemens.com>
>     Pull Request:   https://github.com/freebsd/freebsd-src/pull/449
>
>     While here, drop the redundant branch name from the git output and do=
n't
>     count commits in shallow clones.
>
>     Reported by:    Michael Osipov <michael.osipov@siemens.com>
>     MFC after:      2 weeks
> ---
>  sys/conf/newvers.sh | 24 +++++++++++++++---------
>  1 file changed, 15 insertions(+), 9 deletions(-)
>
> diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh
> index 2a0ace45f2f6..92c275d19fb9 100644
> --- a/sys/conf/newvers.sh
> +++ b/sys/conf/newvers.sh
> @@ -221,6 +221,10 @@ if findvcs .git; then
>  	done
>  fi
>
> +if findvcs .gituprevision; then
> +	gituprevision=3D"${VCSTOP}/.gituprevision"
> +fi
> +
>  if findvcs .hg; then
>  	for dir in /usr/bin /usr/local/bin; do
>  		if [ -x "${dir}/hg" ] ; then
> @@ -248,13 +252,11 @@ fi
>
>  if [ -n "$git_cmd" ] ; then
>  	git=3D$($git_cmd rev-parse --verify --short HEAD 2>/dev/null)
> -	git_cnt=3D$($git_cmd rev-list --count HEAD 2>/dev/null)
> -	if [ -n "$git_cnt" ] ; then
> -		git=3D"c${git_cnt}-g${git}"
> -	fi
> -	git_b=3D$($git_cmd rev-parse --abbrev-ref HEAD)
> -	if [ -n "$git_b" -a "$git_b" !=3D "HEAD" ] ; then
> -		git=3D"${git_b}-${git}"
> +	if [ "$(git rev-parse --is-shallow-repository)" =3D false ] ; then
> +		git_cnt=3D$($git_cmd rev-list --count HEAD 2>/dev/null)
> +		if [ -n "$git_cnt" ] ; then
> +			git=3D"c${git_cnt}-g${git}"
> +		fi
>  	fi
>  	if git_tree_modified; then
>  		git=3D"${git}-dirty"
> @@ -263,6 +265,10 @@ if [ -n "$git_cmd" ] ; then
>  	git=3D" ${git}"
>  fi
>
> +if [ -n "$gituprevision" ] ; then
> +	gitup=3D" $(awk -F: '{print $2}' $gituprevision)"
> +fi
> +
>  if [ -n "$hg_cmd" ] ; then
>  	hg=3D$($hg_cmd id 2>/dev/null)
>  	hgsvn=3D$($hg_cmd svn info 2>/dev/null | \
> @@ -277,10 +283,10 @@ fi
>
>  [ ${include_metadata} =3D "if-modified" -a ${modified} =3D "yes" ] &&
> include_metadata=3Dyes
>  if [ ${include_metadata} !=3D "yes" ]; then
> -	VERINFO=3D"${VERSION}${svn}${git}${hg} ${i}"
> +	VERINFO=3D"${VERSION}${svn}${git}${gitup}${hg} ${i}"
>  	VERSTR=3D"${VERINFO}\\n"
>  else
> -	VERINFO=3D"${VERSION} #${v}${svn}${git}${hg}: ${t}"
> +	VERINFO=3D"${VERSION} #${v}${svn}${git}${gitup}${hg}: ${t}"
>  	VERSTR=3D"${VERINFO}\\n    ${u}@${h}:${d}\\n"
>  fi
>
> _______________________________________________
> dev-commits-src-all@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
> To unsubscribe, send any mail to
> "dev-commits-src-all-unsubscribe@freebsd.org"
>


--=20
Mateusz Guzik <mjguzik gmail.com>



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