Re: [PATCH 3/5] checkout --to: no auto-detach if the ref is already checked out

2014-08-27 Thread Junio C Hamano
Duy Nguyen writes: > On Thu, Jul 31, 2014 at 1:03 AM, Junio C Hamano wrote: >> Michael J Gruber writes: >> >>> As an error message that is completely sufficient. >>> >>> The advice messages are meant to teach the user about the normal parts >>> of the toolchest to use in a situation of "conflic

Re: [PATCH 3/5] checkout --to: no auto-detach if the ref is already checked out

2014-08-27 Thread Duy Nguyen
On Thu, Jul 31, 2014 at 1:03 AM, Junio C Hamano wrote: > Michael J Gruber writes: > >> As an error message that is completely sufficient. >> >> The advice messages are meant to teach the user about the normal parts >> of the toolchest to use in a situation of "conflict", aren't they? > > Not real

Re: [PATCH 3/5] checkout --to: no auto-detach if the ref is already checked out

2014-07-30 Thread Junio C Hamano
Junio C Hamano writes: > Michael J Gruber writes: > >> As an error message that is completely sufficient. >> >> The advice messages are meant to teach the user about the normal parts >> of the toolchest to use in a situation of "conflict", aren't they? > > Not really. They are to remind (to tho

Re: [PATCH 3/5] checkout --to: no auto-detach if the ref is already checked out

2014-07-30 Thread Junio C Hamano
Michael J Gruber writes: > As an error message that is completely sufficient. > > The advice messages are meant to teach the user about the normal parts > of the toolchest to use in a situation of "conflict", aren't they? Not really. They are to remind (to those who learned but forgot) and to h

Re: [PATCH 3/5] checkout --to: no auto-detach if the ref is already checked out

2014-07-24 Thread Michael J Gruber
Junio C Hamano venit, vidit, dixit 24.07.2014 23:30: > Duy Nguyen writes: > >> On Wed, Jul 23, 2014 at 8:48 PM, Michael J Gruber >> wrote: >>> Nguyễn Thái Ngọc Duy venit, vidit, dixit 23.07.2014 13:43: + if (advice_checkout_to) + die(_("%s is already checked out at %s.\

Re: [PATCH 3/5] checkout --to: no auto-detach if the ref is already checked out

2014-07-24 Thread Junio C Hamano
Duy Nguyen writes: > On Wed, Jul 23, 2014 at 8:48 PM, Michael J Gruber > wrote: >> Nguyễn Thái Ngọc Duy venit, vidit, dixit 23.07.2014 13:43: >>> + if (advice_checkout_to) >>> + die(_("%s is already checked out at %s.\n" >>> + "Either use --detach or -b together

Re: [PATCH 3/5] checkout --to: no auto-detach if the ref is already checked out

2014-07-24 Thread Junio C Hamano
Junio C Hamano writes: > Duy Nguyen writes: > >> On Thu, Jul 24, 2014 at 4:16 AM, Junio C Hamano wrote: + if (strbuf_read_file(&sb, path.buf, 0) <= 0 || + !skip_prefix(sb.buf, "ref:", &start)) + goto done; while (isspace(*start))

Re: [PATCH 3/5] checkout --to: no auto-detach if the ref is already checked out

2014-07-24 Thread Junio C Hamano
Duy Nguyen writes: > On Thu, Jul 24, 2014 at 4:16 AM, Junio C Hamano wrote: >>> + if (strbuf_read_file(&sb, path.buf, 0) <= 0 || >>> + !skip_prefix(sb.buf, "ref:", &start)) >>> + goto done; >>> while (isspace(*start)) >>> start++; >>> end = start

Re: [PATCH 3/5] checkout --to: no auto-detach if the ref is already checked out

2014-07-24 Thread Duy Nguyen
On Thu, Jul 24, 2014 at 4:16 AM, Junio C Hamano wrote: >> + if (strbuf_read_file(&sb, path.buf, 0) <= 0 || >> + !skip_prefix(sb.buf, "ref:", &start)) >> + goto done; >> while (isspace(*start)) >> start++; >> end = start; >> while (*end && !is

Re: [PATCH 3/5] checkout --to: no auto-detach if the ref is already checked out

2014-07-24 Thread Duy Nguyen
On Wed, Jul 23, 2014 at 8:48 PM, Michael J Gruber wrote: > Nguyễn Thái Ngọc Duy venit, vidit, dixit 23.07.2014 13:43: >> + if (advice_checkout_to) >> + die(_("%s is already checked out at %s.\n" >> + "Either use --detach or -b together with --to " >> +

Re: [PATCH 3/5] checkout --to: no auto-detach if the ref is already checked out

2014-07-23 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy writes: > diff --git a/builtin/checkout.c b/builtin/checkout.c > index c83f476..d35245a 100644 > --- a/builtin/checkout.c > +++ b/builtin/checkout.c > @@ -1006,31 +1006,52 @@ static const char *unique_tracking_name(const char > *name, unsigned char *sha1) > return NUL

Re: [PATCH 3/5] checkout --to: no auto-detach if the ref is already checked out

2014-07-23 Thread Junio C Hamano
Michael J Gruber writes: >> +if (advice_checkout_to) >> +die(_("%s is already checked out at %s.\n" >> + "Either use --detach or -b together with --to " >> + "or switch branch in the the other checkout."), > > "or switch to a different branch in t

Re: [PATCH 3/5] checkout --to: no auto-detach if the ref is already checked out

2014-07-23 Thread Michael J Gruber
Nguyễn Thái Ngọc Duy venit, vidit, dixit 23.07.2014 13:43: > Give the user a choice in this case. If they want to detach, they can go > with '--detach --to ...', or they could switch branch of the checkout > that's holding the ref in question. Or they could just create a new > branch with '-b xxx -