Gentoo Archives: gentoo-dev

From: Duncan <1i5t5.duncan@×××.net>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] Re: On banning merge commits
Date: Sun, 08 May 2016 08:58:59
Message-Id: pan$9c39$d6505e0b$cd73fa9e$1bdddc27@cox.net
In Reply to: Re: [gentoo-dev] On banning merge commits by cbergstrom@pathscale.com
1 cbergstrom posted on Sun, 08 May 2016 13:44:43 +0800 as excerpted:
2
3 > Don't be crazy - I know many developer groups which dislike merge
4 > commits. That nonlinear work flow is just a mess long term.
5
6 Said by someone who apparently can't figure out reasonable quote then
7 reply-in-context, or even appropriate quote nesting, either. <shrug>
8
9 >   Original Message
10 > From: Michał Górny Sent: Sunday, May 8, 2016 13:09 To: Patrice Clement
11 > Reply To: gentoo-dev@l.g.o Cc: gentoo-dev@l.g.o
12 > Subject: Re: [gentoo-dev] On banning merge commits
13 >
14 > On Sun, 8 May 2016 01:52:22 +0200 Patrice Clement <monsieurp@g.o>
15 > wrote:
16 >
17 >> Hi gents
18 >>
19 >> After yet another discussion about git in the #gentoo-dev channel
20 >> tonight, the topic of merge commits came up for the umpteenth time.
21 >>
22 >> We all seem to agree merge commits are really bad design, add clutter
23 >> to the log graph after a while and should be banned altogether from
24 >> reaching the central repository.
25 >>
26 >> As of now, no policy is in place yet to keep developers from pushing
27 >> merge commits.
28 >>
29 >> What is the correct course of action? I would very much like it to be
30 >> worded in a document (GLEP and/or Wiki page) so that confusion is
31 >> avoided and we all are on the same page on this topic.
32 >
33 > You start by accepting my retirement.
34
35 Agreed with mgorny here.
36
37 In fact, I'd suggest banning *non-*merge push-commits. It's forcing the
38 rebases that is really bad design, removing useful information from the
39 log graph, etc.
40
41 The reason gentoo's git logs are such a mess now is that they're mostly
42 flat. Initial commits are normally one atomic issue per initial commit,
43 good, but then instead of naturally grouping them by subject with a well
44 commented merge commit, as is done for example with the mainline kernel
45 tree, they're unnaturally forced into a flat list by rebases instead of
46 the more natural merges, horribly *bad*!
47
48 Of course that loses all the rich information that the merges carry,
49 including, when merges are done right, grouping individual atomic commits
50 by general task/project, and appropriate merge comments outlining what
51 was actually merged.
52
53 With the kernel I can git log --graph ORIG_HEAD.. and by default search
54 only for merges into the mainline/lefthand master branch. That gives me
55 a very good overview of what subsystems were merged, and for the ones
56 that interest me, I can read the merge commit comment and have a good
57 idea what was merged from that subsystem. For the ones that are more
58 interesting, I can drill down into the merge and read individual commit
59 comments. If even that isn't enough, I can easily git show <commit>
60 using the commit ID from the log, and get the full diff.
61
62 Try doing that with gentoo. It doesn't work because everything's flat;
63 there's too few merge commits. For instance, I've no interested in arm,
64 and with the kernel git log, I can skip the majority of arm-affecting-
65 only commits by just skipping the merge commits as soon as I see it's
66 from the arm tree, while with the gentoo git log, all those arm
67 stabilizations appear as hundreds of individual flat commits on the main
68 branch, instead of a small handful of merge-commits, with merge-commit
69 comments such as "arm stabilizations for app-foo/bar and deps".
70
71 So on gentoo, what I end up doing instead is seeing what packages want to
72 update, and only searching the git log for the interesting ones. Works
73 well enough for that, but I've effectively no overview of what's going on
74 in general as I do for the kernel tree, as I miss all the interesting
75 commits that didn't happen to show up as package update candidates spit
76 out by portage, even in areas I'd otherwise track rather heavily, like
77 kde, where I track the kde overlay git log, but miss the gentoo repo side
78 due to the problems created by lack of appropriate merge commits as
79 explained above.
80
81
82 Or to put it a different way, if we're not going to use git's rich
83 distributed branch development and tracking, forcing everything to single
84 chain on the main tree, why did we bother switching to git in the first
85 place? That was available on cvs, or if we wanted more features,
86 subversion, etc.
87
88 --
89 Duncan - List replies preferred. No HTML msgs.
90 "Every nonfree program has a lord, a master --
91 and if you use the program, he is your master." Richard Stallman

Replies

Subject Author
Re: [gentoo-dev] Re: On banning merge commits Kent Fredric <kentfredric@×××××.com>