git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Improving merge failure message

From
Nanako Shiraishi <nanako3@lavabit.com>
Date
Sep 8, 2009, 06:31 UTC
Message-ID
<20090908153101.6117@nanako3.lavabit.com>

I often see my students confused after a failed merge and they can't figure out what to do next. Two typical error messages they get are

[1]% git merge master Auto-merging cool CONFLICT (content): Merge conflict in cool Automatic merge failed; fix conflicts and then commit the result.

[2]% git merge feature error: Entry 'cool' not uptodate. Cannot merge. fatal: merging of trees 8ec1d96451ff05451720e4e8968812c46b35e5e4 and aad8d5cef3915ab78b3227abaaac99b62db9eb54 failed

In the former case, the merge command gives a helpful message that automatic merge failed because it found a conflict and tells enough instruction to the user.

But in the latter case, the messages look unnecessarily scary, with two "error" and "fatal" comments, and long sha1 commit names.

Those of us who used git for some time can tell what it wants to say. The merge checked the files in the working tree before doing anything, found that the user has uncommitted change to a file that is involved in the merge, and it stopped. And it didn't change anything. It may be "fatal" but the user has much less reason to be scared about this failure than the conflicting case.

It would be nice if the message in the latter case can be toned down.
-- 
Nanako Shiraishi
http://ivory.ap.teacup.com/nanako3/
Next: Junio C Hamano
Message 1 of 11 in “Improving merge failure message”
  1. Nanako ShiraishiSep 8, 2009
  2. Junio C HamanoSep 8, 2009
  3. Junio C HamanoSep 8, 2009
  4. Sverre RabbelierSep 8, 2009
  5. Junio C HamanoSep 8, 2009
  6. Jeff KingSep 8, 2009
  7. Mike RalphsonSep 8, 2009
  8. Junio C HamanoSep 8, 2009
  9. Alex RiesenSep 8, 2009
  10. Nanako ShiraishiSep 8, 2009
  11. Johannes SixtSep 8, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.