Re: [PATCH gentoolkit] bin: Add merge-driver-ekeyword

Zac Medico <[email protected]> Thu, 31 Dec 2020 12:05:50 -0800
Newsgroups gmane.linux.gentoo.portage.devel
Message-ID <[email protected]>
On 12/31/20 11:47 AM, Matt Turner wrote:
> 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
> 
> Signed-off-by: Matt Turner <[email protected]>
> ---
> v3: Address Zac's feedback: use tempfile.TemporaryDirectory

Looks great!
-- 
Thanks,
Zac
signature.asc (application/pgp-signature, 981 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQKTBAEBCgB9FiEE8OgXaltWzqgSupCu0HX7jBBKPSAFAl/uLx5fFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEYw
RTgxNzZBNUI1NkNFQTgxMkJBOTBBRUQwNzVGQjhDMTA0QTNEMjAACgkQ0HX7jBBK
PSCaqRAAx14T2+fjbvH8banQOhOw8+l7+VdRVVaoGEZAwXZwDPmiI8SuqXlFM4A+
D9/nmyzU1eqyvdfHW3+mGL6BUMfcWOnK1o5OaxwJXN4ezH1ugnlPs2U0Br30Jt7m
IfSOaXgZobbIU1qfEJ+B+jxQFJE22PWCKlqk/PCzrJsLlk9jO+unmDcNRj0aUJKD
oEjA1t5Eppczub3+qSw3GoJAPvkWFn8mQF2oWfot2zbE23jddhhW2QMY4xojUpPB
+KIVazp11pCtv/jxMuUoPIChDQFgaILTVNCjfk7sRXQ1M93+5fcGYWMXvUbMq6sY
XTXm+vF2TiG1R/ORna77aD61+rqwrJaj9J2MHAMfDeMRpcSfnjTZbfwCxBvMZxoj
GxXc6dOKXfKqEwaSBDjG3JlvV9WDYpC/Ycdko/xLytSvqesEDAhn03W5nopzaYBz
0R6pPZ2/e+O0pxGRrqTUqwFZF8e6q8eK5Thr3krdNMAmVdeDDP/eQUZWdjAGkNfb
ZgjzUUNYID7LJemR+ij+yaVbz4gVozK6/FgOFSfurgJzpkV1qQbxbHB90vix/4GG
g7xNrvKk1A1H6/DDS7hpNJwKy5vcxEPSmz7kvKDvXdpAsnfEKgSdZ2nZa/lMFy8l
4S3n3KfU5A5c2J87cUvAzUkSLvq+PPu4GbFsr4xTsrc5MGof+qc=
=19Sb
-----END PGP SIGNATURE-----