Gentoo Archives: gentoo-dev

From: Ulrich Mueller <ulm@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Odd git format-patch behavior
Date: Tue, 30 Jul 2013 10:44:20
Message-Id: 20983.36055.23739.936023@a1i15.kph.uni-mainz.de
In Reply to: Re: [gentoo-dev] Odd git format-patch behavior by Rich Freeman
1 >>>>> On Tue, 30 Jul 2013, Rich Freeman wrote:
2
3 > On Tue, Jul 30, 2013 at 2:47 AM, Ciaran McCreesh
4 > <ciaran.mccreesh@××××××××××.com> wrote:
5 >> The log doesn't give you a linear path. Use --decorate --graph to
6 >> avoid the illusion.
7
8 > Understood. I think we're just quipping over the definition of
9 > "linear path" though.
10
11 > If having a linear path from A to B means that these nodes are
12 > connected and there is exactly one way to traverse the graph from A to
13 > B then there is not a linear path. If having a linear path from A to
14 > B means that these nodes are connected, and thus there is at least one
15 > way to traverse the graph from A to B without revisiting any nodes,
16 > then there is a linear path.
17
18 > Using the latter definition, a linear path exists if one node shows up
19 > in a git log started from the other. Using the former definition, you
20 > need to use --decorate --graph as you suggest.
21
22 You have a situation like the following here:
23
24 A---B---C---D---E---F---G
25 \ /
26 H---I---J---K
27
28 D is the tagged commit, G is the branch tip. Now "git format-patch D"
29 will output all commits that are not D or its ancestors. So it will
30 give you commits E, F, and G. But it will also give you commits H, I,
31 J, and K because they are not ancestors of D.
32
33 The series of numbered patches (0001-* etc.) doesn't preserve the
34 information about the topology of the graph, so it's not surprising
35 that you get conflicts when you try to apply them on top of D.
36
37 Ulrich