git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [RFC] improving advice message from "git commit" during a merge
Date: Wed, 27 Aug 2014 15:18:58 -0400	[thread overview]
Message-ID: <20140827191857.GB7561@peff.net> (raw)
In-Reply-To: <xmqq4mwxeqr7.fsf@gitster.dls.corp.google.com>

On Wed, Aug 27, 2014 at 11:23:08AM -0700, Junio C Hamano wrote:

> When there are unmerged paths, you would often get something like
> this:
> 
>     [git.git (pu|MERGING]$ git commit
>     U       copy.c
>     U       wrapper.c
>     error: commit is not possible because you have unmerged files.
>     hint: Fix them up in the work tree, and then use 'git add/rm <file>'
>     hint: as appropriate to mark resolution and make a commit, or use
>     hint: 'git commit -a'.
>     fatal: Exiting because of an unresolved conflict.
> 
> which is all good and correct, but I am wondering if we can be a bit
> more helpful by customizing the message in various ways.
> 
>  - When all the unmerged paths have their conflicts resolved in the
>    working tree, we do not have to say "Fix them up in the work
>    tree,".  We can instead say "You seem to have fixed them up in
>    the work tree already," or something.

How are you determining what has been resolved? By looking for "<<<<<<<"
markers? That feels a little flaky, but I guess it would probably work
well enough in practice.

If we started using that heuristic, it would probably make sense to
teach "git status" about it (and then maybe just have a failed "commit"
rely on wt_status to produce the output).

> I am not doing this myself soon, though.  Hint, hint...

Me either, though it all seems like a sensible direction to me.

-Peff

  reply	other threads:[~2014-08-27 19:19 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-27 18:23 [RFC] improving advice message from "git commit" during a merge Junio C Hamano
2014-08-27 19:18 ` Jeff King [this message]
2014-08-27 19:28   ` Junio C Hamano
2014-08-28  9:46 ` [PATCH] merge, pull: stop advising 'commit -a' in case of conflict Matthieu Moy
2014-08-28 17:28   ` Junio C Hamano
2014-08-28 17:41     ` Matthieu Moy
2014-08-28 18:16   ` Jonathan Nieder
2014-08-28 18:36     ` Junio C Hamano
2014-08-29  6:44       ` Matthieu Moy
2014-08-28 12:17 ` [RFC] improving advice message from "git commit" during a merge Stefan Beller
2014-08-28 17:11   ` Junio C Hamano

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=20140827191857.GB7561@peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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).