From owner-freebsd-current@freebsd.org Mon Jan 25 19:35:13 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 A9E784EDEC1 for ; Mon, 25 Jan 2021 19:35:13 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qv1-xf36.google.com (mail-qv1-xf36.google.com [IPv6:2607:f8b0:4864:20::f36]) (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 4DPg7N5Rmzz4vCy for ; Mon, 25 Jan 2021 19:35:12 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qv1-xf36.google.com with SMTP id dj6so6757423qvb.1 for ; Mon, 25 Jan 2021 11:35:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=1XU2u8snvX66Kkrdw4JwURUq4We/L+KZZwb1GsmYj3k=; b=XwJvKwkaLRf1ZAEPqo10OOY5aiQwP8pH//25yBVfU6G6QkvTFwNEtVYDstofLohtYk fbbOUvrb8GFp5XAQsDLYiQFSX+owjwdaaLsVWQxKF8sM1wE0ffIMYPEY2Xou9c3/V1UW 0ilwDIe/AyRDUz1tjouPRqV4LmrtjKejuokydQmfuAcehhJ+wkn7faue2YBBQxO9uRcB 9pVKFDK/+YZ/WcJz3CJq3We3zg0t0gflczueAUDLXK0rdq3DLFYdGZk4QTAUYTEmoPTE +qpEJLuB9URS+FVWiV+5ZLX3VFmNU9lpPRHY47EUTBEiH4tK5IbKUxbQ1bCmCuotAk2N fc0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=1XU2u8snvX66Kkrdw4JwURUq4We/L+KZZwb1GsmYj3k=; b=pQTa2MKj7TraJoPYp2h4/LWRiEbQLX8MNllOZyGcbwzjgN+vMVD6QcHNwklzHnSXRu V4ieey75ffN9yWBju2NDR5wH3orGwjQQKm3sRvtfyRkVjWDIYgnB4M5VXCuDHzXbgLZV l1294wn9/TKZTTHjBCXyHTamuEEEwemXnevtw7BnqJ30pNNcedZJPXQv5lAx399xSKYY ItC5gjb1nYj5dm6O5KVME9HtkYWqeZ/5uhz4+ENffVqfolQxemeU32P+8OXojiiMzQm8 0F+agU77chbyBd3DHqp3ELeSfjlkx4grXCajzxjN56oEYU2aXZRLoypI44ZUYuNNeN9t S4aQ== X-Gm-Message-State: AOAM530WDyHij4YDb6Pjv+PiCHq2EYVhvAWxN9c4iG7jiJoF8AGBw0o5 gIpjwyujMFe6AKI3nNX5jD0XiB6whexWWkZkNUcxuQ== X-Google-Smtp-Source: ABdhPJwTNHBezUm7+xLN7S3HotTRSk57jZ1TlGcH0EctzXTiSDEfhYTgHeXzqsDW9mVIwt6uKB6AndUbLCXGoEn0Vho= X-Received: by 2002:a0c:80ca:: with SMTP id 68mr2303573qvb.28.1611603311982; Mon, 25 Jan 2021 11:35:11 -0800 (PST) MIME-Version: 1.0 References: <77a956396fd05d21ccd23d865fca9c6f@bsdforge.com> <20210126.031127.811432923528445023.yasu@utahime.org> In-Reply-To: From: Warner Losh Date: Mon, 25 Jan 2021 12:35:00 -0700 Message-ID: Subject: Re: using git to get a particular version of src To: Yasuhiro Kimura Cc: FreeBSD Current X-Rspamd-Queue-Id: 4DPg7N5Rmzz4vCy X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=XwJvKwka; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::f36) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-3.00 / 15.00]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-current@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; SPAMHAUS_ZRD(0.00)[2607:f8b0:4864:20::f36:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::f36:from]; NEURAL_HAM_SHORT(-1.00)[-1.000]; R_SPF_NA(0.00)[no SPF record]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RBL_DBL_DONT_QUERY_IPS(0.00)[2607:f8b0:4864:20::f36:from]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; MAILMAN_DEST(0.00)[freebsd-current]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.34 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 19:35:13 -0000 On Mon, Jan 25, 2021 at 11:55 AM Warner Losh wrote: > > > On Mon, Jan 25, 2021 at 11:11 AM Yasuhiro Kimura wrote: > >> From: Chris >> Subject: Re: using git to get a particular version of src >> Date: Mon, 25 Jan 2021 09:21:44 -0800 >> >> >> Hi, >> >> I have this version installed: >> >> 13.0-CURRENT #0 2ed50808d2b-c254384(main): Thu Nov 12 10:03:35 UTC >> >> 2020 >> >> I'd like to get the sources for this (want to make a no-debug kernel) >> >> as I know >> >> this version works on this hardware. >> >> But -current has gone to 14 and what was -current is now >> >> 13-stable. What git >> >> incantation is required to get 2ed50808d2b-c254384 sources, given an >> >> empty >> >> /usr/src and git method of ssh://anongit@git.freebsd.org ? >> > I am by *no* means a GIT expert >> > but will >> > cd /usr/src >> > git up 2ed50808d2b >> > accomplish your intended task? >> >> Unfortunately it doesn't work as is expected in this case because hashes >> of src repostory changed on Dec 6 when it was still beta. >> >> HEADS UP: src hashes will respin/change this Sunday >> https://lists.freebsd.org/pipermail/freebsd-git/2020-December/000548.html >> >> In original case it was after this change so hash value can be used to >> checkout it. But this case is befere hash change. So there isn't hash >> 2ed50808d2b in current src repository any more. >> >> I also faced this problem when I tried to checkout source tree that >> corresponds to 20201119 snapshot of 13-CURRENT. Fortunately I still >> kept ISO image of it. So I did following steps to get the source tree. >> >> 1. Mount the ISO image >> 2. Extract src.txz in the ISO image to somewhere (e.g. /tmp/usr/src) >> 3. cd /usr >> 4. git clone https://git.freebsd.org/src.git >> 5. cd src >> 6. Checkout 65c207758a9 that was committed at Thu Nov 19 21:10:36 >> 2020 +0000 (the last one committed on Nov 19, 2020) >> 7. diff -ru /tmp/usr/src /usr/src >> 8. If there are any differences, checkout f9fe7b28bc2 that is just >> previous commit of 65c207758a9 >> 9. Repeat step 7 and 8 until there is no difference between >> /tmp/usr/src and /usr/src. >> > > We should see how hard it would be to convert c254384 into a git hash... > > So, for me: > > % git describe > vendor/tzdata/tzdata2020f-255971-gfa6662b3689e (so my tip of main is > 255971 vs 254384 or +1587) > % git log -1 main~1587 > commit dda1987fe5dbf418b55195990896b0ef0a5b8e4a > Author: Mateusz Piotrowski <0mp@FreeBSD.org> > Date: Tue Nov 17 12:04:29 2020 +0000 > > Add an example for the -s flag > > which is a little late. If you checked out the source and built it ASAP, > then I'd suggest: > > commit f14436adc61a52b29d035791c0b90c0b221bea9a > Author: Hans Petter Selasky > Date: Thu Nov 12 09:26:01 2020 +0000 > > Add a tunable sysctl, hw.usb.uaudio.handle_hid, to allow disabling the > the HID volume keys support in the USB audio driver. > > which is the version just before that. Or if you installed from a snapshot > and rebuilt, The 20201112 snapshot was likely built from > > commit 38033780a3f4ed616d638fc0e9ef9a4d309f1fb3 > Author: Kyle Evans > Date: Wed Nov 11 22:35:23 2020 +0000 > > umtx: drop incorrect timespec32 definition > Oh! git describe is the wrong thing. We're using git rev-list --count, so: % git rev-list --count main 256115 % echo $((256115-254384) 1731 % git log -1 main~1731 git log -1 main~1731 commit 94275e3e698b223ccc42e3a637b6667216ca6360 Author: Mateusz Guzik Date: Tue Nov 10 01:31:06 2020 +0000 threads: remove the unused TID_BUFFER_SIZE macro But, there's a problem, or a disconnect. git rev-list counts both the commits on main, and the number of commits for merge commits that are on the second parent back to the last common ancestor. this is surprising behavior, and we'll likely change it, but for systems before the change you need to do some searching: % git rev-list --count main~1731 254360 % git rev-list --count main~1707 254384 So this is the one you really want: commit 26007fe37c06fe0b61634083befb7f9eb87c08c0 Author: Mateusz Guzik Date: Wed Nov 11 08:51:04 2020 +0000 thread: add more fine-grained tidhash locking (that's assuming the commit counts from before the re-hashing were identical, which I have no way of knowing or testing). The truth is, though, any of these will likely be 'good enough' to have a working system. Warner