-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
git-merge-base: add page #9382
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
git-merge-base: add page #9382
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,16 @@ | ||||||
| # git merge-base | ||||||
|
|
||||||
| > Find a common ancestor of two commits. | ||||||
| > More information: <https://git-scm.com/docs/git-merge-base>. | ||||||
|
|
||||||
| - Output a best common ancestor of two commits: | ||||||
|
|
||||||
| `git merge-base {{commit_1}} {{commit_2}}` | ||||||
navarroaxel marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
|
||||||
| - Output all best common ancestors of two commits: | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In the way git weighs merge bases, there actually can be two "best" ones, which means two of the same quality. But I agree that the wording is confusing, so maybe "all suitable" should be used?
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok |
||||||
|
|
||||||
| `git merge-base --all {{commit_1}} {{commit_2}}` | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not commit_hash instead
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the git subcommand pages are not consistent in this matter, but the majority uses just commit.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
It means that consistency should be fixed. For instance we can write script to do that like in #9578 PR. |
||||||
|
|
||||||
| - Return 0 if the first commit is an ancestor of the second commit, else 1: | ||||||
Lodifice marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
|
|
||||||
| `git merge-base --is-ancestor {{commit_1}} {{commit_2}}` | ||||||
Lodifice marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
Uh oh!
There was an error while loading. Please reload this page.