summaryrefslogtreecommitdiffstats
path: root/git-merge-tree.html
diff options
context:
space:
mode:
Diffstat (limited to 'git-merge-tree.html')
-rw-r--r--git-merge-tree.html94
1 files changed, 85 insertions, 9 deletions
diff --git a/git-merge-tree.html b/git-merge-tree.html
index 8878de112..b3ce21244 100644
--- a/git-merge-tree.html
+++ b/git-merge-tree.html
@@ -866,6 +866,32 @@ line:</p></div>
&lt;Informational messages&gt;</code></pre>
</div></div>
<div class="paragraph"><p>These are discussed individually below.</p></div>
+<div class="paragraph"><p>However, there is an exception. If <code>--stdin</code> is passed, then there is
+an extra section at the beginning, a NUL character at the end, and then
+all the sections repeat for each line of input. Thus, if the first merge
+is conflicted and the second is clean, the output would be of the form:</p></div>
+<div class="literalblock">
+<div class="content">
+<pre><code>&lt;Merge status&gt;
+&lt;OID of toplevel tree&gt;
+&lt;Conflicted file info&gt;
+&lt;Informational messages&gt;
+NUL
+&lt;Merge status&gt;
+&lt;OID of toplevel tree&gt;
+NUL</code></pre>
+</div></div>
+<div class="sect2">
+<h3 id="MS">Merge status</h3>
+<div class="paragraph"><p>This is an integer status followed by a NUL character. The integer status is:</p></div>
+<div class="literalblock">
+<div class="content">
+<pre><code>0: merge had conflicts
+1: merge was clean
+&amp;lt;0: something prevented the merge from running (e.g. access to repository
+ objects denied by filesystem)</code></pre>
+</div></div>
+</div>
<div class="sect2">
<h3 id="OIDTLT">OID of toplevel tree</h3>
<div class="paragraph"><p>This is a tree object that represents what would be checked out in the
@@ -888,9 +914,49 @@ character instead of a newline character.</p></div>
</div>
<div class="sect2">
<h3 id="IM">Informational messages</h3>
-<div class="paragraph"><p>This always starts with a blank line (or NUL if <code>-z</code> is passed) to
-separate it from the previous sections, and then has free-form
-messages about the merge, such as:</p></div>
+<div class="paragraph"><p>This section provides informational messages, typically about
+conflicts. The format of the section varies significantly depending
+on whether <code>-z</code> is passed.</p></div>
+<div class="paragraph"><p>If <code>-z</code> is passed:</p></div>
+<div class="paragraph"><p>The output format is zero or more conflict informational records, each
+of the form:</p></div>
+<div class="literalblock">
+<div class="content">
+<pre><code>&lt;list-of-paths&gt;&lt;conflict-type&gt;NUL&lt;conflict-message&gt;NUL</code></pre>
+</div></div>
+<div class="paragraph"><p>where &lt;list-of-paths&gt; is of the form</p></div>
+<div class="literalblock">
+<div class="content">
+<pre><code>&lt;number-of-paths&gt;NUL&lt;path1&gt;NUL&lt;path2&gt;NUL...&lt;pathN&gt;NUL</code></pre>
+</div></div>
+<div class="paragraph"><p>and includes paths (or branch names) affected by the conflict or
+informational message in &lt;conflict-message&gt;. Also, &lt;conflict-type&gt; is a
+stable string explaining the type of conflict, such as</p></div>
+<div class="ulist"><ul>
+<li>
+<p>
+"Auto-merging"
+</p>
+</li>
+<li>
+<p>
+"CONFLICT (rename/delete)"
+</p>
+</li>
+<li>
+<p>
+"CONFLICT (submodule lacks merge base)"
+</p>
+</li>
+<li>
+<p>
+"CONFLICT (binary)"
+</p>
+</li>
+</ul></div>
+<div class="paragraph"><p>and &lt;conflict-message&gt; is a more detailed message about the conflict which often
+(but not always) embeds the &lt;stable-short-type-description&gt; within it. These
+strings may change in future Git versions. Some examples:</p></div>
<div class="ulist"><ul>
<li>
<p>
@@ -904,7 +970,7 @@ messages about the merge, such as:</p></div>
</li>
<li>
<p>
-"Failed to merge submodule &lt;submodule&gt; (&lt;reason&gt;)"
+"Failed to merge submodule &lt;submodule&gt; (no merge base)"
</p>
</li>
<li>
@@ -913,9 +979,16 @@ messages about the merge, such as:</p></div>
</p>
</li>
</ul></div>
-<div class="paragraph"><p>Note that these free-form messages will never have a NUL character
-in or between them, even if -z is passed. It is simply a large block
-of text taking up the remainder of the output.</p></div>
+<div class="paragraph"><p>If <code>-z</code> is NOT passed:</p></div>
+<div class="paragraph"><p>This section starts with a blank line to separate it from the previous
+sections, and then only contains the &lt;conflict-message&gt; information
+from the previous section (separated by newlines). These are
+non-stable strings that should not be parsed by scripts, and are just
+meant for human consumption. Also, note that while &lt;conflict-message&gt;
+strings usually do not contain embedded newlines, they sometimes do.
+(However, the free-form messages will never have an embedded NUL
+character). So, the entire block of information is meant for human
+readers as an agglomeration of all conflict messages.</p></div>
</div>
</div>
</div>
@@ -925,7 +998,10 @@ of text taking up the remainder of the output.</p></div>
<div class="paragraph"><p>For a successful, non-conflicted merge, the exit status is 0. When the
merge has conflicts, the exit status is 1. If the merge is not able to
complete (or start) due to some kind of error, the exit status is
-something other than 0 or 1 (and the output is unspecified).</p></div>
+something other than 0 or 1 (and the output is unspecified). When
+--stdin is passed, the return status is 0 for both successful and
+conflicted merges, and something other than 0 or 1 if it cannot complete
+all the requested merges.</p></div>
</div>
</div>
<div class="sect1">
@@ -1052,7 +1128,7 @@ large repositories).</p></div>
<div id="footer">
<div id="footer-text">
Last updated
- 2022-07-18 13:37:02 PDT
+ 2022-11-04 21:49:36 PDT
</div>
</div>
</body>