git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Elijah Newren <newren@gmail.com>
Cc: Phillip Wood <phillip.wood@dunelm.org.uk>,
	Bagas Sanjaya <bagasdotme@gmail.com>,
	Git Mailing List <git@vger.kernel.org>
Subject: Re: git status when merging non-conflicted 3-way merge says "All conflicts fixed"
Date: Thu, 27 May 2021 07:54:43 +0900	[thread overview]
Message-ID: <xmqqeedtayx8.fsf@gitster.g> (raw)
In-Reply-To: <CABPp-BF_JkDjXnWnLsYFj0ywpp-r-O7RaqMKFCtQWe8yeJB8Xw@mail.gmail.com> (Elijah Newren's message of "Wed, 26 May 2021 09:07:59 -0700")

Elijah Newren <newren@gmail.com> writes:

>   * Can we rely on the extension being written and populated? (does it
> get populated by all relevant codepaths in git?)

The only place record_resolve_undo() gets called is in the deep guts
of in-core index manipulation where a conflicted entry is removed
(either because the resolution decided was to remove the path, or
the resolution is about to add the final contents for the path at
the stage #0), so yes, as long as you are manipulating the in-core
index using our API, you should be recording the action.  Otherwise
we have a bug, as "--unresolve" has to work correctly all the time.

>   * Even if all codepaths in git will populate it, might the lack of
> this extension (or its lack of entries) imply that the user used some
> other tool (jgit, something in libgit2, etc.) rather than that there
> were no conflicts?

It is possible that third-party tools are buggy and corrupt the
on-disk index that way.

>   * Can we rely on this for all types of conflicts?  For all merge
> backends?  Are there conflict types that don't result in a higher
> stage entry being recorded in the index?

Interesting thought.  I am not confident that the recent "directory
rename" stuff does not break the undo information along that line.

But at least, the idea is that resolve-undo should be able to
reproduce the state immediately after any mergy operation stopped
due to conflicts by resurrecting the higher stage entries.

But I do not think "we had a conflict" is so black and white to
begin with.  If you have a rerere record and rerere.autoupdate
enabled (not recommended), does it mean you didn't have a conflict
when rerere kicks in and you did not have to touch anything to
resolve it this time, or was there a conflict but it was
auto-reoslved?  I think the "unresolve" mechanism should still
record the higher stage entries that gets created first before
rerere.autoupdate removes them, which matches the latter
interpretation that I happen to agree with.

For that matter, if both sides have made changes to the same file
nearby, it is more coherent if we declare that there is a conflict
whether the changes "overlap", as the definition of overlapping is
fuzzy and depending on the inter-hunk context used during the mergy
operation, what humans would consider "close but not overlapping"
gets flagged as a "close enough to warrant manual inspection"
conflict (and you can think of rerere as a way to automate that
'manual inspection' step reusing the prior resolution).

So I'd vote for "No conflicts remain, but you haven't committed",
which would be the most sensible way to phrase the situation.

  reply	other threads:[~2021-05-26 22:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-25  7:03 git status when merging non-conflicted 3-way merge says "All conflicts fixed" Bagas Sanjaya
2021-05-26 14:30 ` Elijah Newren
2021-05-26 15:13   ` Phillip Wood
2021-05-26 16:07     ` Elijah Newren
2021-05-26 22:54       ` Junio C Hamano [this message]
2021-05-26 16:06   ` Igor Djordjevic
2021-05-26 16:08     ` Elijah Newren

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

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

  git send-email \
    --in-reply-to=xmqqeedtayx8.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=bagasdotme@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=newren@gmail.com \
    --cc=phillip.wood@dunelm.org.uk \
    /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.
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 NNTP newsgroup(s).