Re: [PATCH 2/3] branch: suggest how to undo a --set-upstream when given one branch

2012-07-11 Thread Carlos Martín Nieto
On Tue, 2012-07-10 at 19:20 +0200, Matthieu Moy wrote: Carlos Martín Nieto c...@elego.de writes: --- a/builtin/branch.c +++ b/builtin/branch.c @@ -864,10 +864,32 @@ int cmd_branch(int argc, const char **argv, const char *prefix) info and making sure new_upstream is

Re: [PATCH 2/3] branch: suggest how to undo a --set-upstream when given one branch

2012-07-11 Thread Carlos Martín Nieto
On Tue, 2012-07-10 at 10:40 -0700, Junio C Hamano wrote: Carlos Martín Nieto c...@elego.de writes: This interface is error prone, and a better one (--set-upstream-to) exists. Suggest how to fix a --set-upstream invocation in case the user only gives one argument, which makes it likely

Re: [PATCH 2/3] branch: suggest how to undo a --set-upstream when given one branch

2012-07-11 Thread Carlos Martín Nieto
On Tue, 2012-07-10 at 18:00 -0500, Jonathan Nieder wrote: Junio C Hamano wrote: I think it is better to leave them emitted unconditionally to the standard error stream, in order to train users away from using the old option that

[PATCH 2/3] branch: suggest how to undo a --set-upstream when given one branch

2012-07-10 Thread Carlos Martín Nieto
This interface is error prone, and a better one (--set-upstream-to) exists. Suggest how to fix a --set-upstream invocation in case the user only gives one argument, which makes it likely that he meant to do the opposite, like with git branch --set-upstream origin/master when they meant one

Re: [PATCH 2/3] branch: suggest how to undo a --set-upstream when given one branch

2012-07-10 Thread Junio C Hamano
Carlos Martín Nieto c...@elego.de writes: This interface is error prone, and a better one (--set-upstream-to) exists. Suggest how to fix a --set-upstream invocation in case the user only gives one argument, which makes it likely that he meant to do the opposite, like with git branch

Re: [PATCH 2/3] branch: suggest how to undo a --set-upstream when given one branch

2012-07-10 Thread Jonathan Nieder
Hi, Quick nitpicks. Carlos Martín Nieto wrote: --- a/builtin/branch.c +++ b/builtin/branch.c @@ -864,10 +864,32 @@ int cmd_branch(int argc, const char **argv, const char *prefix) info and making sure new_upstream is correct */ create_branch(head,

Re: [PATCH 2/3] branch: suggest how to undo a --set-upstream when given one branch

2012-07-10 Thread Junio C Hamano
Jonathan Nieder jrnie...@gmail.com writes: Message should go on stderr and be guarded with an advice option (see advice.c). Like this: const char *arg; ... if (argc != 1 || !advice_old_fashioned_set_upstream) return 0; /* ok. */ arg = argv[0];

Re: [PATCH 2/3] branch: suggest how to undo a --set-upstream when given one branch

2012-07-10 Thread Jonathan Nieder
Junio C Hamano wrote: I think it is better to leave them emitted unconditionally to the standard error stream, in order to train users away from using the old option that has its arguments wrong (the option does not take an argument