From: Taylor Blau <me@ttaylorr.com>
To: Max Coplan via GitGitGadget <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, Max Coplan <mchcopl@gmail.com>
Subject: Re: [PATCH] po: use `switch` over `checkout` in error message
Date: Wed, 9 Nov 2022 16:40:11 -0500 [thread overview]
Message-ID: <Y2weO5PczNYAJs/s@nand.local> (raw)
In-Reply-To: <pull.1308.git.git.1668018620148.gitgitgadget@gmail.com>
On Wed, Nov 09, 2022 at 06:30:17PM +0000, Max Coplan via GitGitGadget wrote:
> From: =?UTF-8?q?Max=20=F0=9F=91=A8=F0=9F=8F=BD=E2=80=8D=F0=9F=92=BB=20Copl?=
> =?UTF-8?q?an?= <mchcopl@gmail.com>
>
> Small change. Since `switch` is suggested for changing branches over
> `checkout`, this commit updates an error message to use `switch` as the
> default
OK.
> Signed-off-by: Max 👨🏽💻 Coplan <mchcopl@gmail.com>
Hmm ;-). It is generally preferred that you use your real name in the
Signed-off-by trailer. I am guessing that your name does not have emoji
in it.
See Documentation/SubmittingPatches for more.
> builtin/checkout.c | 2 +-
> po/bg.po | 4 ++--
> po/ca.po | 4 ++--
> po/de.po | 4 ++--
> po/el.po | 4 ++--
> po/es.po | 4 ++--
> po/fr.po | 4 ++--
> po/id.po | 4 ++--
> po/it.po | 4 ++--
> po/pl.po | 4 ++--
> po/pt_PT.po | 2 +-
> po/ru.po | 2 +-
> po/sv.po | 4 ++--
> po/tr.po | 4 ++--
> po/vi.po | 4 ++--
> po/zh_CN.po | 4 ++--
> po/zh_TW.po | 4 ++--
Changes to po/ are coordinated by Jiang Xin, and the changes happen at:
https://github.com/git-l10n/git-po/
and are then pulled into this tree.
> diff --git a/builtin/checkout.c b/builtin/checkout.c
> index 29c74f898bf..51f9f928113 100644
> --- a/builtin/checkout.c
> +++ b/builtin/checkout.c
> @@ -1222,7 +1222,7 @@ static const char *parse_remote_branch(const char *arg,
> advise(_("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>\n"
> + " git switch --track origin/<name>\n"
> "\n"
> "If you'd like to always have checkouts of an ambiguous <name> prefer\n"
> "one remote, e.g. the 'origin' remote, consider setting\n"
Now we get to the main part of the change. And here I am torn:
- parse_remote_branch() is called from parse_branchname_arg()
- parse_branchname_arg() has a single caller in checkout_main()
...which is called from 'cmd_switch()', 'cmd_restore()', and
'cmd_checkout()'.
So depending on which of those three we are being called from, the
advice will or won't match up with the caller.
I haven't looked further to see if there is some mitigating condition
that prevents us from ending up in parse_remote_branch() from callers
outside of 'cmd_switch()', but I'm guessing that probably isn't the
case.
So in that sense your patch isn't making anything worse, but I think
empirically it does seem worse, since 'checkout' has more staying-power
than 'switch' (at least at the time of writing).
We could set some static 'source' variable or some such to indicate
which caller is driving us, but that feels a little hacky.
I dunno.
Thanks,
Taylor
prev parent reply other threads:[~2022-11-09 21:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-09 18:30 [PATCH] po: use `switch` over `checkout` in error message Max Coplan via GitGitGadget
2022-11-09 21:40 ` Taylor Blau [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y2weO5PczNYAJs/s@nand.local \
--to=me@ttaylorr.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=mchcopl@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).