From owner-freebsd-git@freebsd.org Sat May 1 01:35:36 2021 Return-Path: Delivered-To: freebsd-git@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 85C5A5F29D3 for ; Sat, 1 May 2021 01:35:36 +0000 (UTC) (envelope-from david@catwhisker.org) Received: from mx.catwhisker.org (mx.catwhisker.org [107.204.234.170]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4FXBdM28VSz3tZ4 for ; Sat, 1 May 2021 01:35:35 +0000 (UTC) (envelope-from david@catwhisker.org) Received: from albert.catwhisker.org (localhost [127.0.0.1]) by albert.catwhisker.org (8.16.1/8.15.2) with ESMTP id 1411ZXos085418; Sat, 1 May 2021 01:35:33 GMT (envelope-from david@albert.catwhisker.org) Received: (from david@localhost) by albert.catwhisker.org (8.16.1/8.16.1/Submit) id 1411ZXna085417; Fri, 30 Apr 2021 18:35:33 -0700 (PDT) (envelope-from david) Date: Fri, 30 Apr 2021 18:35:33 -0700 From: David Wolfskill To: tech-lists Cc: freebsd-git@freebsd.org Subject: Re: git cherry-pick Message-ID: Reply-To: freebsd-git@freebsd.org References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="xODsafbnC9KOsOiJ" Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4FXBdM28VSz3tZ4 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of david@catwhisker.org designates 107.204.234.170 as permitted sender) smtp.mailfrom=david@catwhisker.org X-Spamd-Result: default: False [-5.39 / 15.00]; ARC_NA(0.00)[]; HAS_REPLYTO(0.00)[freebsd-git@freebsd.org]; FREEFALL_USER(0.00)[david]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:107.204.234.170:c]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[107.204.234.170:from]; DMARC_NA(0.00)[catwhisker.org]; SPAMHAUS_ZRD(0.00)[107.204.234.170:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.99)[-0.993]; RCPT_COUNT_TWO(0.00)[2]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; RCVD_TLS_LAST(0.00)[]; SIGNED_PGP(-2.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:7018, ipnet:107.192.0.0/12, country:US]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[freebsd-git] X-BeenThere: freebsd-git@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Discussion of git use in the FreeBSD project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 May 2021 01:35:36 -0000 --xODsafbnC9KOsOiJ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, May 01, 2021 at 02:09:29AM +0100, tech-lists wrote: > git newbie here. If one has the full git /usr/src repo, and wants to > build for stable/13, what are the commands to "cherry-pick" a commit from= main > and apply it to (local) stable/13?=20 >=20 > thanks, > --=20 > J. I strongly suspect that the most correct succinct answer will be "it depends." Unfortunately, that's not especially useful. So: here is *a* way that worked in this specific set of circumstances: | g1-55(12.2-S)[9] cd /bkp/tmp/ | g1-55(12.2-S)[10] ls -F | ... | g1-55(12.2-S)[11] mkdir src So: I switched over to a place where I had some scratch space (as I have no plans to keep this repository). | g1-55(12.2-S)[12] git clone file:///repo/git/freebsd/src.git src | Cloning into 'src'... I keep a local private mirror of the FreeBSD.org git repo. I could have used "https://git.freebsd.org/src.git", but it would have taken longer, and might have interfered with Spouse's streaming video. | remote: Enumerating objects: 429434, done. | remote: Counting objects: 100% (429434/429434), done. | remote: Compressing objects: 100% (45509/45509), done. | Receiving objects: 100% (3874077/3874077), 1.19 GiB | 32.66 MiB/s, done. | remote: Total 3874077 (delta 411617), reused 386363 (delta 383799), pack-= reused 3444643 | Resolving deltas: 100% (3066950/3066950), done. | Updating files: 100% (86557/86557), done. | g1-55(12.2-S)[13] cd src | g1-55(12.2-S)[14] git branch | cat | * main So this repo is currently using branch "main". I'll find a commit to cherry-pick. | g1-55(12.2-S)[15] git log -n 1 | cat | commit 388c0cde10293d9a3434e99146bf391aec6878a3 | Author: Kristof Provost | Date: Tue Apr 27 18:46:03 2021 +0200 |=20 | pf tests: Test scrub fragment reassemble on interfaces with different= MTU | =20 | There's a problem with pf's reassembly code where it produces incorre= ct | checksums when reassembling across interfaces with different MTUs. | Test this. | =20 | PR: 255432 | Reviewed by: donner | MFC after: 1 week | Sponsored by: Rubicon Communications, LLC ("Netgate") | Differential Revision: https://reviews.freebsd.org/D30013 OK; that seems like a reasonable candidate.... | g1-55(12.2-S)[16] git checkout stable/13 | Branch 'stable/13' set up to track remote branch 'stable/13' from 'origin= '. | Switched to a new branch 'stable/13' I switched to stable/13. | g1-55(12.2-S)[17] git cherry-pick 388c0cde10293d9a3434e99146bf391aec6878a3 | [stable/13 419302f5369] pf tests: Test scrub fragment reassemble on inter= faces with different MTU | Author: Kristof Provost | Date: Tue Apr 27 18:46:03 2021 +0200 | 1 file changed, 49 insertions(+) | g1-55(12.2-S)[18]=20 And that was the cherry-pick. Mind, there exist ... nuances, I suppose. If the commit to be cherry-picked is a merge commit, you will need to provide some addiitonal information (as detailed in the output of "git help cherry-pick"). Caveat: While I do use some of this at work, I am by no means an "expert." I suspect that there may well be "sharp edges" in some of this stuff. I suggest that if you have the resources to do so, you experiment with an expendable copy of your repo first. Oh: after all that: | g1-55(12.2-S)[18] git status=20 | On branch stable/13 | Your branch is ahead of 'origin/stable/13' by 1 commit. | (use "git push" to publish your local commits) |=20 | nothing to commit, working tree clean | g1-55(12.2-S)[19]=20 Peace, david --=20 David H. Wolfskill david@catwhisker.org "some of the terminology that was used, like 'hugs and kisses,' and 'very fine people,' is like very different from what I experienced and what my co-workers experienced on the 6th." - Michael Fanone, DC Metro Police Offic= er See https://www.catwhisker.org/~david/publickey.gpg for my public key. --xODsafbnC9KOsOiJ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGTBAEBCgB9FiEE4owz2QxMJyaxAefyQLJg+bY2PckFAmCMsGVfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEUy OEMzM0Q5MEM0QzI3MjZCMTAxRTdGMjQwQjI2MEY5QjYzNjNEQzkACgkQQLJg+bY2 PcnEBQf/dEs7yt+gdrmgePlfQQig5xPYOsgcYzLeXUaVyK3yMa+pou8oOnRjrCev 6C3ZZp7kbbua/B4bSLHw29aOjiezqcxio+Qt+t+Rdh6gT2SV7OTCXLgpTMCBWji7 VxUDprXEGY5rb6rCb/bRaizbF2Qm17SW9yC1ypAv6zjj3YCVpQaXiQTxrBs4pS7Z EsO27ZebuWeH/JydxXNNLu2cnPoz9dFGhkQMZ5x21adSj0ZbXenPxSJH9kW7aWid mdxlngTTgiht5BupYd1RlhZ8tIaDC6S4uydoSNis8Lj+5SP8VBBeNDfMYGrwbRk3 /05Q4OwRjNpSI7uMCCuG1QwNvh1wCg== =QBIc -----END PGP SIGNATURE----- --xODsafbnC9KOsOiJ--