Skip to content

Commit

Permalink
merge-file: add option to select union merge favor
Browse files Browse the repository at this point in the history
Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Bert Wesarg authored and Junio C Hamano committed Mar 3, 2010
1 parent 11f3aa2 commit 3a15048
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
13 changes: 7 additions & 6 deletions Documentation/git-merge-file.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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>


Expand All @@ -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.
Expand Down Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions builtin-merge-file.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,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),
Expand Down

0 comments on commit 3a15048

Please sign in to comment.