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

[PATCH v2 0/2] Show suggested refs when ref unknown

From
Vikrant Varma <vikrant.varma94@gmail.com>
Date
May 4, 2013, 00:04 UTC
Message-ID
<1367625860-20746-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.

This function can easily be used by other operations involving refs that don't exist instead of providing blanket failure error messages (eg. git checkout foo).

Vikrant Varma (2):
  help: add help_unknown_ref
  merge: use help_unknown_ref
 builtin/merge.c |    3 ++-
 help.c          |   50 ++++++++++++++++++++++++++++++++++++++++++++++++++
 help.h          |    5 +++++
 3 files changed, 57 insertions(+), 1 deletion(-)
-- 
1.7.10.4
Next: Vikrant Varma
Message 1 of 5 in “Show suggested refs when ref unknown”
  1. 0/2 Show suggested refs when ref unknownVikrant Varma, May 4, 2013
  2. 1/2 help: add help_unknown_refVikrant Varma, May 4, 2013
  3. Junio C HamanoMay 8, 2013
  4. Vikrant VarmaMay 9, 2013
  5. 2/2 merge: use help_unknown_refVikrant Varma, May 4, 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.