@matheusbsbs / matheus-bagliano / commits / 3a15048d83
Fork 0

merge-file: add option to select union merge favor

Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Bert Wesarg committed Mar 1, 2010 at 22:46 UTC 3a15048d833e2d6599091a9f7c14b0fa926c3bbf
2 files changed +9 -6
Documentation/git-merge-file.txt
+7 -6
@@ -10,7 +10,7 @@ SYNOPSIS
10 --------
11 [verse]
12 'git merge-file' [-L <current-name> [-L <base-name> [-L <other-name>]]]
13 - [--ours|--theirs] [-p|--stdout] [-q|--quiet] [--marker-size=<n>]
13 + [--ours|--theirs|--union] [-p|--stdout] [-q|--quiet] [--marker-size=<n>]
14 <current-file> <base-file> <other-file>
15
16
@@ -35,10 +35,10 @@ normally outputs a warning and brackets the conflict with lines containing
35 >>>>>>> B
36
37 If there are conflicts, the user should edit the result and delete one of
38 -the alternatives. When `--ours` or `--theirs` option is in effect, however,
39 -these conflicts are resolved favouring lines from `<current-file>` or
40 -lines from `<other-file>` respectively. The length of the conflict markers
41 -can be given with the `--marker-size` option.
38 +the alternatives. When `--ours`, `--theirs`, or `--union` option is in effect,
39 +however, these conflicts are resolved favouring lines from `<current-file>`,
40 +lines from `<other-file>`, or lines from both respectively. The length of the
41 +conflict markers can be given with the `--marker-size` option.
42
43 The exit value of this program is negative on error, and the number of
44 conflicts otherwise. If the merge was clean, the exit value is 0.
@@ -68,8 +68,9 @@ OPTIONS
68
69 --ours::
70 --theirs::
71 +--union::
72 Instead of leaving conflicts in the file, resolve conflicts
72 - favouring our (or their) side of the lines.
73 + favouring our (or their or both) side of the lines.
74
75
76 EXAMPLES
builtin-merge-file.c
+2
@@ -36,6 +36,8 @@ int cmd_merge_file(int argc, const char **argv, const char *prefix)
36 XDL_MERGE_FAVOR_OURS),
37 OPT_SET_INT(0, "theirs", &xmp.favor, "for conflicts, use their version",
38 XDL_MERGE_FAVOR_THEIRS),
39 + OPT_SET_INT(0, "union", &xmp.favor, "for conflicts, use a union version",
40 + XDL_MERGE_FAVOR_UNION),
41 OPT_INTEGER(0, "marker-size", &xmp.marker_size,
42 "for conflicts, use this marker size"),
43 OPT__QUIET(&quiet),