aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/git-merge-tree.txt
diff options
context:
space:
mode:
authorElijah Newren <newren@gmail.com>2022-10-23 01:28:05 +0000
committerJunio C Hamano <gitster@pobox.com>2022-10-22 22:21:26 -0700
commitec1edbcb56ac05e9980299b05924c5c1b51d68b4 (patch)
treed37382b1d062044bfab4b32bd62b13842aa84cbe /Documentation/git-merge-tree.txt
parenta9f5bb83e0341a04c46b2dec27e16c793d6447f8 (diff)
downloadgit-ec1edbcb56ac05e9980299b05924c5c1b51d68b4.tar.gz
merge-tree: support multiple batched merges with --stdin
Add an option, --stdin, to merge-tree which will accept lines of input with two branches to merge per line, and which will perform all the merges and give output for each in turn. This option implies -z, and modifies the output to also include a merge status since the exit code of the program can no longer convey that information now that multiple merges are involved. This could be useful, for example, by Git hosting providers. When one branch is updated, one may want to check whether all code reviews targetting that branch can still cleanly merge. Avoiding the overhead of starting up a separate process for each of those code reviews might provide significant savings in a repository with many code reviews. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/git-merge-tree.txt')
-rw-r--r--Documentation/git-merge-tree.txt30
1 files changed, 29 insertions, 1 deletions
diff --git a/Documentation/git-merge-tree.txt b/Documentation/git-merge-tree.txt
index 9914b1bc0c..04bcc416e6 100644
--- a/Documentation/git-merge-tree.txt
+++ b/Documentation/git-merge-tree.txt
@@ -81,6 +81,31 @@ Whereas for a conflicted merge, the output is by default of the form:
These are discussed individually below.
+However, there is an exception. If `--stdin` 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:
+
+ <Merge status>
+ <OID of toplevel tree>
+ <Conflicted file info>
+ <Informational messages>
+ NUL
+ <Merge status>
+ <OID of toplevel tree>
+ NUL
+
+[[MS]]
+Merge status
+~~~~~~~~~~~~
+
+This is an integer status followed by a NUL character. The integer status is:
+
+ 0: merge had conflicts
+ 1: merge was clean
+ &lt;0: something prevented the merge from running (e.g. access to repository
+ objects denied by filesystem)
+
[[OIDTLT]]
OID of toplevel tree
~~~~~~~~~~~~~~~~~~~~
@@ -159,7 +184,10 @@ EXIT STATUS
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).
+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.
USAGE NOTES
-----------