Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

merge-base analog for Mercurial and bzr (to find common ancestors as possible for a merge)?

Git have merge-base command that show common ancestors of two or more branches.

What analog for Mercurial and bzr?

like image 973
gavenkoa Avatar asked Jul 19 '11 06:07

gavenkoa


People also ask

What merged common ancestors?

merged common ancestors: diff3 outputs an additional "middle" section showing the lines as they were in the merge base. This is the starting point for both branches. Criss-cross merge: A merge history where two branches merge into each other in ways that one could not have been a fast-forward merge.

What is a merge base in git?

DESCRIPTION. git merge-base finds best common ancestor(s) between two commits to use in a three-way merge. One common ancestor is better than another common ancestor if the latter is an ancestor of the former. A common ancestor that does not have any better common ancestor is a best common ancestor, i.e. a merge base.

What is a git 3 way merge?

3-way merges use a dedicated commit to tie together the two histories. The nomenclature comes from the fact that Git uses three commits to generate the merge commit: the two branch tips and their common ancestor.

What is merge changes in git?

The "merge" command is used to integrate changes from another branch. The target of this integration (i.e. the branch that receives changes) is always the currently checked out HEAD branch. While Git can perform most integrations automatically, some changes will result in conflicts that have to be solved by the user.


3 Answers

For Bazaar:

bzr find-merge-base /path/to/branch1 /path/to/branch2

(This command is hidden from the main set of commands that you can obtain with bzr help commands. Use bzr help hidden-commands to see other hidden commands).

like image 148
bialix Avatar answered Oct 13 '22 02:10

bialix


Use revsets:

"ancestor(single, single)"
      Greatest common ancestor of the two changesets.

$ hg log -r 'ancestor(rev1, rev2)'
like image 33
Idan K Avatar answered Oct 13 '22 02:10

Idan K


For Mercurial:

hg debugancestor rev1 rev2

like image 43
Peter Graham Avatar answered Oct 13 '22 01:10

Peter Graham