git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Better advice on merge
@ 2013-05-01 11:22 Vikrant Varma
  2013-05-01 11:22 ` [PATCH 1/2] help: add help_unknown_ref Vikrant Varma
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Vikrant Varma @ 2013-05-01 11:22 UTC (permalink / raw)
  To: git; +Cc: Vikrant Varma

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

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2013-05-01 23:07 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-01 11:22 [PATCH 0/2] Better advice on merge Vikrant Varma
2013-05-01 11:22 ` [PATCH 1/2] help: add help_unknown_ref Vikrant Varma
2013-05-01 12:23   ` Ramkumar Ramachandra
2013-05-01 14:06     ` Matthieu Moy
2013-05-01 19:55     ` Vikrant Varma
2013-05-01 20:23       ` Johannes Sixt
2013-05-01 20:32       ` Ramkumar Ramachandra
2013-05-01 21:45         ` Vikrant Varma
2013-05-01 22:12           ` Junio C Hamano
2013-05-01 18:35   ` Junio C Hamano
2013-05-01 22:26     ` Vikrant Varma
2013-05-01 23:07       ` Junio C Hamano
2013-05-01 11:22 ` [PATCH 2/2] merge: use help_unknown_ref instead of die Vikrant Varma
2013-05-01 18:36   ` Junio C Hamano
2013-05-01 18:27 ` [PATCH 0/2] Better advice on merge Jonathan Nieder
2013-05-01 23:06   ` Vikrant Varma

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).