Re: [PATCH 3/5] checkout --to: no auto-detach if the ref is already checked out
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jul 23, 2014, 17:46 UTC
- Message-ID
- <xmqqmwc0dl46.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <53CFBD2A.9030803@drmicha.warpmail.net>
Michael J Gruber <git@drmicha.warpmail.net> writes:
Show 16 quoted lines
>> + 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 the other checkout". But maybe we
> can be even more helpful, like:
>
> "%s is already checked out at %s.\n"
> "Either checkout the detached head of branch %s using\n"
> " git checkout --detach --to %s %s\n"
> "or checkout a new branch based off %s using\n"
> " git checkout --to %s -b %s newbranch %s\n"
> "or switch to a different branch in the other checkout."
>
> if we can figure out the appropriate arguments at this point in the code.Another possible alternative is "go and work there instead of creating yet another checkout", but is that too obvious without saying?