Gentoo Archives: gentoo-portage-dev

From: Zac Medico <zmedico@g.o>
To: gentoo-portage-dev@l.g.o, Matt Turner <mattst88@g.o>
Cc: Zac Medico <zmedico@g.o>
Subject: Re: [gentoo-portage-dev] [PATCH gentoolkit] bin: Add merge-driver-ekeyword
Date: Thu, 31 Dec 2020 20:05:55
Message-Id: 7af7ae3d-cb05-1c1f-4d70-735cf089fed4@gentoo.org
In Reply to: [gentoo-portage-dev] [PATCH gentoolkit] bin: Add merge-driver-ekeyword by Matt Turner
1 On 12/31/20 11:47 AM, Matt Turner wrote:
2 > Since the KEYWORDS=... assignment is a single line, git struggles to
3 > handle conflicts. When rebasing a series of commits that modify the
4 > KEYWORDS=... it's usually easier to throw them away and reapply on the
5 > new tree than it is to manually handle conflicts during the rebase.
6 >
7 > git allows a 'merge driver' program to handle conflicts; this program
8 > handles conflicts in the KEYWORDS=... assignment. E.g., given an ebuild
9 > with these keywords:
10 >
11 > KEYWORDS="~alpha amd64 arm arm64 ~hppa ppc ppc64 x86"
12 >
13 > One developer drops the ~alpha keyword and pushes to gentoo.git, and
14 > another developer stabilizes hppa. Without this merge driver, git
15 > requires the second developer to manually resolve the conflict which is
16 > tedious and prone to mistakes when rebasing a long series of patches.
17 > With the custom merge driver, it automatically resolves the conflict.
18 >
19 > To use the merge driver, configure your gentoo.git as such:
20 >
21 > gentoo.git/.git/config:
22 >
23 > [merge "keywords"]
24 > name = KEYWORDS merge driver
25 > driver = merge-driver-ekeyword %O %A %B %P
26 >
27 > gentoo.git/.git/info/attributes:
28 >
29 > *.ebuild merge=keywords
30 >
31 > Signed-off-by: Matt Turner <mattst88@g.o>
32 > ---
33 > v3: Address Zac's feedback: use tempfile.TemporaryDirectory
34
35 Looks great!
36 --
37 Thanks,
38 Zac

Attachments

File name MIME type
signature.asc application/pgp-signature