From owner-freebsd-current@freebsd.org Mon Jan 25 07:37:40 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 CD2B54ED02A for ; Mon, 25 Jan 2021 07:37:40 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic303-23.consmr.mail.gq1.yahoo.com (sonic303-23.consmr.mail.gq1.yahoo.com [98.137.64.204]) (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 4DPMCR6Gcgz3FjV for ; Mon, 25 Jan 2021 07:37:39 +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=1611560257; bh=E12tTiG3kA8ytYhEqPJwHGFEWMzUUfpcpYZHmDGmlAX=; h=From:Subject:Date:To:From:Subject:Reply-To; b=Sr5eMr4CNoxKYqmS9midE7Ktu3Gdw56J9APz7dnkEQzjjO2X3yCMMDkatJnJTuWHioDuwmJXIXLEwjCCTrJrVKC6ZsDbp4M4Wnz8761C1dLm2gM0X02XCgSPXsge6gOB2Y6Cc/IxsjrE6US+KjcNMGjx4ue2itBRd446/XVMazhP6DGNY5cXYo8ooUzRjN20/oH906mjQ5bE7TChaBgwX3PlZWJOxhKs5cC/8s8APzVO3KgJnWD2ph1qkilgGOAS7d1HZrTZXZ+h4ApCS6UHZiuR/Nrmk8G+7X6iR3r7pWqyseDXZL5QRNU3zkpO08vGj4DoP0NOt7JUoXY+c6SkQg== X-YMail-OSG: GTxzPCgVM1lJb4KK4B7RAAhXaupByyV7zTyPHVvD0gW.hTobPi5xdK7HnrunnvO tzX4V4UFextyZ6ilIdmUYf8QBuxsbOsXM7cShkYCAl1edjYme.YbMeRLjr9ODQdbCksIBSMK3J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FjQIqKwhCoNyovKPlj8p01ojpMajThYfrOO_TmfK2bKFfwNKCy.df brcn8WO459evic.NwH.BQktLI5LFFknnJMZl6dtl9sFfgi6zA9N2YA.DAljWRkDA2Sf3ptSvqN1z luouThAWtzycIJEBsQx5IpRqoyyVfQ29R.pdM5DtAJTTYD4.P55q3Ts31UaVqHt21Fd00_hse7Wa S.ez9oIwCvwItCR6VVglPfsh3YzZUMH4Em4Xv2YUTAYnrtLDV0w5AvSNPKWa3 Received: from sonic.gate.mail.ne1.yahoo.com by sonic303.consmr.mail.gq1.yahoo.com with HTTP; Mon, 25 Jan 2021 07:37:37 +0000 Received: by smtp410.mail.ne1.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 5ee7b817180d0dbb5d0df5f7a28cb693; Mon, 25 Jan 2021 07:37:36 +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? Message-Id: <14BEA6ED-564D-46AD-857D-F9117D60F76E@yahoo.com> Date: Sun, 24 Jan 2021 23:37:35 -0800 To: mueller6722@twc.com, Current FreeBSD X-Mailer: Apple Mail (2.3654.40.0.2.32) References: <14BEA6ED-564D-46AD-857D-F9117D60F76E.ref@yahoo.com> X-Rspamd-Queue-Id: 4DPMCR6Gcgz3FjV X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.28 / 15.00]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; FREEMAIL_FROM(0.00)[yahoo.com]; 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.775]; 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]; RBL_DBL_DONT_QUERY_IPS(0.00)[98.137.64.204:from]; 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]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; SPAMHAUS_ZRD(0.00)[98.137.64.204:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[98.137.64.204:from]; RWL_MAILSPIKE_POSSIBLE(0.00)[98.137.64.204: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:37:40 -0000 > How cat one track multiple branches with git without keeping entirely=20= > separate trees? There are multiple possibilities here and it is not clear which you are hoping for. A) You could be trying to avoid having two separate .git copies around, each also with checked-out material. (2 separate deep clones.) B) You could be trying to avoid having 1 .git with two directories trees for checkouts. (One deep clone with an added worktree, for example.) 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.) (One deep clone and no additional worktrees.) 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.) (2 separate shallow clones in separate directories, one for each branch.) My guess from your wording is that you are after (C). 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. 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. For building main : # cd /usr/src # git switch --discard-changes main # git fetch freebsd # if advancing # git merge --ff-only freebsd/main # if advancing # . . . vs. for building stable/13 : # cd /usr/src # git switch --discard-changes stable/13 # git fetch freebsd # if advancing # git merge --ff-only freebsd/stable/13 # if advancing # . . . In the above the commit is implicit as the HEAD for the branch named. There is also being more explicit about the commit that you want (branch implicit): # cd /usr/src # git fetch freebsd # if advancing # git reset --hard 08b8197a74 # use appropriate hashid # . . . 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: # git checkout -b NEW_BRANCH_NAME For reference, from my context: # du -sAm /usr/fbsd/main-src/ /usr/fbsd/main-src/.git 2487 /usr/fbsd/main-src/ 1379 /usr/fbsd/main-src/.git So 2487 would estimate (C) as things are now for main or stable/13 . 2487-1379=3D=3D1108 for the implicit, primary worktree that goes with the clone. A additional worktree tied to the above: # du -sAm /usr/fbsd/mm-src/ 1108 /usr/fbsd/mm-src/ So 2487+1108 =3D=3D 3595 total using the additional worktree, i.e., (B). Just for reference for how much space (D) takes: # 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. # du -sAm /usr/fbsd/main-shallow/ /usr/fbsd/main-shallow/.git 1378 /usr/fbsd/main-shallow/ 271 /usr/fbsd/main-shallow/.git (The .git is branch specific only.) 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)