From owner-freebsd-current@freebsd.org Wed Dec 30 15:57:42 2020 Return-Path: Delivered-To: freebsd-current@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 058E14C708B; Wed, 30 Dec 2020 15:57:42 +0000 (UTC) (envelope-from uqs@freebsd.org) Received: from acme.spoerlein.net (acme.spoerlein.net [IPv6:2a05:fc87:1:5::15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "www.spoerlein.net", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D5bXP49fcz3p61; Wed, 30 Dec 2020 15:57:41 +0000 (UTC) (envelope-from uqs@freebsd.org) Received: from localhost (acme.spoerlein.net [IPv6:2a05:fc87:1:5:0:0:0:15]) by acme.spoerlein.net (8.16.1/8.15.2) with ESMTPS id 0BUFvc6f050295 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Wed, 30 Dec 2020 16:57:38 +0100 (CET) (envelope-from uqs@freebsd.org) Date: Wed, 30 Dec 2020 16:57:38 +0100 From: Ulrich =?utf-8?B?U3DDtnJsZWlu?= To: current@freebsd.org, freebsd-current@freebsd.org Subject: Re: git and the loss of revision numbers Message-ID: Mail-Followup-To: current@freebsd.org, freebsd-current@freebsd.org References: <54116640-E6A1-4C53-9D7E-4384F942628E@ellael.org> <8ABAC674-89AA-47BE-996C-4DF6E7713F21@ellael.org> <53dd689b-2401-8e90-f332-50c60c549c2e@FreeBSD.org> <1d1e2003-0cc1-6e67-0ceb-f0fcba03f8f7@twcny.rr.com> <20201229005639.GS31099@funkthat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: User-Agent: Mutt/2.0.1 (2020-11-14) X-Rspamd-Queue-Id: 4D5bXP49fcz3p61 X-Spamd-Bar: / X-Spamd-Result: default: False [0.00 / 15.00]; local_wl_from(0.00)[freebsd.org]; ASN(0.00)[asn:39540, ipnet:2a05:fc87::/32, country:CH] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Dec 2020 15:57:42 -0000 On Mon, 2020-12-28 at 17:06:26 -0800, David Wolfskill wrote: >On Mon, Dec 28, 2020 at 04:56:39PM -0800, John-Mark Gurney wrote: >> monochrome wrote this message on Mon, Dec 28, 2020 at 19:38 -0500: >> > what would be the git command for reverting source to a previous version >> > using these numbers? for example, with svn and old numbers: >> > svnlite update -r367627 /usr/src >> > >> > this is needed often when it blows up for someone tracking current >> >> Get the hash from a commit number: >> $git rev-list --reverse HEAD | tail -n +255241 | head -n 1 >> 3cc0c0d66a065554459bd2f9b4f80cc07426464a >> >> so: >> git checkout $(git rev-list --reverse HEAD | tail -n +255240 | head -n 1) >> .... > >Or save a process: > >git rev-list --reverse HEAD | awk 'NR == 255241 {print; exit 0}' >3cc0c0d66a065554459bd2f9b4f80cc07426464a > >(And thus: >git checkout $(git rev-list --reverse HEAD | awk 'NR == 255241 {print; exit 0}') > >Could also pass the number to awk via the "-v var=value" command-line.) Counting commits will not get you to SVN revision 12345, you need to look at the git notes, they are there for that exact reason. (fun fact, r12345 isn't actually on the main branch, so don't try with that one) % git log --oneline -n1 --notes --grep='revision=12346$' main df4f0253cd89 Use NO_MTREE, not !USE_X11 && !USE_IMAKE, to determine package args. NO_MTREE should work as advertised (for both direct installation and pkg_add) now. Notes: svn path=/head/; revision=12346 So df4f0253cd89 is the corresponding git commit to your SVN r12346 hth Uli