summaryrefslogtreecommitdiffstats
path: root/git-merge-base.html
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-10-31 13:25:53 -0700
committerJunio C Hamano <gitster@pobox.com>2014-10-31 13:25:53 -0700
commitc14e6ad9a230ad90c84b7f620d87fbe49a2d0342 (patch)
tree120346dc383e3d1c4219fe8c533eb22cb6af2b55 /git-merge-base.html
parent2a4bcbc355496c8d83b1b9f8892c4cbe8f584158 (diff)
downloadgit-htmldocs-c14e6ad9a230ad90c84b7f620d87fbe49a2d0342.tar.gz
Autogenerated HTML docs for v2.2.0-rc0
Diffstat (limited to 'git-merge-base.html')
-rw-r--r--git-merge-base.html98
1 files changed, 48 insertions, 50 deletions
diff --git a/git-merge-base.html b/git-merge-base.html
index 32369bcd5..28c9a78b3 100644
--- a/git-merge-base.html
+++ b/git-merge-base.html
@@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
-<meta name="generator" content="AsciiDoc 8.6.6" />
+<meta name="generator" content="AsciiDoc 8.6.9" />
<title>git-merge-base(1)</title>
<style type="text/css">
/* Shared CSS for AsciiDoc xhtml11 and html5 backends */
@@ -87,10 +87,16 @@ ul, ol, li > p {
ul > li { color: #aaa; }
ul > li > * { color: black; }
-pre {
+.monospaced, code, pre {
+ font-family: "Courier New", Courier, monospace;
+ font-size: inherit;
+ color: navy;
padding: 0;
margin: 0;
}
+pre {
+ white-space: pre-wrap;
+}
#author {
color: #527bbd;
@@ -219,7 +225,7 @@ div.exampleblock > div.content {
}
div.imageblock div.content { padding-left: 0; }
-span.image img { border-style: none; }
+span.image img { border-style: none; vertical-align: text-bottom; }
a.image:visited { color: white; }
dl {
@@ -349,7 +355,7 @@ div.colist td img {
margin-bottom: 0.1em;
}
-div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
+div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
margin-top: 0;
margin-bottom: 0;
}
@@ -407,18 +413,14 @@ span.underline { text-decoration: underline; }
span.overline { text-decoration: overline; }
span.line-through { text-decoration: line-through; }
+div.unbreakable { page-break-inside: avoid; }
+
/*
* xhtml11 specific
*
* */
-tt {
- font-family: monospace;
- font-size: inherit;
- color: navy;
-}
-
div.tableblock {
margin-top: 1.0em;
margin-bottom: 1.5em;
@@ -452,12 +454,6 @@ div.tableblock > table[frame="vsides"] {
*
* */
-.monospaced {
- font-family: monospace;
- font-size: inherit;
- color: navy;
-}
-
table.tableblock {
margin-top: 1.0em;
margin-bottom: 1.5em;
@@ -537,6 +533,8 @@ body.manpage div.sectionbody {
@media print {
body.manpage div#toc { display: none; }
}
+
+
</style>
<script type="text/javascript">
/*<![CDATA[*/
@@ -581,7 +579,7 @@ toc: function (toclevels) {
function tocEntries(el, toclevels) {
var result = new Array;
- var re = new RegExp('[hH]([2-'+(toclevels+1)+'])');
+ var re = new RegExp('[hH]([1-'+(toclevels+1)+'])');
// Function that scans the DOM tree for header elements (the DOM2
// nodeIterator API would be a better technique but not supported by all
// browsers).
@@ -610,7 +608,7 @@ toc: function (toclevels) {
var i;
for (i = 0; i < toc.childNodes.length; i++) {
var entry = toc.childNodes[i];
- if (entry.nodeName == 'div'
+ if (entry.nodeName.toLowerCase() == 'div'
&& entry.getAttribute("class")
&& entry.getAttribute("class").match(/^toclevel/))
tocEntriesToRemove.push(entry);
@@ -656,7 +654,7 @@ footnotes: function () {
var entriesToRemove = [];
for (i = 0; i < noteholder.childNodes.length; i++) {
var entry = noteholder.childNodes[i];
- if (entry.nodeName == 'div' && entry.getAttribute("class") == "footnote")
+ if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute("class") == "footnote")
entriesToRemove.push(entry);
}
for (i = 0; i < entriesToRemove.length; i++) {
@@ -781,7 +779,7 @@ the other commit is a (possibly hypothetical) commit that is a merge
across all the remaining commits on the command line.</p></div>
<div class="paragraph"><p>As a consequence, the <em>merge base</em> is not necessarily contained in each of the
commit arguments if more than two commits are specified. This is different
-from <a href="git-show-branch.html">git-show-branch(1)</a> when used with the <tt>--merge-base</tt> option.</p></div>
+from <a href="git-show-branch.html">git-show-branch(1)</a> when used with the <code>--merge-base</code> option.</p></div>
<div class="dlist"><dl>
<dt class="hdlist1">
--octopus
@@ -853,54 +851,54 @@ from <a href="git-show-branch.html">git-show-branch(1)</a> when used with the <t
<div class="sect1">
<h2 id="_discussion">DISCUSSION</h2>
<div class="sectionbody">
-<div class="paragraph"><p>Given two commits <em>A</em> and <em>B</em>, <tt>git merge-base A B</tt> will output a commit
+<div class="paragraph"><p>Given two commits <em>A</em> and <em>B</em>, <code>git merge-base A B</code> will output a commit
which is reachable from both <em>A</em> and <em>B</em> through the parent relationship.</p></div>
<div class="paragraph"><p>For example, with this topology:</p></div>
<div class="literalblock">
<div class="content">
-<pre><tt> o---o---o---B
+<pre><code> o---o---o---B
/
----o---1---o---o---o---A</tt></pre>
+---o---1---o---o---o---A</code></pre>
</div></div>
<div class="paragraph"><p>the merge base between <em>A</em> and <em>B</em> is <em>1</em>.</p></div>
-<div class="paragraph"><p>Given three commits <em>A</em>, <em>B</em> and <em>C</em>, <tt>git merge-base A B C</tt> will compute the
+<div class="paragraph"><p>Given three commits <em>A</em>, <em>B</em> and <em>C</em>, <code>git merge-base A B C</code> will compute the
merge base between <em>A</em> and a hypothetical commit <em>M</em>, which is a merge
between <em>B</em> and <em>C</em>. For example, with this topology:</p></div>
<div class="literalblock">
<div class="content">
-<pre><tt> o---o---o---o---C
+<pre><code> o---o---o---o---C
/
/ o---o---o---B
/ /
----2---1---o---o---o---A</tt></pre>
+---2---1---o---o---o---A</code></pre>
</div></div>
-<div class="paragraph"><p>the result of <tt>git merge-base A B C</tt> is <em>1</em>. This is because the
+<div class="paragraph"><p>the result of <code>git merge-base A B C</code> is <em>1</em>. This is because the
equivalent topology with a merge commit <em>M</em> between <em>B</em> and <em>C</em> is:</p></div>
<div class="literalblock">
<div class="content">
-<pre><tt> o---o---o---o---o
+<pre><code> o---o---o---o---o
/ \
/ o---o---o---o---M
/ /
----2---1---o---o---o---A</tt></pre>
+---2---1---o---o---o---A</code></pre>
</div></div>
-<div class="paragraph"><p>and the result of <tt>git merge-base A M</tt> is <em>1</em>. Commit <em>2</em> is also a
+<div class="paragraph"><p>and the result of <code>git merge-base A M</code> is <em>1</em>. Commit <em>2</em> is also a
common ancestor between <em>A</em> and <em>M</em>, but <em>1</em> is a better common ancestor,
because <em>2</em> is an ancestor of <em>1</em>. Hence, <em>2</em> is not a merge base.</p></div>
-<div class="paragraph"><p>The result of <tt>git merge-base --octopus A B C</tt> is <em>2</em>, because <em>2</em> is
+<div class="paragraph"><p>The result of <code>git merge-base --octopus A B C</code> is <em>2</em>, because <em>2</em> is
the best common ancestor of all commits.</p></div>
<div class="paragraph"><p>When the history involves criss-cross merges, there can be more than one
<em>best</em> common ancestor for two commits. For example, with this topology:</p></div>
<div class="literalblock">
<div class="content">
-<pre><tt>---1---o---A
+<pre><code>---1---o---A
\ /
X
/ \
----2---o---o---B</tt></pre>
+---2---o---o---B</code></pre>
</div></div>
<div class="paragraph"><p>both <em>1</em> and <em>2</em> are merge-bases of A and B. Neither one is better than
-the other (both are <em>best</em> merge bases). When the <tt>--all</tt> option is not given,
+the other (both are <em>best</em> merge bases). When the <code>--all</code> option is not given,
it is unspecified which best one is output.</p></div>
<div class="paragraph"><p>A common idiom to check "fast-forward-ness" between two commits A
and B is (or at least used to be) to compute the merge base between
@@ -908,19 +906,19 @@ A and B, and check if it is the same as A, in which case, A is an
ancestor of B. You will see this idiom used often in older scripts.</p></div>
<div class="literalblock">
<div class="content">
-<pre><tt>A=$(git rev-parse --verify A)
+<pre><code>A=$(git rev-parse --verify A)
if test "$A" = "$(git merge-base A B)"
then
... A is an ancestor of B ...
-fi</tt></pre>
+fi</code></pre>
</div></div>
<div class="paragraph"><p>In modern git, you can say this in a more direct way:</p></div>
<div class="literalblock">
<div class="content">
-<pre><tt>if git merge-base --is-ancestor A B
+<pre><code>if git merge-base --is-ancestor A B
then
... A is an ancestor of B ...
-fi</tt></pre>
+fi</code></pre>
</div></div>
<div class="paragraph"><p>instead.</p></div>
</div>
@@ -928,29 +926,29 @@ fi</tt></pre>
<div class="sect1">
<h2 id="_discussion_on_fork_point_mode">Discussion on fork-point mode</h2>
<div class="sectionbody">
-<div class="paragraph"><p>After working on the <tt>topic</tt> branch created with <tt>git checkout -b
-topic origin/master</tt>, the history of remote-tracking branch
-<tt>origin/master</tt> may have been rewound and rebuilt, leading to a
+<div class="paragraph"><p>After working on the <code>topic</code> branch created with <code>git checkout -b
+topic origin/master</code>, the history of remote-tracking branch
+<code>origin/master</code> may have been rewound and rebuilt, leading to a
history of this shape:</p></div>
<div class="literalblock">
<div class="content">
-<pre><tt> o---B1
+<pre><code> o---B1
/
---o---o---B2--o---o---o---B (origin/master)
\
B3
\
- Derived (topic)</tt></pre>
+ Derived (topic)</code></pre>
</div></div>
-<div class="paragraph"><p>where <tt>origin/master</tt> used to point at commits B3, B2, B1 and now it
-points at B, and your <tt>topic</tt> branch was started on top of it back
-when <tt>origin/master</tt> was at B3. This mode uses the reflog of
-<tt>origin/master</tt> to find B3 as the fork point, so that the <tt>topic</tt>
-can be rebased on top of the updated <tt>origin/master</tt> by:</p></div>
+<div class="paragraph"><p>where <code>origin/master</code> used to point at commits B3, B2, B1 and now it
+points at B, and your <code>topic</code> branch was started on top of it back
+when <code>origin/master</code> was at B3. This mode uses the reflog of
+<code>origin/master</code> to find B3 as the fork point, so that the <code>topic</code>
+can be rebased on top of the updated <code>origin/master</code> by:</p></div>
<div class="literalblock">
<div class="content">
-<pre><tt>$ fork_point=$(git merge-base --fork-point origin/master topic)
-$ git rebase --onto origin/master $fork_point topic</tt></pre>
+<pre><code>$ fork_point=$(git merge-base --fork-point origin/master topic)
+$ git rebase --onto origin/master $fork_point topic</code></pre>
</div></div>
</div>
</div>