History Simplification
A more detailed explanation follows.
Suppose you specified foo
as the <paths>. We shall call commits that modify foo
!TREESAME, and the rest TREESAME. (In a diff filtered for foo
, they look different and equal, respectively.)
In the following, we will always refer to the same example history to illustrate the differences between simplification settings. We assume that you are filtering for a file foo
in this commit graph:
.-A---M---N---O---P---Q
/ / / / / /
I B C D E Y
\ / / / / /
`-------------' X
The horizontal line of history A---Q is taken to be the first parent of each merge. The commits are:
-
I
is the initial commit, in whichfoo
exists with contents “asdf”, and a filequux
exists with contents “quux”. Initial commits are compared to an empty tree, soI
is !TREESAME. -
In
A
,foo
contains just “foo”. -
B
contains the same change asA
. Its mergeM
is trivial and hence TREESAME to all parents. M有两个parent,分别是A和B,但是相对A和B而言,从文件内容来看,是没有差异的 -
C
does not changefoo
, but its mergeN
changes it to “foobar”, so it is not TREESAME to any parent. -
D
setsfoo
to “baz”. Its mergeO
combines the strings fromN
andD
to “foobarbaz”; i.e., it is not TREESAME to any parent. -
E
changesquux
to “xyzzy”, and its mergeP
combines the strings to “quux xyzzy”.P
is TREESAME toO
, but not toE
. -
X
is an independent root commit that added a new fileside
, andY
modified it.Y
is TREESAME toX
. Its mergeQ
addedside
toP
, andQ
is TREESAME toP
, but not toY
.
rev-list
walks backwards through history, including or excluding commits based on whether --full-history
and/or parent rewriting (via --parents
or --children
) are used. The following settings are available.