Re: [PATCH v5 7/8] checkout: add advice for ambiguous "checkout <branch>"
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Jun 1, 2018, 22:52 UTC
- Message-ID
- <CAPig+cRGDi-FX1Pr-7dt7G1fbP=ZabFNimuMr-OheBabKAXHLA@mail.gmail.com>
- In-Reply-To
- <20180601211015.11919-8-avarab@gmail.com>
On Fri, Jun 1, 2018 at 5:10 PM, Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:
Show 7 quoted lines
> As the "checkout" documentation describes: > > If <branch> is not found but there does exist a tracking branch in > exactly one remote (call it <remote>) with a matching name, treat > as equivalent to [...] <remote>/<branch. > > This is a really useful feature. The problem is that when you and
s/and/add/
> another remote (e.g. a fork) git won't find a unique branch name
Missing comma: s/)/),/
> anymore, and will instead print this nondescript message:
Perhaps s/nondescript/unhelpful/ ?
Show 12 quoted lines
> $ git checkout master > error: pathspec 'master' did not match any file(s) known to git > > Now it will, on my git.git checkout, print: > > $ ./git --exec-path=$PWD checkout master > error: pathspec 'master' did not match any file(s) known to git. > hint: The argument 'master' matched more than one remote tracking branch. > hint: We found 26 remotes with a reference that matched. So we fell back > hint: on trying to resolve the argument as a path, but failed there too! > hint: > hint: If you meant to check out a remote tracking branch on e.g. 'origin'
Missing commas: s/on e.g. 'origin'/on, e.g. 'origin',/
> hint: you can do so by fully-qualifying the name with the --track option:
s/fully-qualifying/fully qualifying/
> hint: > hint: git checkout --track origin/<name> > > Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Aside from the s/and/add/ botch, all of the above are tiny nits which don't actually impact the meaning of the commit message, thus not really important.
Show 6 quoted lines
> ---
> diff --git a/builtin/checkout.c b/builtin/checkout.c
> @@ -1267,6 +1268,18 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)
> + if (ret && dwim_remotes_matched > 1 &&
> + advice_checkout_ambiguous_remote_branch_name)
> + advise(_("The argument '%s' matched more than one remote tracking branch.\n"You could drop "The argument" prefix, without hurting the meaning at all, in order to gain a bit more horizontal space for the '%s' interpolation. (Not worth a re-roll.)
Show 9 quoted lines
> + "We found %d remotes with a reference that matched. So we fell back\n" > + "on trying to resolve the argument as a path, but failed there too!\n" > + "\n" > + "If you meant to check out a remote tracking branch on e.g. 'origin'\n" > + "you can do so by fully-qualifying the name with the --track option:\n" > + "\n" > + " git checkout --track origin/<name>"), > + argv[0], > + dwim_remotes_matched);