From owner-freebsd-current@freebsd.org Mon Jan 25 00:21:03 2021 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 2DE444E095C for ; Mon, 25 Jan 2021 00:21:03 +0000 (UTC) (envelope-from monochrome@twcny.rr.com) Received: from p-impout004.msg.pkvw.co.charter.net (p-impout004aa.msg.pkvw.co.charter.net [47.43.26.135]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DP9Wd703cz4nwZ for ; Mon, 25 Jan 2021 00:21:01 +0000 (UTC) (envelope-from monochrome@twcny.rr.com) Received: from [192.168.13.11] ([45.47.45.55]) by cmsmtp with ESMTP id 3pcpllZKZT9mm3pcqlmvOn; Mon, 25 Jan 2021 00:21:00 +0000 X-Authority-Analysis: v=2.3 cv=QZ4YQfTv c=1 sm=1 tr=0 a=oJ4f3sEZGTo/oTi6ieWQlw==:117 a=oJ4f3sEZGTo/oTi6ieWQlw==:17 a=IkcTkHD0fZMA:10 a=6I5d2MoRAAAA:8 a=8sGWOcEv3BgnjkXGjtcA:9 a=QEXdDO2ut3YA:10 a=IjZwj45LgO3ly-622nXo:22 Subject: Re: Getting /usr/src to match specific git hash? To: freebsd-current@freebsd.org References: <20210124041403.GB73653@troutmask.apl.washington.edu> <20210124191445.GA76809@troutmask.apl.washington.edu> <20210124224046.GA77416@troutmask.apl.washington.edu> From: monochrome Message-ID: Date: Sun, 24 Jan 2021 19:20:59 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 In-Reply-To: <20210124224046.GA77416@troutmask.apl.washington.edu> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-CMAE-Envelope: MS4wfOvVcMWcW9I87YVQLJYzQ2rcs+5xybaErHbhwEOJOvDpG7nG2VYOplgrphyBJ1elgs+Md7xstdOfiKroJysiEN4CDGp01eOFG53SjZml/OsuZvPn/ZSy INlGsXQjp9i4HgXSQ7jnHcM3kUXYRLoEwI4xJlWiOBq6vZ6X2es+Ju5k8PH005GaJVMJE7UgLVxumQ== X-Rspamd-Queue-Id: 4DP9Wd703cz4nwZ X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of monochrome@twcny.rr.com designates 47.43.26.135 as permitted sender) smtp.mailfrom=monochrome@twcny.rr.com X-Spamd-Result: default: False [-2.30 / 15.00]; RCVD_TLS_LAST(0.00)[]; ARC_NA(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RWL_MAILSPIKE_VERYGOOD(0.00)[47.43.26.135:from]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:47.43.26.0/24]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[rr.com]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-1.000]; RECEIVED_SPAMHAUS_PBL(0.00)[45.47.45.55:received]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; RCVD_IN_DNSWL_NONE(0.00)[47.43.26.135:from]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:40294, ipnet:47.43.24.0/21, country:US]; SUBJECT_ENDS_QUESTION(1.00)[]; MAILMAN_DEST(0.00)[freebsd-current]; RCVD_COUNT_TWO(0.00)[2] 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: Mon, 25 Jan 2021 00:21:03 -0000 after looking in the git log for the hash I use: git -C /usr/src reset --hard you will lose any local changes On 1/24/21 5:40 PM, Steve Kargl wrote: > On Sun, Jan 24, 2021 at 03:22:18PM -0700, Warner Losh wrote: >> On Sun, Jan 24, 2021, 12:14 PM Steve Kargl >> wrote: >> >>> >>> Any advice on how to jump, say, 4 days ahead of the current >>> date of the src/ tree? That is, I have src/ that should >>> correspond to 24 Dec 2020. How do I jump to 28 Dec 2020? >>> >> >> You could use git bisect, but as you say, the laundry list is extensive. >> >> Git doesn't offer checkout by date, alas. So here's some tools to help you >> out. >> >> First, let's get a count of how many commits behind main you are at the >> moment. Use 'git log --oneline --first-parent HEAD..main | wc' to get a >> count of the number of commits between what you have checked out and the >> tip of current. My count is 994, but I just updated, so your count will >> differ and that's OK.The --first-parent in the git log above is critical, >> since otherwise a number of commits from vendor merges in the vendor >> branches will appear in git log's output, throwing the count off). >> >> Now, this is 1 month worth of -current. 4 days in the month is about 13%. >> However, let's keep things simple and step forward 100 commits at a time >> (which is 10% of 1000). The precise numbers don't matter, but it works out >> well in this case. >> >> So, your commit is: >> % git log -1 3cc0c0d66a0 >> Author: Li-Wen Hsu >> Date: Sun Dec 20 02:59:44 2020 +0000 >> >> Mark the repository as being converted to Git. >> >> which is the last subversion commit. It's also head~994, you can do a 'git >> log -1 main~900' to verify that. So, let's move forward 94 commits. This >> would be: >> >> % git log main~900 >> commit 8d405efd73d3991fe1647f91a2b7c9989dd5f18f >> Author: Ulrich Sprlein >> Date: Wed Dec 23 22:29:34 2020 +0100 >> >> Fix newvers.sh to no longer print an outdated SVN rev >> >> which is 3 days newer and may be a good place to start: >> >> % git checkout main~900 >> >> and that will move you forward 94 commits. Do it again with main~800, etc >> to find a spot that's good for you. Not as convenient as giving dates, but >> once you have a count of the number of commits between where you are and >> head, you can use that number to decide how far forward to go. >> >> You can adjust this as needed. If you don't do a git pull during this >> process (and you likely shouldn't) these numbers will be stable, and a lot >> easier to work with than hashes. I've found I like to move N commits rather >> than N days. >> >> Hope this is helpful. Sadly I found no way to say HEAD+50 commits directly >> in git, but maybe one of the more knowledgeable folks on this list can give >> a better hint there. >> >> Warner > > Thanks for the thorough reply! After David's response > I started to think (yes, I should do that more often) > about the mailing list archive dev-commits-src-main. > Each subject line starts with, for example, > "git: 68dc94c7d314 - main -". I assume that the hash > value is sufficient to grab a src/ up to and including > the commit. Will the following > > % cd /usr/src # This is at 3cc0c0d66a0 > % git checkout 68dc94c7d314 # Update to last commit in 2020. > > bring the src/ update to 68dc94c7d314 or do > I need to use 'git pull 68dc94c7d314'? >