From owner-freebsd-current@freebsd.org Mon Jan 25 07:46:44 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 3692D4ED617 for ; Mon, 25 Jan 2021 07:46:44 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic310-20.consmr.mail.gq1.yahoo.com (sonic310-20.consmr.mail.gq1.yahoo.com [98.137.69.146]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4DPMPv2JBpz3G4v for ; Mon, 25 Jan 2021 07:46:42 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1611560801; bh=h1QUC/wzR1lA4Jt59F+HnD5OLKIKkVKvOS+WQhqNLyq=; h=From:Subject:Date:To:From:Subject:Reply-To; b=YGa+d0SCldspV/ywaXfVilHyWpybey6w85czi/7YWN5eParoFjpwuuNCaENouLdzTPyaEGzd3HlJI8AGe+rlkIImk/kaIk2MPyb2wtdP9NuifF8LFX4gO49TS2bpC+uSIrIAScZ2iwtGzsALkCbDx6/GiFv2v4ZFn7mm5+YAebxpQdnd6B5mWo9ERsjt9tHoiEIgBbq7cDfd0LTsAS9RLsl09ymBAmvcztjOWAT7qMsAh5q2e2bGlHFdEyrYxhYTdXv+VnR+dMeSX1A0C0Fwuf4YzHyCZRGCi7GSUumlUei4eYnYnE4q+tHj1EOwJK5ZGmu04dIWjUxus/A45l3azw== X-YMail-OSG: wiEwi9MVM1lGZbsqFdV1VvqOUQ201cMCsyeig1TJjkdNKakN8.P0Rb04uGhmr.y efLSOBRqCfcSstBarXl6PXJDCdpJh7o5cX3uMSooUFv9jMi_Djud.So6I4S4.vgwHTHPjmDP_JgH Kyf7Ic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vbHBSveY55b9UsAgiCXHWGFR8SShQiBAdPFyboOSoDo1qOHF2GzWIseQxr6hQ1 Sso1ZedGx56MA6FKYMdLGKfVnT8IBPmOtHo.4V.54Jlkis9G0o_RTjwGmHQrJnBJHo79oXNLajNR tnwrdan9qldGMuItJOWD_r4o.fHbjGtW9lU2C3d9La30m3QvTREi36H52GE_GsmIo_SvylBV.KcX 6LVX54GjOZo_UyHSw_arUzDFOTpBgqmqCe8QdwVJYTw0gyeq4i3rXu_gGig-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic310.consmr.mail.gq1.yahoo.com with HTTP; Mon, 25 Jan 2021 07:46:41 +0000 Received: by smtp411.mail.ne1.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 48db3be930bc5880ebe83f3c50981942; Mon, 25 Jan 2021 07:46:40 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.40.0.2.32\)) Subject: Re: Getting /usr/src to match specific git hash? Date: Sun, 24 Jan 2021 23:46:38 -0800 References: <14BEA6ED-564D-46AD-857D-F9117D60F76E.ref@yahoo.com> <14BEA6ED-564D-46AD-857D-F9117D60F76E@yahoo.com> To: mueller6722@twc.com, Current FreeBSD In-Reply-To: <14BEA6ED-564D-46AD-857D-F9117D60F76E@yahoo.com> Message-Id: X-Mailer: Apple Mail (2.3654.40.0.2.32) X-Rspamd-Queue-Id: 4DPMPv2JBpz3G4v X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.28 / 15.00]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[yahoo.com]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; DKIM_TRACE(0.00)[yahoo.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; NEURAL_HAM_SHORT(-0.78)[-0.778]; FREEMAIL_TO(0.00)[twc.com,freebsd.org]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/20, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[yahoo.com:dkim]; SUBJECT_ENDS_QUESTION(1.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FROM_HAS_DN(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[98.137.69.146:from]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; SPAMHAUS_ZRD(0.00)[98.137.69.146:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[98.137.69.146:from]; RWL_MAILSPIKE_POSSIBLE(0.00)[98.137.69.146:from]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[freebsd-current] 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 07:46:44 -0000 On 2021-Jan-24, at 23:37, Mark Millard wrote: >=20 >> How cat one track multiple branches with git without keeping entirely=20= >> separate trees? >=20 > There are multiple possibilities here and it is not > clear which you are hoping for. >=20 > A) You could be trying to avoid having two separate .git > copies around, each also with checked-out material. >=20 > (2 separate deep clones.) >=20 > B) You could be trying to avoid having 1 .git with > two directories trees for checkouts. >=20 > (One deep clone with an added worktree, for example.) >=20 > C) You could be trying to have one .git copy and only > one directory tree with only one checkout at a time. > (In some contexts, this sort of thing might involve > considerable time and I/O for switching the content > of the directory tree to be the checkout of a > different branch. main vs. stable/13 now vs. > 3 years from now might be different.) >=20 > (One deep clone and no additional worktrees.) >=20 > D) Sort of like (A) but using 2 Shallow Clones, one per > branch. (This uses somewhat more space than (C), > but not a lot more.) >=20 > (2 separate shallow clones in separate directories, > one for each branch.) >=20 > My guess from your wording is that you are after (C). >=20 > I presume no local modifications/patches and do not > cover how to handle having such. The command sequences > shown would destroy local changes. It is not clear if > such matches what you are after or not. >=20 > I presume below /usr/src/ use for where the clone was > put. It also presumes the fetch status is recent enough > to contain the commit that you want to use. >=20 > For building main : >=20 > # cd /usr/src > # git switch --discard-changes main > # git fetch freebsd # if advancing > # git merge --ff-only freebsd/main # if advancing > # . . . >=20 > vs. for building stable/13 : >=20 > # cd /usr/src > # git switch --discard-changes stable/13 > # git fetch freebsd # if advancing > # git merge --ff-only freebsd/stable/13 # if advancing > # . . . >=20 > In the above the commit is implicit as the > HEAD for the branch named. >=20 > There is also being more explicit about the > commit that you want (branch implicit): >=20 > # cd /usr/src > # git fetch freebsd # if advancing > # git reset --hard 08b8197a74 # use appropriate hashid > # . . . On review, I forgot that git reset --hard can create untracked files and such. So I add a git clean -f -d to the sequence: # cd /usr/src # git fetch freebsd # if advancing # git reset --hard 08b8197a74 # use appropriate hashid # git clean -f -d # . . . > This "reset --hard" command produces a "detached HEAD" > notice that you can either ignore --or you can then > create a local branch that uses that HEAD: >=20 > # git checkout -b NEW_BRANCH_NAME >=20 >=20 > For reference, from my context: >=20 > # du -sAm /usr/fbsd/main-src/ /usr/fbsd/main-src/.git > 2487 /usr/fbsd/main-src/ > 1379 /usr/fbsd/main-src/.git >=20 > So 2487 would estimate (C) as things > are now for main or stable/13 . >=20 > 2487-1379=3D=3D1108 for the implicit, primary > worktree that goes with the clone. >=20 > A additional worktree tied to the above: >=20 > # du -sAm /usr/fbsd/mm-src/ > 1108 /usr/fbsd/mm-src/ >=20 > So 2487+1108 =3D=3D 3595 total using the additional > worktree, i.e., (B). >=20 > Just for reference for how much space (D) takes: >=20 > # git clone -o freebsd --depth 1 -b main = https://git.freebsd.org/src.git /usr/fbsd/main-shallow > Cloning into '/usr/fbsd/main-shallow'... > remote: Enumerating objects: 88695, done. > remote: Counting objects: 100% (88695/88695), done. > remote: Compressing objects: 100% (76042/76042), done. > remote: Total 88695 (delta 18867), reused 51008 (delta 9483), = pack-reused 0 > Receiving objects: 100% (88695/88695), 258.57 MiB | 9.14 MiB/s, done. > Resolving deltas: 100% (18867/18867), done. > Updating files: 100% (85161/85161), done. >=20 > # du -sAm /usr/fbsd/main-shallow/ /usr/fbsd/main-shallow/.git > 1378 /usr/fbsd/main-shallow/ > 271 /usr/fbsd/main-shallow/.git >=20 > (The .git is branch specific only.) >=20 > So about 2*1378 =3D=3D 2756 total to also have a separate one for > stable/13 in, say, /usr/fbsd/stable-13-shallow/ . =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar)