Skip to content

Show suggested refs when ref unknown

Vikrant Varma git 2 versions In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 2 repliesIn review
  2. v12 patches 13 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2help: add help_unknown_refhelp.c help.h+55 -02 replies
2/2merge: use help_unknown_refbuiltin/merge.c+2 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

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

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(-)
Signature · 1 line
1.7.10.4