[PATCH 1/2] help: add help_unknown_ref

2013-05-01 Thread Vikrant Varma
Give better advice when trying to merge a branch that doesn't exist. If the branch exists in any remotes, display a list of suggestions. Example: $ git merge foo fatal: foo - not something we can merge Did you mean this? bar/foo Signed-off-by: Vikrant Varma

Re: [PATCH 1/2] help: add help_unknown_ref

2013-05-01 Thread Ramkumar Ramachandra
Vikrant Varma wrote: Give better advice when trying to merge a branch that doesn't exist. If the branch exists in any remotes, display a list of suggestions. Interesting. Thanks for working on this. You say advice, but you're not invoking advise() or guarding the advice with an advice.* --

Re: [PATCH 1/2] help: add help_unknown_ref

2013-05-01 Thread Junio C Hamano
Vikrant Varma vikrant.varm...@gmail.com writes: Give better advice when trying to merge a branch that doesn't exist. If the branch exists in any remotes, display a list of suggestions. Example: $ git merge foo fatal: foo - not something we can merge Did you mean this?

Re: [PATCH 1/2] help: add help_unknown_ref

2013-05-01 Thread Vikrant Varma
On 01-05-2013 17:53, Ramkumar Ramachandra wrote: Vikrant Varma wrote: Give better advice when trying to merge a branch that doesn't exist. If the branch exists in any remotes, display a list of suggestions. Interesting. Thanks for working on this. You say advice, but you're not invoking

Re: [PATCH 1/2] help: add help_unknown_ref

2013-05-01 Thread Johannes Sixt
Am 01.05.2013 21:55, schrieb Vikrant Varma: On 01-05-2013 17:53, Ramkumar Ramachandra wrote: Vikrant Varma wrote: +void help_unknown_ref(const char* ref) { +int i; +struct similar_ref_cb ref_cb; +ref_cb.similar_refs = (struct string_list)STRING_LIST_INIT_NODUP; Why

Re: [PATCH 1/2] help: add help_unknown_ref

2013-05-01 Thread Ramkumar Ramachandra
Vikrant Varma wrote: I agree with Matthieu, the people who don't want to see this advice never will, because they won't make that mistake. Maybe advice is the wrong word, corrections might be more appropriate. Makes sense. Perhaps it would make sense to hook into help.autocorrect. I would

Re: [PATCH 1/2] help: add help_unknown_ref

2013-05-01 Thread Vikrant Varma
On 02-05-2013 02:02, Ramkumar Ramachandra wrote: ref_cb.similar_refs has already been defined. The compiler won't let me assign to it unless I cast first. However, I think compound literals are a C99/gcc feature. Is this better? struct similar_ref_cb ref_cb = {ref,

Re: [PATCH 1/2] help: add help_unknown_ref

2013-05-01 Thread Junio C Hamano
Vikrant Varma vikrant.varm...@gmail.com writes: On 02-05-2013 02:02, Ramkumar Ramachandra wrote: ref_cb.similar_refs has already been defined. The compiler won't let me assign to it unless I cast first. However, I think compound literals are a C99/gcc feature. Is this better?

Re: [PATCH 1/2] help: add help_unknown_ref

2013-05-01 Thread Vikrant Varma
On 02-05-2013 00:05, Junio C Hamano wrote: If you step back a bit, you would notice two things. (1) Saying 'foo' when the user means 'origin/foo' is hardly the only (or even the most common) kind of mistake that the code you need to add to 'git merge' would encounter and could

Re: [PATCH 1/2] help: add help_unknown_ref

2013-05-01 Thread Junio C Hamano
Vikrant Varma vikrant.varm...@gmail.com writes: On 02-05-2013 00:05, Junio C Hamano wrote: If you step back a bit, you would notice two things. (1) Saying 'foo' when the user means 'origin/foo' is hardly the only (or even the most common) kind of mistake that the code you need