Re: Interpreting git merge failures
- From
Jeff King <peff@peff.net>
- Date
- Jul 12, 2011, 06:33 UTC
- Message-ID
- <20110712063300.GB12491@sigill.intra.peff.net>
- In-Reply-To
- <CAKmUPx5Qt2K+7F+BsW3WTmRjodBSrteuyG8p9oRHZuhApTu4+g@mail.gmail.com>
On Thu, Jul 07, 2011 at 11:45:57AM -0700, Scott Bronson wrote:
Show 6 quoted lines
> 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