summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 560119b)
raw | patch | inline | side by side (parent: 560119b)
author | Bert Wesarg <bert.wesarg@googlemail.com> | |
Mon, 1 Mar 2010 21:46:27 +0000 (22:46 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 3 Mar 2010 05:16:44 +0000 (21:16 -0800) |
This adds the abbility to specify the conflict marker size for merges outside
a git repository.
Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
a git repository.
Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-merge-file.txt | patch | blob | history | |
builtin-merge-file.c | patch | blob | history | |
t/t6023-merge-file.sh | patch | blob | history |
index 234269ae59234de67ea2cce42edec83cebc400be..a5b9c1f6c8220549b484b3753b48af7d9e2e6901 100644 (file)
--------
[verse]
'git merge-file' [-L <current-name> [-L <base-name> [-L <other-name>]]]
- [--ours|--theirs] [-p|--stdout] [-q|--quiet]
+ [--ours|--theirs] [-p|--stdout] [-q|--quiet] [--marker-size=<n>]
<current-file> <base-file> <other-file>
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.
+lines from `<other-file>` 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.
diff --git a/builtin-merge-file.c b/builtin-merge-file.c
index cca81c2dde3be92341df7f98eecde2df0299686e..fec15cc1ff3c44f056273e1a5ddfdb79e1b1e441 100644 (file)
--- a/builtin-merge-file.c
+++ b/builtin-merge-file.c
XDL_MERGE_FAVOR_OURS),
OPT_SET_INT(0, "theirs", &xmp.favor, "for conflicts, use their version",
XDL_MERGE_FAVOR_THEIRS),
+ OPT_INTEGER(0, "marker-size", &xmp.marker_size,
+ "for conflicts, use this marker size"),
OPT__QUIET(&quiet),
OPT_CALLBACK('L', NULL, names, "name",
"set labels for file1/orig_file/file2", &label_cb),
diff --git a/t/t6023-merge-file.sh b/t/t6023-merge-file.sh
index 6291307cd03e4e374e640dc82ddc8f26dbb8ff1d..9c5ef68d8cc9eb3fcb12a6d376affe6f307986ee 100755 (executable)
--- a/t/t6023-merge-file.sh
+++ b/t/t6023-merge-file.sh
test_cmp expect actual
'
+cat >expect <<\EOF
+Dominus regit me,
+<<<<<<<<<< new8.txt
+et nihil mihi deerit;
+
+
+
+
+In loco pascuae ibi me collocavit;
+super aquam refectionis educavit me.
+||||||||||
+et nihil mihi deerit.
+In loco pascuae ibi me collocavit,
+super aquam refectionis educavit me;
+==========
+et nihil mihi deerit,
+
+
+
+
+In loco pascuae ibi me collocavit --
+super aquam refectionis educavit me,
+>>>>>>>>>> new9.txt
+animam meam convertit,
+deduxit me super semitas jusitiae,
+propter nomen suum.
+Nam et si ambulavero in medio umbrae mortis,
+non timebo mala, quoniam TU mecum es:
+virga tua et baculus tuus ipsa me consolata sunt.
+EOF
+
+test_expect_success 'marker size' '
+ test_must_fail git merge-file -p --marker-size=10 \
+ new8.txt new5.txt new9.txt >actual &&
+ test_cmp expect actual
+'
+
test_done