git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Michael Ernst <mernst@cs.washington.edu>
Cc: git@vger.kernel.org
Subject: Re: Feature request: a merge strategy that makes any file difference a merge conflict
Date: Fri, 29 Mar 2024 12:40:45 -0700	[thread overview]
Message-ID: <xmqqfrw8ygg2.fsf@gitster.g> (raw)
In-Reply-To: <CAAJCdQQB3_DWOTCTbb-TAkLUX_XVd5TBd3z0M2_KrHxKxr69Kw@mail.gmail.com> (Michael Ernst's message of "Fri, 29 Mar 2024 12:20:59 -0700")

Michael Ernst <mernst@cs.washington.edu> writes:

> Git's built-in merge strategies, such as ort, sometimes create a
> clean-but-incorrect merge.  A merge driver or a mergetool cannot be
> used to correct such problems, because a merge driver or mergetool is
> only called when the strategy resulted in a conflict (so far as I
> understand).

A custom low-level merge driver is always called when selected via
the attribute mechansism (see how merge-ll.c:ll_merge() calls
find_ll_merge_driver()) and participates in a content-level 3-way
merge.

If you are trying to interfere with cases that a content-level 3-way
merge does not kick in (e.g., your side did not change anything in
the file since their history forked, and they modified the file; the
tree level 3-way merge will resolve it to take their version), then
it is true that the low-level merge driver is not invoked, but I
somehow get an impression from the above description that it is not
what you are trying to do.

> It is challenging to write a merge strategy, but it is
> much easier to write a merge driver or a mergetool.

A merge strategy is about performing three-way merge at the tree
level, figuring out which three variants of contents to hand to a
merge driver that handles the content-level three-way merge.  They
serve totally different purposes and comparing them is like
comparing apples and oranges.


  reply	other threads:[~2024-03-29 19:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-29 19:20 Feature request: a merge strategy that makes any file difference a merge conflict Michael Ernst
2024-03-29 19:40 ` Junio C Hamano [this message]
2024-03-29 20:43   ` Michael Ernst
2024-04-01 11:00 ` Thomas Braun

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqfrw8ygg2.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=mernst@cs.washington.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).