Skip to content

Commit 2dfa5a1

Browse files
committed
Merge branch 'ma/rev-list-options-docfix'
Docfix. * ma/rev-list-options-docfix: rev-list-options.txt: start a list for `show-pulls`
2 parents 2410991 + 32f7037 commit 2dfa5a1

File tree

1 file changed

+19
-16
lines changed

1 file changed

+19
-16
lines changed

Documentation/rev-list-options.txt

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -581,12 +581,12 @@ option does. Applied to the 'D..M' range, it results in:
581581

582582
Before discussing another option, `--show-pulls`, we need to
583583
create a new example history.
584-
+
584+
585585
A common problem users face when looking at simplified history is that a
586586
commit they know changed a file somehow does not appear in the file's
587587
simplified history. Let's demonstrate a new example and show how options
588588
such as `--full-history` and `--simplify-merges` works in that case:
589-
+
589+
590590
-----------------------------------------------------------------------
591591
.-A---M-----C--N---O---P
592592
/ / \ \ \/ / /
@@ -595,7 +595,7 @@ such as `--full-history` and `--simplify-merges` works in that case:
595595
\ / /\ /
596596
`---X--' `---Y--'
597597
-----------------------------------------------------------------------
598-
+
598+
599599
For this example, suppose `I` created `file.txt` which was modified by
600600
`A`, `B`, and `X` in different ways. The single-parent commits `C`, `Z`,
601601
and `Y` do not change `file.txt`. The merge commit `M` was created by
@@ -607,19 +607,19 @@ the contents of `file.txt` at `X`. Hence, `R` is TREESAME to `X` but not
607607
contents of `file.txt` at `R`, so `N` is TREESAME to `R` but not `C`.
608608
The merge commits `O` and `P` are TREESAME to their first parents, but
609609
not to their second parents, `Z` and `Y` respectively.
610-
+
610+
611611
When using the default mode, `N` and `R` both have a TREESAME parent, so
612612
those edges are walked and the others are ignored. The resulting history
613613
graph is:
614-
+
614+
615615
-----------------------------------------------------------------------
616616
I---X
617617
-----------------------------------------------------------------------
618-
+
618+
619619
When using `--full-history`, Git walks every edge. This will discover
620620
the commits `A` and `B` and the merge `M`, but also will reveal the
621621
merge commits `O` and `P`. With parent rewriting, the resulting graph is:
622-
+
622+
623623
-----------------------------------------------------------------------
624624
.-A---M--------N---O---P
625625
/ / \ \ \/ / /
@@ -628,21 +628,21 @@ merge commits `O` and `P`. With parent rewriting, the resulting graph is:
628628
\ / /\ /
629629
`---X--' `------'
630630
-----------------------------------------------------------------------
631-
+
631+
632632
Here, the merge commits `O` and `P` contribute extra noise, as they did
633633
not actually contribute a change to `file.txt`. They only merged a topic
634634
that was based on an older version of `file.txt`. This is a common
635635
issue in repositories using a workflow where many contributors work in
636636
parallel and merge their topic branches along a single trunk: manu
637637
unrelated merges appear in the `--full-history` results.
638-
+
638+
639639
When using the `--simplify-merges` option, the commits `O` and `P`
640640
disappear from the results. This is because the rewritten second parents
641641
of `O` and `P` are reachable from their first parents. Those edges are
642642
removed and then the commits look like single-parent commits that are
643643
TREESAME to their parent. This also happens to the commit `N`, resulting
644644
in a history view as follows:
645-
+
645+
646646
-----------------------------------------------------------------------
647647
.-A---M--.
648648
/ / \
@@ -651,18 +651,18 @@ in a history view as follows:
651651
\ / /
652652
`---X--'
653653
-----------------------------------------------------------------------
654-
+
654+
655655
In this view, we see all of the important single-parent changes from
656656
`A`, `B`, and `X`. We also see the carefully-resolved merge `M` and the
657657
not-so-carefully-resolved merge `R`. This is usually enough information
658658
to determine why the commits `A` and `B` "disappeared" from history in
659659
the default view. However, there are a few issues with this approach.
660-
+
660+
661661
The first issue is performance. Unlike any previous option, the
662662
`--simplify-merges` option requires walking the entire commit history
663663
before returning a single result. This can make the option difficult to
664664
use for very large repositories.
665-
+
665+
666666
The second issue is one of auditing. When many contributors are working
667667
on the same repository, it is important which merge commits introduced
668668
a change into an important branch. The problematic merge `R` above is
@@ -671,10 +671,13 @@ important branch. Instead, the merge `N` was used to merge `R` and `X`
671671
into the important branch. This commit may have information about why
672672
the change `X` came to override the changes from `A` and `B` in its
673673
commit message.
674+
675+
--show-pulls::
676+
In addition to the commits shown in the default history, show
677+
each merge commit that is not TREESAME to its first parent but
678+
is TREESAME to a later parent.
674679
+
675-
The `--show-pulls` option helps with both of these issues by adding more
676-
merge commits to the history results. If a merge is not TREESAME to its
677-
first parent but is TREESAME to a later parent, then that merge is
680+
When a merge commit is included by `--show-pulls`, the merge is
678681
treated as if it "pulled" the change from another branch. When using
679682
`--show-pulls` on this example (and no other options) the resulting
680683
graph is:

0 commit comments

Comments
 (0)