Skip to content

Commit 5729482

Browse files
vfr-nlgitster
authored andcommitted
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 <[email protected]> Reviewed-by: Jonathan Nieder <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 810cae5 commit 5729482

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

Documentation/git-merge-base.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ git-merge-base - Find as good common ancestors as possible for a merge
99
SYNOPSIS
1010
--------
1111
[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>...
1314
'git merge-base' --independent <commit>...
1415

1516
DESCRIPTION
@@ -89,6 +90,9 @@ and the result of `git merge-base A M` is '1'. Commit '2' is also a
8990
common ancestor between 'A' and 'M', but '1' is a better common ancestor,
9091
because '2' is an ancestor of '1'. Hence, '2' is not a merge base.
9192

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+
9296
When the history involves criss-cross merges, there can be more than one
9397
'best' common ancestor for two commits. For example, with this topology:
9498

builtin/merge-base.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ static int show_merge_base(struct commit **rev, int rev_nr, int show_all)
2323
}
2424

2525
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>...",
2728
"git merge-base --independent <commit>...",
2829
NULL
2930
};

0 commit comments

Comments
 (0)