On Wed, Jul 23, 2014 at 8:48 PM, Michael J Gruber
<g...@drmicha.warpmail.net> 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 "
>> +                   "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.

We would not be able to construct the exact command that the user has
entered, so perhaps

  git checkout --detach <more options> %s
  git checkout -b <new branch> <more options> %s


Note that this does not only occur when --to is given. If you have two
checkouts associated to the same repo, "git checkout foo" on one
checkout when "foo" is held by another checkout would cause the same
error. I'll need to think of a better name than advice.checkoutTo.
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to