git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Scott Bronson <bronson@rinspin.com>
Cc: git@vger.kernel.org
Subject: Re: Interpreting git merge failures
Date: Tue, 12 Jul 2011 02:33:00 -0400	[thread overview]
Message-ID: <20110712063300.GB12491@sigill.intra.peff.net> (raw)
In-Reply-To: <CAKmUPx5Qt2K+7F+BsW3WTmRjodBSrteuyG8p9oRHZuhApTu4+g@mail.gmail.com>

On Thu, Jul 07, 2011 at 11:45:57AM -0700, Scott Bronson wrote:

> What is the best way to determine why a git merge failed?
> I'm writing a script that needs to do different things depending
> on what went wrong.
> 
> Right now I'm parsing error messages.  It's obviously a bad
> idea and prone to breakage but it does work.   Example:

Sorry, that's the best you can do with "git merge" currently.

The usual advice would be to check the repo status yourself with
plumbing tools, but:

  1. That's a lot of work on the part of a script writer.

  2. It's not atomic. You want to know why a merge failed, but
     circumstances might have changed since the original failure.

It would be nice if "git merge" gave different exit codes for various
situations. I don't think it would be all that big a change, and you
might be a good person to suggest which conditions need their own exit
code, as you are also writing the consuming end of the codes.

Want to write a patch?

-Peff

  reply	other threads:[~2011-07-12  6:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-07 18:45 Interpreting git merge failures Scott Bronson
2011-07-12  6:33 ` Jeff King [this message]
2011-07-12 16:40 ` 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

  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=20110712063300.GB12491@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=bronson@rinspin.com \
    --cc=git@vger.kernel.org \
    /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).