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

[PATCH 0/2] Better advice on merge

From
Vikrant Varma <vikrant.varma94@gmail.com>
Date
May 1, 2013, 11:22 UTC
Message-ID
<1367407327-5216-1-git-send-email-vikrant.varma94@gmail.com>
If origin/foo exists, but foo doesn't:
   $ git merge foo
   fatal: foo - not something we can merge

This patch series improves the error message. If a remote branch exists with the same name, it now says:

     $ git merge foo
     fatal: foo - not something we can merge
     Did you mean this?
     	 origin/foo

It does this by adding a new help function, help_unknown_ref, that takes care of printing the more friendly error message, and modifies builtin/merge.c to use it. In the future, this could also be extended to other operations involving branches that don't exist locally, instead of providing blanket failure error messages (eg. git checkout foo).

Vikrant Varma (2):
  help: add help_unknown_ref
  merge: use help_unknown_ref instead of die
 builtin/merge.c |  4 ++--
 help.c          | 44 ++++++++++++++++++++++++++++++++++++++++++++
 help.h          |  6 ++++++
 3 files changed, 52 insertions(+), 2 deletions(-)
-- 
1.8.3-rc0
Next: Vikrant Varma
Message 1 of 16 in “Better advice on merge”
  1. 0/2 Better advice on mergeVikrant Varma, May 1, 2013
  2. 1/2 help: add help_unknown_refVikrant Varma, May 1, 2013
  3. Ramkumar RamachandraMay 1, 2013
  4. Matthieu MoyMay 1, 2013
  5. Vikrant VarmaMay 1, 2013
  6. Johannes SixtMay 1, 2013
  7. Ramkumar RamachandraMay 1, 2013
  8. Vikrant VarmaMay 1, 2013
  9. Junio C HamanoMay 1, 2013
  10. Junio C HamanoMay 1, 2013
  11. Vikrant VarmaMay 1, 2013
  12. Junio C HamanoMay 1, 2013
  13. 2/2 merge: use help_unknown_ref instead of dieVikrant Varma, May 1, 2013
  14. Junio C HamanoMay 1, 2013
  15. Jonathan NiederMay 1, 2013
  16. Vikrant VarmaMay 1, 2013

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.