Gentoo Archives: gentoo-dev

From: Alexis Ballier <aballier@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Dealing with GitHub Pull Requests the easy way
Date: Wed, 19 Oct 2016 08:23:06
Message-Id: 20161019102252.1500e82e@gentoo.org
In Reply to: [gentoo-dev] Dealing with GitHub Pull Requests the easy way by Patrice Clement
1 On Tue, 18 Oct 2016 23:13:26 +0200
2 Patrice Clement <monsieurp@g.o> wrote:
3
4 > In the case of Gentoo though, it makes no sense. We should strive for
5 > keeping a clean and linear history.
6
7
8 A DAG is what I would call linear history :)
9 Merge commits preserve that structure, git log performs a topological
10 sort on the history DAG, effectively showing it to you as a timeline.
11 Now, topsort is kind of classical, very efficient, algorithm so why
12 should I care doing this sorting manually when git does it faster and
13 better than I would ever do ?
14
15 Also, if you want to see linear history, why do you use git log
16 --graph ? This seems to me you're inventing your own problems :)
17
18
19 > By avoiding merge commits, we make sure the history stay linear with
20 > no parent/child commits all over the place. It leads us to the two
21 > remaining solutions for dealing with PRs in a clean fashion:
22 > cherry-picking and git am. These two solutions really shine at
23 > keeping a sane history.
24
25 git merge ...
26 git rebase origin/master
27
28
29 this kills the merge commit and reparents the commits you merged to
30 the tip of origin/master