From owner-freebsd-current@freebsd.org Tue Dec 29 14:37:55 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 2879E4C1296 for ; Tue, 29 Dec 2020 14:37:55 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4D4xpp4l02z4f06 for ; Tue, 29 Dec 2020 14:37:54 +0000 (UTC) (envelope-from avg@FreeBSD.org) X-Originating-IP: 195.64.148.76 Received: from [192.168.0.24] (unknown [195.64.148.76]) (Authenticated sender: andriy.gapon@uabsd.com) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 45D47E0009; Tue, 29 Dec 2020 14:37:51 +0000 (UTC) To: Pete Wright , monochrome , 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> <6a83684d-ee5b-5002-3553-7b383f02768c@nomadlogic.org> From: Andriy Gapon Subject: Re: git and the loss of revision numbers Message-ID: Date: Tue, 29 Dec 2020 16:37:49 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <6a83684d-ee5b-5002-3553-7b383f02768c@nomadlogic.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4D4xpp4l02z4f06 X-Spamd-Bar: / X-Spamd-Result: default: False [0.00 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; ASN(0.00)[asn:29169, ipnet:217.70.176.0/20, country:FR] 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: Tue, 29 Dec 2020 14:37:55 -0000 On 2020-12-29 02:56, Pete Wright wrote: > > On 12/28/20 4:38 PM, monochrome wrote: >> 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 >> > I will generally just checkout the short git hash like so in my local > checkout: > $ git checkout gb81783dc98e6 > > you can quickly get the hashes by running "git log" from your checkout. I think that git checkout is a wrong tool here. I personally would use git reset --hard . Note that that command would also revert any local uncommitted changes as well! My view of the difference between the commands: - checkout: stage[*] a change that would modify the current state of the branch to the selected commit's state - reset: change the current branch (its head) to point to the selected commit [*] by stage I mean modify the working copy and the index. That is, if after git checkout you would run git commit then you would commit a change that reverts the current branch to the selected point. -- Andriy