From owner-dev-commits-src-main@freebsd.org Thu Jan 21 10:36:48 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DF1A84F1138; Thu, 21 Jan 2021 10:36:48 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DLzN01dwQz3k0v; Thu, 21 Jan 2021 10:36:47 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wm1-x333.google.com with SMTP id 190so1012778wmz.0; Thu, 21 Jan 2021 02:36:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=/GJe7RaNHEah7hbkvVFWl5abFxH1NvTN8kfo3RI8Rlo=; b=gh7ulUDTHlPZfdC8/rJY1qTXj0cOQS9PBTFBRLDBQ4rCHoOlRXMu0xM5LYozsfj5x3 DY+t2XWGjF5Vpi9zy873pUjwGqbl3s56d3SzwpvSRTUCoQB8T36PIzhP9FipUm77sqoM Um4lJ9GBPlu/L8Oe5IzIbiYv32d/v/csaQq2TIBVU1IqIHjpQTDIhsNLZzijCIn8IykM O21diinatc9saZMZ+75kf5vTLulDp0MDmlzmLcgA2IvY4aX5nA1lbEtZh/e6g9+YBygo 4gEqzqkfYW9QlYDPYt5eIj8Ygir7vl1a6zpbobQ6cQZIRW0Bm6Ha4Hcvx/UcAK3BHlpQ wJsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=/GJe7RaNHEah7hbkvVFWl5abFxH1NvTN8kfo3RI8Rlo=; b=N1fd5L4AmTSaftWnFUUb6qvhY8M2CQf6vN8ZOgA1qFkccLRnYWRCOY/baE1dvU+FRZ J3JnTHF7NSu+rFNxFYWRM1k7rReNBTpvtpes7U6WLyZaBE74dOj+zjUfhczhzD5E5oja Iq+1310zh/VVayi30MZ5q7NUH8NRHGG9tzktxH4JR7eLfeQ2dpxcxIL4Lk24CsUKqf9t FxlJdOlLmEBEmMupNCjmV9SJ3xaCHe/AlFKjWCcFW5TmJudk8NHfhSY2J/WQQIXXcRU6 u4tsPtO4f1YatJK0txjjZTQesBkQPCE1Q7XGM0ZDvavlktc066aqXbME+DzzpMwd6p/C 2lDw== X-Gm-Message-State: AOAM531PiHOYuVPXA7l5DfL91XqkiEsiQpI/8f7oZJakd9lGS+xb/YcJ iOhzqS9hjvHkiVNgSQanosYwNwf9K6V0vx4SSWRvPn/caOI= X-Google-Smtp-Source: ABdhPJyzpnzu3fplwXac8SJ5ZCCoy+EIFGNf3VaYuY8yu/sFskeoO7NCT9J0s402kZD/CGPyYe9H6qW6HAU20TXqiLk= X-Received: by 2002:a1c:bbc6:: with SMTP id l189mr1615906wmf.187.1611225405371; Thu, 21 Jan 2021 02:36:45 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a5d:464c:0:0:0:0:0 with HTTP; Thu, 21 Jan 2021 02:36:43 -0800 (PST) In-Reply-To: <202101200949.10K9nmkZ029085@gitrepo.freebsd.org> References: <202101200949.10K9nmkZ029085@gitrepo.freebsd.org> From: Mateusz Guzik Date: Thu, 21 Jan 2021 11:36:43 +0100 Message-ID: Subject: Re: git: a9fc14fbf445 - main - newvers.sh: add support for gitup(1) To: =?UTF-8?Q?Ulrich_Sp=C3=B6rlein?= Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4DLzN01dwQz3k0v X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=gh7ulUDT; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of mjguzik@gmail.com designates 2a00:1450:4864:20::333 as permitted sender) smtp.mailfrom=mjguzik@gmail.com X-Spamd-Result: default: False [-4.00 / 15.00]; ARC_NA(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[2a00:1450:4864:20::333:from]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; TO_DN_SOME(0.00)[]; SPAMHAUS_ZRD(0.00)[2a00:1450:4864:20::333:from:127.0.2.255]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::333:from]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[dev-commits-src-all,dev-commits-src-main]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jan 2021 10:36:48 -0000 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 wrote: > The branch main has been updated by uqs: > > URL: > https://cgit.FreeBSD.org/src/commit/?id=3Da9fc14fbf445cffd18f34f6a602bdba= 84bb5a867 > > commit a9fc14fbf445cffd18f34f6a602bdba84bb5a867 > Author: Michael Osipov > AuthorDate: 2021-01-05 10:48:39 +0000 > Commit: Ulrich Sp=C3=B6rlein > 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 > 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 > 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