po: use `switch` over `checkout` in error message
PATCH 1/1 po: use `switch` over `checkout` in error message
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?= <[email protected]>
Small change. Since switch is suggested for changing branches over checkout, this commit updates an error message to use switch as the default
---
po: use switch over checkout in error message
Small change. Since switch is suggested for changing branches over checkout, this commit updates an error message to use switch as the default
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1308%2Fvegerot%2Fupdate-error-message-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1308/vegerot/update-error-message-v1
Pull-Request: https://github.com/git/git/pull/1308
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 ++-- 17 files changed, 31 insertions(+), 31 deletions(-)
builtin/checkout.c +1 -1
@@ -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"
po/bg.po +2 -2
@@ -3883,7 +3883,7 @@ msgid "" "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"
@@ -3892,7 +3892,7 @@ msgstr "" "Ако искате да изтеглите клона от конкретно хранилище, напр. „origin“,\n" "изрично го укажете към опцията „--track“:\n" "\n" -" git checkout --track origin/ИМЕ_НА_КЛОН\n" +" git switch --track origin/ИМЕ_НА_КЛОН\n" "\n" "Ако искате винаги да се предпочита конкретно хранилище при нееднозначно\n" "ИМЕ_НА_КЛОН, напр. „origin“, задайте следната настройка в конфигурационния\n"
po/ca.po +2 -2
@@ -3679,7 +3679,7 @@ msgid "" "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"
@@ -3688,7 +3688,7 @@ msgstr "" "Si voleu agafar una branca de seguiment remota, p. ex. «origin», podeu\n" "fer-ho especificant el nom complet amb l'opció --track:\n" "\n" -" git checkout --track origin/<nom>\n" +" git switch --track origin/<nom>\n" "\n" "Si voleu que en agafar un branca amb un <nom> ambigu s'usi una branca\n" "remota, p. ex. «origin» al remot, considereu configurar l'opció\n"
po/de.po +2 -2
@@ -3676,7 +3676,7 @@ msgid "" "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"
@@ -3687,7 +3687,7 @@ msgstr "" "können Sie das tun, indem Sie den vollständig qualifizierten Namen mit der\n" "--track Option angeben:\n" "\n" -" git checkout --track origin/<Name>\n" +" git switch --track origin/<Name>\n" "\n" "Falls Sie beim Auschecken mit mehrdeutigen <Namen> immer ein Remote-" "Repository\n"
po/el.po +2 -2
@@ -9448,7 +9448,7 @@ msgid "" "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"
@@ -9464,7 +9464,7 @@ msgstr "" "'origin',\n" "μπορείτε να το κάνετε ορίζοντας ολογράφως το όνομα με την επιλογή --track:\n" "\n" -" git checkout --track origin/<όνομα>\n" +" git switch --track origin/<όνομα>\n" "\n" "Αν θα θέλατε οι εξαγωγές από ένα αμφίσημο <όνομα> να προτιμούν πάντα\n" "έναν απομακρυσμένο εξυπηρετητή, π.χ. το απομακρυσμένο 'origin', σκεφτείτε να "
po/es.po +2 -2
@@ -3612,7 +3612,7 @@ msgid "" "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"
@@ -3621,7 +3621,7 @@ msgstr "" "Si querías hacer un check out a una rama rastreada remota, como 'origin',\n" "puedes hacerlo proporcionando el nombre completo con la opción --track:\n" "\n" -" git checkout --track origin/<nombre>\n" +" git switch --track origin/<nombre>\n" "\n" "Si quisieras que siempre los checkouts de nombres ambiguos prefieran\n" "un remoto particular, como 'origin', considera configurar\n"
po/fr.po +2 -2
@@ -3712,7 +3712,7 @@ msgid "" "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"
@@ -3721,7 +3721,7 @@ msgstr "" "Si vous souhaitiez extraire une branche de suivi distant sur 'origin',\n" "par exemple, qualifiez-la complètement avec l'option --track :\n" "\n" -" git checkout --track origin/<nom>\n" +" git switch --track origin/<nom>\n" "\n" "Si vous souhaitez privilégier un distant particulier lorsque <nom> est\n" "ambigu, vous pouvez positionner checkout.defaultRemote=origin dans\n"
po/id.po +2 -2
@@ -4422,7 +4422,7 @@ msgid "" "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"
@@ -4431,7 +4431,7 @@ msgstr "" "Jika maksud Anda check out cabang pelacak remote, seperti 'origin',\n" "Anda bisa lakukan dengan kualifikasi penuh nama dengan opsi --track:\n" "\n" -" git checkout --track origin/<nama>\n" +" git switch --track origin/<nama>\n" "\n" "Jika Anda ingin checkout <nama> ambigu selalu memilih satu remote,\n" "seperti remote 'origin', pertimbangkan untuk menyetel\n"
po/it.po +2 -2
@@ -12097,7 +12097,7 @@ msgid "" "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"
@@ -12107,7 +12107,7 @@ msgstr "" "puoi farlo usando la versione completamente qualificata del nome\n" "con l'opzione --track:\n" "\n" -" git checkout --track origin/<nome>\n" +" git switch --track origin/<nome>\n" "\n" "Se preferisci che i checkout di un <nome> ambiguo siano sempre risolti\n" "rispetto a un particolare remoto, ad es. 'origin', potresti voler\n"
po/pl.po +2 -2
@@ -12668,7 +12668,7 @@ msgid "" "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"
@@ -12677,7 +12677,7 @@ msgstr "" "Jeśli chodziło o wybranie gałęzi śledzącej, np. na „origin”,\n" "możesz to zrobić podając pełną nazwę z opcją --track:\n" "\n" -" git checkout --track origin/<nazwa>\n" +" git switch --track origin/<nazwa>\n" "\n" "Jeśli chcesz, żeby wybrania wszystkich niejednoznacznych\n" "<nazw> preferowały jedno zdalne repozytorium, rozważ ustawienie\n"
po/pt_PT.po +1 -1
@@ -12919,7 +12919,7 @@ msgid "" "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"
po/ru.po +1 -1
@@ -3570,7 +3570,7 @@ msgid "" "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"
po/sv.po +2 -2
@@ -3572,7 +3572,7 @@ msgid "" "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"
@@ -3581,7 +3581,7 @@ msgstr "" "Om du menade checka ut en spårad fjärrgren på t.ex \"origin\", kan du\n" "göra det genom att ange hela namnet med flaggan --track:\n" "\n" -" git checkout --track origin/<namn>\n" +" git switch --track origin/<namn>\n" "\n" "Om du alltid vill att utcheckningar med tvetydiga <namn> ska\n" "föredra en fjärr, t.ex fjärren \"origin\" kan du ställa in\n"
po/tr.po +2 -2
@@ -3645,7 +3645,7 @@ msgid "" "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"
@@ -3654,7 +3654,7 @@ msgstr "" "Eğer bir uzak izleme dalını çıkış yapmak istediyseniz örn. 'origin',\n" "bunu adı --track seçeneği ile tam olarak nitelendirip yapabilirsiniz.\n" "\n" -"\tgit checkout --track origin/<ad>\n" +"\tgit switch --track origin/<ad>\n" "\n" "Eğer her zaman belirsiz <ad> çıkışlarının bir uzak konumu tercih etmesini\n" "isterseniz, örn. 'origin', yapılandırmanızda checkout.defaultRemote=origin\n"
po/vi.po +2 -2
@@ -3589,7 +3589,7 @@ msgid "" "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"
@@ -3598,7 +3598,7 @@ msgstr "" "Nếu ý bạn là lấy ra nhánh máy chủ được theo dõi, ví dụ “origin”,\n" "bạn có thể làm như vậy bằng cách chỉ định đầy đủ tên với tùy chọn --track:\n" "\n" -" git checkout --track origin/<tên>\n" +" git switch --track origin/<tên>\n" "\n" "Nếu bạn muốn luôn lấy ra từ một <tên> một máy chủ ưa thích\n" "chưa rõ ràng, ví dụ máy chủ “origin”, cân nhắc cài đặt\n"
po/zh_CN.po +2 -2
@@ -4500,7 +4500,7 @@ msgid "" "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"
@@ -4509,7 +4509,7 @@ msgstr "" "如果您想要检出一个远程跟踪分支,例如在 'origin' 上的,您可以使用分支\n" "全名和 --track 选项:\n" "\n" -" git checkout --track origin/<名称>\n" +" git switch --track origin/<名称>\n" "\n" "如果您总是喜欢使用模糊的简短分支名 <名称>,而不喜欢如 'origin' 的远程\n" "名称,可以在配置中设置 checkout.defaultRemote=origin。"
po/zh_TW.po +2 -2
@@ -4362,7 +4362,7 @@ msgid "" "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"
@@ -4371,7 +4371,7 @@ msgstr "" "如果您想要簽出一個遠端追蹤分支,例如 'origin',您可以\n" "使用 --track 選項寫出全名:\n" "\n" -" git checkout --track origin/<name>\n" +" git switch --track origin/<name>\n" "\n" "如果您總是喜歡使用模糊的簡短分支名 <name>,而不喜歡如 'origin' 的遠端\n" "版本庫名,可以在設定中設定 checkout.defaultRemote=origin。"
base-commit: 9bf691b78cf906751e65d65ba0c6ffdcd9a5a12c
Signature · 1 line
gitgitgadget
Quoted 6 lines · Max Coplan via GitGitGadget
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?= <[email protected]>Small change. Since
switchis suggested for changing branches overcheckout, this commit updates an error message to useswitchas the default
OK.
Quoted 1 line
Signed-off-by Max 👨🏽💻 Coplan <[email protected]>
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.
Quoted 18 lines
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.
builtin/checkout.c static const char *parse_remote_branch(const char *arg, · line 1228
Quoted 13 lines
builtin/checkout.c +1
-1@@ -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