1
0
mirror of https://github.com/git/git.git synced 2024-09-23 17:51:19 +02:00
git/builtin
Phillip Wood 4496526f80 xdiff: implement a zealous diff3, or "zdiff3"
"zdiff3" is identical to ordinary diff3 except that it allows compaction
of common lines on the two sides of history at the beginning or end of
the conflict hunk.  For example, the following diff3 conflict:

    1
    2
    3
    4
    <<<<<<
    A
    B
    C
    D
    E
    ||||||
    5
    6
    ======
    A
    X
    C
    Y
    E
    >>>>>>
    7
    8
    9

has common lines 'A', 'C', and 'E' on the two sides.  With zdiff3, one
would instead get the following conflict:

    1
    2
    3
    4
    A
    <<<<<<
    B
    C
    D
    ||||||
    5
    6
    ======
    X
    C
    Y
    >>>>>>
    E
    7
    8
    9

Note that the common lines, 'A', and 'E' were moved outside the
conflict.  Unlike with the two-way conflicts from the 'merge'
conflictStyle, the zdiff3 conflict is NOT split into multiple conflict
regions to allow the common 'C' lines to be shown outside a conflict,
because zdiff3 shows the base version too and the base version cannot be
reasonably split.

Note also that the removing of lines common to the two sides might make
the remaining text inside the conflict region match the base text inside
the conflict region (for example, if the diff3 conflict had '5 6 E' on
the right side of the conflict, then the common line 'E' would be moved
outside and both the base and right side's remaining conflict text would
be the lines '5' and '6').  This has the potential to surprise users and
make them think there should not have been a conflict, but there
definitely was a conflict and it should remain.

Based-on-patch-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Co-authored-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Phillip Wood <phillip.wood123@gmail.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-12-01 14:45:58 -08:00
..
add.c Merge branch 'ds/add-rm-with-sparse-index' 2021-10-13 15:15:56 -07:00
am.c Merge branch 'ab/config-based-hooks-1' 2021-10-13 15:15:57 -07:00
annotate.c
apply.c
archive.c
bisect--helper.c
blame.c Merge branch 'ab/parse-options-cleanup' 2021-10-25 16:06:59 -07:00
branch.c for-each-ref: delay parsing of --sort=<atom> options 2021-10-20 14:33:07 -07:00
bugreport.c
bundle.c
cat-file.c
check-attr.c
check-ignore.c
check-mailmap.c
check-ref-format.c
checkout--worker.c pkt-line.[ch]: remove unused packet_read_line_buf() 2021-10-15 13:09:40 -07:00
checkout-index.c
checkout.c
clean.c
clone.c clone: fix a memory leak of the "git_dir" variable 2021-10-23 10:45:25 -07:00
column.c
commit-graph.c Merge branch 'ab/ignore-replace-while-working-on-commit-graph' 2021-11-01 13:48:08 -07:00
commit-tree.c
commit.c
config.c
count-objects.c
credential-cache--daemon.c
credential-cache.c
credential-store.c
credential.c
describe.c
diff-files.c
diff-index.c
diff-tree.c
diff.c
difftool.c Merge branch 'da/difftool-dir-diff-symlink-fix' into maint 2021-10-12 13:51:48 -07:00
env--helper.c
fast-export.c Merge branch 'ab/fsck-unexpected-type' 2021-10-25 16:06:56 -07:00
fast-import.c
fetch-pack.c
fetch.c Merge branch 'jt/push-negotiation-fixes' into maint 2021-10-12 13:51:36 -07:00
fmt-merge-msg.c
for-each-ref.c for-each-ref: delay parsing of --sort=<atom> options 2021-10-20 14:33:07 -07:00
for-each-repo.c
fsck.c Merge branch 'ab/fsck-unexpected-type' 2021-11-12 15:29:25 -08:00
gc.c Merge branch 'ds/no-usable-cron-on-macos' 2021-11-10 15:01:20 -08:00
get-tar-commit-id.c
grep.c grep: fix a "path_list" memory leak 2021-10-23 10:45:25 -07:00
hash-object.c Merge branch 'jc/prefix-filename-allocates' into maint 2021-10-12 13:51:32 -07:00
help.c Merge branch 'ab/help-config-vars' 2021-10-13 15:15:58 -07:00
index-pack.c i18n: fix typos found during l10n for git 2.34.0 2021-10-31 22:49:49 -07:00
init-db.c
interpret-trailers.c
log.c
ls-files.c
ls-remote.c for-each-ref: delay parsing of --sort=<atom> options 2021-10-20 14:33:07 -07:00
ls-tree.c
mailinfo.c
mailsplit.c
merge-base.c
merge-file.c xdiff: implement a zealous diff3, or "zdiff3" 2021-12-01 14:45:58 -08:00
merge-index.c
merge-ours.c
merge-recursive.c
merge-tree.c
merge.c Merge branch 'ab/mark-leak-free-tests-more' 2021-10-25 16:06:59 -07:00
mktag.c
mktree.c
multi-pack-index.c builtin/multi-pack-index.c: don't leak concatenated options 2021-10-28 15:32:14 -07:00
mv.c
name-rev.c
notes.c
pack-objects.c builtin/pack-objects.c: don't leak memory via arguments 2021-10-27 16:26:37 -07:00
pack-redundant.c
pack-refs.c
patch-id.c
prune-packed.c
prune.c
pull.c Merge branch 'ev/pull-already-up-to-date-is-noop' 2021-11-21 21:57:04 -08:00
push.c
range-diff.c
read-tree.c
rebase.c Merge branch 'js/retire-preserve-merges' 2021-10-18 15:47:56 -07:00
receive-pack.c Merge branch 'fs/ssh-signing' 2021-10-25 16:06:58 -07:00
reflog.c reflog: free() ref given to us by dwim_log() 2021-10-23 10:45:25 -07:00
remote-ext.c
remote-fd.c
remote.c Merge branch 'ab/designated-initializers-more' 2021-10-18 15:47:57 -07:00
repack.c builtin/repack.c: avoid leaking child arguments 2021-10-28 15:31:51 -07:00
replace.c
rerere.c
reset.c
rev-list.c
rev-parse.c
revert.c
rm.c Merge branch 'ds/add-rm-with-sparse-index' 2021-10-13 15:15:56 -07:00
send-pack.c Merge branch 'jk/http-push-status-fix' 2021-10-29 15:43:12 -07:00
shortlog.c
show-branch.c
show-index.c
show-ref.c
sparse-checkout.c
stash.c stash: get rid of unused argument in stash_staged() 2021-10-28 14:17:14 -07:00
stripspace.c
submodule--helper.c Merge branch 'ks/submodule-add-message-fix' 2021-10-29 15:43:14 -07:00
symbolic-ref.c
tag.c for-each-ref: delay parsing of --sort=<atom> options 2021-10-20 14:33:07 -07:00
unpack-file.c
unpack-objects.c
update-index.c
update-ref.c
update-server-info.c
upload-archive.c
upload-pack.c
var.c
verify-commit.c
verify-pack.c
verify-tag.c
worktree.c
write-tree.c