git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[RFC/PATCH 4/4] merge-file: add option to select union merge favor

From
Bert Wesarg <bert.wesarg@googlemail.com>
Date
Mar 1, 2010, 21:46 UTC
Message-ID
<cb7b00f2ff0231ff7febe6e05bf2145e4e2fe585.1267479461.git.bert.wesarg@googlemail.com>
In-Reply-To
<b34a72b5be427e4ccbdd01d7b8f53683dfd80175.1267479461.git.bert.wesarg@googlemail.com>
Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
---

The same argument as for the --marker-size apply here. For merges outside a git repository, its the only way to get access to the union merge driver.

 Documentation/git-merge-file.txt |   13 +++++++------
 builtin-merge-file.c             |    2 ++
 2 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/Documentation/git-merge-file.txt b/Documentation/git-merge-file.txt
index a5b9c1f..f334d69 100644
--- a/Documentation/git-merge-file.txt
+++ b/Documentation/git-merge-file.txt
@@ -10,7 +10,7 @@ SYNOPSIS
 --------
 [verse]
 'git merge-file' [-L <current-name> [-L <base-name> [-L <other-name>]]]
-	[--ours|--theirs] [-p|--stdout] [-q|--quiet] [--marker-size=<n>]
+	[--ours|--theirs|--union] [-p|--stdout] [-q|--quiet] [--marker-size=<n>]
 	<current-file> <base-file> <other-file>
 
 
@@ -35,10 +35,10 @@ normally outputs a warning and brackets the conflict with lines containing
 	>>>>>>> B
 
 If there are conflicts, the user should edit the result and delete one of
-the alternatives.  When `--ours` or `--theirs` option is in effect, however,
-these conflicts are resolved favouring lines from `<current-file>` or
-lines from `<other-file>` respectively.  The length of the conflict markers
-can be given with the `--marker-size` option.
+the alternatives.  When `--ours`, `--theirs`, or `--union` option is in effect,
+however, these conflicts are resolved favouring lines from `<current-file>`,
+lines from `<other-file>`, or lines from both respectively.  The length of the
+conflict markers can be given with the `--marker-size` option.
 
 The exit value of this program is negative on error, and the number of
 conflicts otherwise. If the merge was clean, the exit value is 0.
@@ -68,8 +68,9 @@ OPTIONS
 
 --ours::
 --theirs::
+--union::
 	Instead of leaving conflicts in the file, resolve conflicts
-	favouring our (or their) side of the lines.
+	favouring our (or their or both) side of the lines.
 
 
 EXAMPLES
diff --git a/builtin-merge-file.c b/builtin-merge-file.c
index c1a35b9..eaa4917 100644
--- a/builtin-merge-file.c
+++ b/builtin-merge-file.c
@@ -41,6 +41,8 @@ int cmd_merge_file(int argc, const char **argv, const char *prefix)
 			    XDL_MERGE_FAVOR_OURS),
 		OPT_SET_INT(0, "theirs", &xmp.favor, "for conflicts, use their version",
 			    XDL_MERGE_FAVOR_THEIRS),
+		OPT_SET_INT(0, "union", &xmp.favor, "for conflicts, use a union version",
+			    XDL_MERGE_FAVOR_UNION),
 		OPT_INTEGER(0, "marker-size", &xmp.marker_size,
 			    "for conflicts, use this marker size"),
 		OPT__QUIET(&quiet),
-- 
1.7.0.584.g2da2b
Previous: Bert Wesarg
Message 4 of 4 in “make union merge an xdl merge favor”
  1. 1/4 make union merge an xdl merge favorBert Wesarg, Mar 1, 2010
  2. 2/4 refactor merge flags into xmparam_tBert Wesarg, Mar 1, 2010
  3. 3/4 merge-file: add option to specify the marker sizeBert Wesarg, Mar 1, 2010
  4. 4/4 merge-file: add option to select union merge favorBert Wesarg, Mar 1, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.