From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 585C51382C5 for ; Tue, 2 Mar 2021 06:34:21 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id B7B83E0AC5; Tue, 2 Mar 2021 06:34:17 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 1299CE09BC; Tue, 2 Mar 2021 03:54:50 +0000 (UTC) Date: Mon, 1 Mar 2021 22:54:45 -0500 From: Matt Turner To: gentoo-dev-announce@lists.gentoo.org Cc: gentoo-dev@lists.gentoo.org Subject: [gentoo-dev-announce] New tool: merge-driver-ekeyword automatically resolves git merge conflicts involving KEYWORDS=... Message-ID: Reply-To: gentoo-dev@lists.gentoo.org Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo development announcement list X-BeenThere: gentoo-dev-announce@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="3AvRJgD3dUnTy/so" Content-Disposition: inline X-Archives-Salt: 17778908-39db-49f6-ba60-f8dd0abcd25e X-Archives-Hash: 4f05a6eb1e199018a59253b92fd3a9b7 --3AvRJgD3dUnTy/so Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline tl;dr: In app-portage/gentoolkit-0.5.1 there's a new tool I wrote, called merge-driver-ekeyword that can automatically resolve git merge conflicts involving the KEYWORDS=... line in ebuilds. Since the KEYWORDS=... assignment is a single line, git struggles to handle conflicts. When rebasing a series of commits that modify the KEYWORDS=... it's usually easier to throw them away and reapply on the new tree than it is to manually handle conflicts during the rebase. git allows a 'merge driver' program to handle conflicts; this program handles conflicts in the KEYWORDS=... assignment. E.g., given an ebuild with these keywords: KEYWORDS="~alpha amd64 arm arm64 ~hppa ppc ppc64 x86" One developer drops the ~alpha keyword and pushes to gentoo.git, and another developer stabilizes hppa. Without this merge driver, git requires the second developer to manually resolve the conflict which is tedious and prone to mistakes when rebasing a long series of patches. With the custom merge driver, it automatically resolves the conflict. To use the merge driver, configure your gentoo.git as such: gentoo.git/.git/config: [merge "keywords"] name = KEYWORDS merge driver driver = merge-driver-ekeyword %O %A %B %P gentoo.git/.git/info/attributes: *.ebuild merge=keywords With that configured, git merge conflicts on the KEYWORDS=... line will be resolved automatically (e.g. during git pull --rebase). Enjoy! --3AvRJgD3dUnTy/so Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQGTBAABCgB9FiEEvu9JS1spHrMAon8T7S7Rn4WzaCwFAmA9twRfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEJF RUY0OTRCNUIyOTFFQjMwMEEyN0YxM0VEMkVEMTlGODVCMzY4MkMACgkQ7S7Rn4Wz aCxGZAf/fy2MgPTDL1Gml+mCcl75sCIjaEiAtf/ZntoSYa3f1P2I5gzl5EAef2r4 bZRD1sVODSL9AJh5vd3G7gNrlVZ6S6AHu9eIkqg1fEADBkVmI0JUmkqVaL/77WEJ wPXiedyMSCRFYIMHVVRQB+WwgOE4M3/ILiuVO6F+p8+NOk7gJcUAiYgFbDGUKBYx sZlSSa71GGdggM6lbltHa65gtYI85IdtxYKonb67pFw0EnxIVrh5JOQKLe8cmTKr CdVGWsNG9tORDHcVqkLmgivBSiYYaJycV3Jws+JPTZoYFN1swMueAOPS0lQSJ1o8 n/quubTKr/AwfDqy6E9CjI3gaNAqRw== =miSi -----END PGP SIGNATURE----- --3AvRJgD3dUnTy/so--