@matheusbsbs / matheus-bagliano / commits / 5729482429
Fork 0

Documentation: update to git-merge-base --octopus

Unlike plain merge-base, merge-base --octopus only requires at least one commit argument; update the synopsis to reflect that. Add a sentence to the discussion that when --octopus is used, we do expect '2' (the common ansestor across all) as the result. Signed-off-by: Vincent van Ravesteijn <vfr@lyx.org> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Vincent van Ravesteijn committed Apr 15, 2011 at 10:34 UTC 5729482429725c4688c678701ca5197eaf367a07
2 files changed +7 -2
Documentation/git-merge-base.txt
+5 -1
@@ -9,7 +9,8 @@ git-merge-base - Find as good common ancestors as possible for a merge
9 SYNOPSIS
10 --------
11 [verse]
12 -'git merge-base' [-a|--all] [--octopus] <commit> <commit>...
12 +'git merge-base' [-a|--all] <commit> <commit>...
13 +'git merge-base' [-a|--all] --octopus <commit>...
14 'git merge-base' --independent <commit>...
15
16 DESCRIPTION
@@ -89,6 +90,9 @@ and the result of `git merge-base A M` is '1'. Commit '2' is also a
90 common ancestor between 'A' and 'M', but '1' is a better common ancestor,
91 because '2' is an ancestor of '1'. Hence, '2' is not a merge base.
92
93 +The result of `git merge-base --octopus A B C` is '2', because '2' is
94 +the best common ancestor of all commits.
95 +
96 When the history involves criss-cross merges, there can be more than one
97 'best' common ancestor for two commits. For example, with this topology:
98
builtin/merge-base.c
+2 -1
@@ -23,7 +23,8 @@ static int show_merge_base(struct commit **rev, int rev_nr, int show_all)
23 }
24
25 static const char * const merge_base_usage[] = {
26 - "git merge-base [-a|--all] [--octopus] <commit> <commit>...",
26 + "git merge-base [-a|--all] <commit> <commit>...",
27 + "git merge-base [-a|--all] --octopus <commit>...",
28 "git merge-base --independent <commit>...",
29 NULL
30 };