From: Igor Djordjevic <igor.d.djordjevic@gmail.com>
To: Elijah Newren <newren@gmail.com>, Bagas Sanjaya <bagasdotme@gmail.com>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: git status when merging non-conflicted 3-way merge says "All conflicts fixed"
Date: Wed, 26 May 2021 18:06:30 +0200 [thread overview]
Message-ID: <365cecf9-2ce7-9d8d-6898-3234807df963@gmail.com> (raw)
In-Reply-To: <CABPp-BHq+=Q6EDNOHJGoUvJsezn=hbQORT=0NRghREf=cnwCYQ@mail.gmail.com>
On 26/05/2021 16:30, Elijah Newren wrote:
> On Tue, May 25, 2021 at 1:22 AM Bagas Sanjaya <bagasdotme@gmail.com> wrote:
> >
> > Hi,
> >
> > Supposed that we have following commit graph:
> >
> > ----A----B----C----D <- master
> > \
> > ----E <- e
> >
> > When we merge e branch by `git merge e`, obviously we will do 3-way
> > merge. Assumed that the merge doesn't conflict, Git will fire up
> > editor to edit `COMMIT_EDITMSG` for us to enter merge commit
> > message. Then we abort the commit by either delete all the lines
> > there, or comment all of them.
> >
> > But when we check status by `git status`, Git says:
> >
> > > On branch master
> > > All conflicts fixed but you are still merging.
> > > (use "git commit" to conclude merge)
> >
> > That message above is misleading, because we know that our merge
> > doesn't conflict (3-way merge applied successfully without conflict).
> > However, it makes sense only when we have resolved all conflicts
> > on the conflicted merge.
>
> Once upon a time, that message would have always been right. Then a
> --no-commit option was introduced to git merge, and editing of commit
> messages for merges was also added. As you note, both of those can
> yield cases where the message is misleading/surprising.
>
> > So for non-conflicted merge, we can say instead:
> >
> > > On branch <branch>
> > > You are still merging, and the merge applied without any conflicts.
> > > (use "git commit" to conclude merge)
>
> At the time this message is printed, there is no way for us to know
> whether there had been conflicts. We'd have to record that
> information somewhere (probably the index, though introducing another
> index format just for this seems like a really high lift for such a
> small thing, and may conflict with other efforts to extend the index
> format, such as the sparse-index work), OR re-do the merge when the
> user runs status just to find out whether there had been conflicts
> (which seems like overkill, and would require you to know which merge
> backend had been used and with which flags so you could re-check with
> the same one; further, three of the merge backends -- recursive,
> resolve, and octopus -- all update the working tree and index and thus
> could not be used for a case like this).
>
> Seems like opening a really big can of worms.
All said, would it be an improvement if current message would be
simply reworded to say "No conflicts but you are still merging"
(instead of "All conflicts fixed but you are still merging"), thus
stating the fact (there are no conflicts, indeed) but not implying
how we got there (whether conflicts were fixed, or there were none to
begin with)...?
Regards, Buga
next prev parent reply other threads:[~2021-05-26 16:06 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
2021-05-26 16:06 ` Igor Djordjevic [this message]
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=365cecf9-2ce7-9d8d-6898-3234807df963@gmail.com \
--to=igor.d.djordjevic@gmail.com \
--cc=bagasdotme@gmail.com \
--cc=git@vger.kernel.org \
--cc=newren@gmail.com \
/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).