Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

po: use switch over checkout in error message #1308

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vegerot
Copy link

@vegerot vegerot commented Aug 17, 2022

Small change. Since switch is suggested for changing branches over
checkout, this commit updates an error message to use switch as the
default

Thanks for taking the time to contribute to Git! Please be advised that the
Git community does not use github.com for their contributions. Instead, we use
a mailing list (git@vger.kernel.org) for code submissions, code reviews, and
bug reports. Nevertheless, you can use GitGitGadget (https://gitgitgadget.github.io/)
to conveniently send your Pull Requests commits to our mailing list.

Please read the "guidelines for contributing" linked above!

cc: Taylor Blau me@ttaylorr.com

@gitgitgadget-git
Copy link

Welcome to GitGitGadget

Hi @vegerot, and welcome to GitGitGadget, the GitHub App to send patch series to the Git mailing list from GitHub Pull Requests.

Please make sure that your Pull Request has a good description, as it will be used as cover letter. You can CC potential reviewers by adding a footer to the PR description with the following syntax:

CC: Revi Ewer <revi.ewer@example.com>, Ill Takalook <ill.takalook@example.net>

Also, it is a good idea to review the commit messages one last time, as the Git project expects them in a quite specific form:

  • the lines should not exceed 76 columns,
  • the first line should be like a header and typically start with a prefix like "tests:" or "revisions:" to state which subsystem the change is about, and
  • the commit messages' body should be describing the "why?" of the change.
  • Finally, the commit messages should end in a Signed-off-by: line matching the commits' author.

It is in general a good idea to await the automated test ("Checks") in this Pull Request before contributing the patches, e.g. to avoid trivial issues such as unportable code.

Contributing the patches

Before you can contribute the patches, your GitHub username needs to be added to the list of permitted users. Any already-permitted user can do that, by adding a comment to your PR of the form /allow. A good way to find other contributors is to locate recent pull requests where someone has been /allowed:

Both the person who commented /allow and the PR author are able to /allow you.

An alternative is the channel #git-devel on the Libera Chat IRC network:

<newcontributor> I've just created my first PR, could someone please /allow me? https://github.com/gitgitgadget/git/pull/12345
<veteran> newcontributor: it is done
<newcontributor> thanks!

Once on the list of permitted usernames, you can contribute the patches to the Git mailing list by adding a PR comment /submit.

If you want to see what email(s) would be sent for a /submit request, add a PR comment /preview to have the email(s) sent to you. You must have a public GitHub email address for this. Note that any reviewers CC'd via the list in the PR description will not actually be sent emails.

After you submit, GitGitGadget will respond with another comment that contains the link to the cover letter mail in the Git mailing list archive. Please make sure to monitor the discussion in that thread and to address comments and suggestions (while the comments and suggestions will be mirrored into the PR by GitGitGadget, you will still want to reply via mail).

If you do not want to subscribe to the Git mailing list just to be able to respond to a mail, you can download the mbox from the Git mailing list archive (click the (raw) link), then import it into your mail program. If you use GMail, you can do this via:

curl -g --user "<EMailAddress>:<Password>" \
    --url "imaps://imap.gmail.com/INBOX" -T /path/to/raw.txt

To iterate on your change, i.e. send a revised patch or patch series, you will first want to (force-)push to the same branch. You probably also want to modify your Pull Request description (or title). It is a good idea to summarize the revision by adding something like this to the cover letter (read: by editing the first comment on the PR, i.e. the PR description):

Changes since v1:
- Fixed a typo in the commit message (found by ...)
- Added a code comment to ... as suggested by ...
...

To send a new iteration, just add another PR comment with the contents: /submit.

Need help?

New contributors who want advice are encouraged to join git-mentoring@googlegroups.com, where volunteers who regularly contribute to Git are willing to answer newbie questions, give advice, or otherwise provide mentoring to interested contributors. You must join in order to post or view messages, but anyone can join.

You may also be able to find help in real time in the developer IRC channel, #git-devel on Libera Chat. Remember that IRC does not support offline messaging, so if you send someone a private message and log out, they cannot respond to you. The scrollback of #git-devel is archived, though.

@gitgitgadget-git
Copy link

There are issues in commit 87ef2b7:
po: use switchovercheckout in error message
Commit not signed off

@dscho
Copy link
Member

dscho commented Aug 18, 2022

/allow

@gitgitgadget-git
Copy link

User vegerot is now allowed to use GitGitGadget.

@vegerot
Copy link
Author

vegerot commented Nov 4, 2022

@dscho what're the next steps?

@dscho
Copy link
Member

dscho commented Nov 5, 2022

I hope that these instructions are clear enough: #1308 (comment)

@dscho
Copy link
Member

dscho commented Nov 8, 2022

I hope that these instructions are clear enough: #1308 (comment)

@vegerot ⬆️

Small change.  Since `switch` is suggested for changing branches over
`checkout`, this commit updates an error message to use `switch` as the
default

Signed-off-by: Max 👨🏽‍💻 Coplan <mchcopl@gmail.com>
@vegerot
Copy link
Author

vegerot commented Nov 8, 2022

I hope that these instructions are clear enough: #1308 (comment)

@vegerot ⬆️

@dscho thank you 🙂. How is this?

@dscho
Copy link
Member

dscho commented Nov 9, 2022

@vegerot I think it's ready for /submiting

@vegerot
Copy link
Author

vegerot commented Nov 9, 2022

/submit

@gitgitgadget-git
Copy link

Submitted as pull.1308.git.git.1668018620148.gitgitgadget@gmail.com

To fetch this version into FETCH_HEAD:

git fetch https://github.com/gitgitgadget/git/ pr-git-1308/vegerot/update-error-message-v1

To fetch this version to local tag pr-git-1308/vegerot/update-error-message-v1:

git fetch --no-tags https://github.com/gitgitgadget/git/ tag pr-git-1308/vegerot/update-error-message-v1

@vegerot
Copy link
Author

vegerot commented Nov 9, 2022

@vegerot I think it's ready for /submiting

thank you! 😊

@gitgitgadget-git
Copy link

On the Git mailing list, Taylor Blau wrote (reply to this):

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

@gitgitgadget-git
Copy link

User Taylor Blau <me@ttaylorr.com> has been added to the cc: list.

@gitgitgadget-git
Copy link

This branch is now known as mc/switch-advice.

@gitgitgadget-git
Copy link

This patch series was integrated into seen via 857e490.

@gitgitgadget-git
Copy link

This patch series was integrated into seen via eaf95f8.

@gitgitgadget-git
Copy link

This patch series was integrated into seen via 2372ff5.

@gitgitgadget-git
Copy link

This patch series was integrated into seen via f273994.

@gitgitgadget-git
Copy link

This patch series was integrated into seen via 9e7f799.

@gitgitgadget-git
Copy link

This patch series was integrated into seen via 111ea47.

@gitgitgadget-git
Copy link

This patch series was integrated into seen via a8d2876.

@gitgitgadget-git
Copy link

This patch series was integrated into seen via 8043dbd.

@gitgitgadget-git
Copy link

This patch series was integrated into seen via 007178a.

@gitgitgadget-git
Copy link

This patch series was integrated into seen via 5c59dca.

@gitgitgadget-git
Copy link

This patch series was integrated into seen via ba5bd4f.

@gitgitgadget-git
Copy link

This patch series was integrated into seen via ed2e09a.

@gitgitgadget-git
Copy link

This patch series was integrated into seen via 5b3d292.

@gitgitgadget-git
Copy link

This patch series was integrated into seen via db568ba.

@gitgitgadget-git
Copy link

This patch series was integrated into seen via 5451434.

@gitgitgadget-git
Copy link

This patch series was integrated into seen via b0a3ad3.

@gitgitgadget-git
Copy link

There was a status update in the "Stalled" section about the branch mc/switch-advice on the Git mailing list:

Use 'switch' instead of 'checkout' in an error message.

Waiting for review response.
source: <pull.1308.git.git.1668018620148.gitgitgadget@gmail.com>

@gitgitgadget-git
Copy link

This patch series was integrated into seen via 072f1d1.

@gitgitgadget-git
Copy link

This patch series was integrated into seen via 6ae8cfd.

@gitgitgadget-git
Copy link

This patch series was integrated into seen via 3876b65.

@gitgitgadget-git
Copy link

There was a status update in the "Stalled" section about the branch mc/switch-advice on the Git mailing list:

Use 'switch' instead of 'checkout' in an error message.

Waiting for review response.
source: <pull.1308.git.git.1668018620148.gitgitgadget@gmail.com>

@gitgitgadget-git
Copy link

There was a status update in the "Stalled" section about the branch mc/switch-advice on the Git mailing list:

Use 'switch' instead of 'checkout' in an error message.

Waiting for review response.
source: <pull.1308.git.git.1668018620148.gitgitgadget@gmail.com>

@gitgitgadget-git
Copy link

There was a status update in the "Stalled" section about the branch mc/switch-advice on the Git mailing list:

Use 'switch' instead of 'checkout' in an error message.

Waiting for review response.
source: <pull.1308.git.git.1668018620148.gitgitgadget@gmail.com>

@gitgitgadget-git
Copy link

This patch series was integrated into seen via 12f442a.

@gitgitgadget-git
Copy link

This patch series was integrated into seen via c063d1e.

@gitgitgadget-git
Copy link

This patch series was integrated into seen via d75102b.

@gitgitgadget-git
Copy link

This patch series was integrated into seen via af2f64d.

@gitgitgadget-git
Copy link

There was a status update in the "Stalled" section about the branch mc/switch-advice on the Git mailing list:

Use 'switch' instead of 'checkout' in an error message.

Waiting for review response.
source: <pull.1308.git.git.1668018620148.gitgitgadget@gmail.com>

@gitgitgadget-git
Copy link

This patch series was integrated into seen via b917d68.

@gitgitgadget-git
Copy link

This patch series was integrated into seen via 9284556.

@gitgitgadget-git
Copy link

This patch series was integrated into seen via f8a1223.

@gitgitgadget-git
Copy link

This patch series was integrated into seen via ec1bcd2.

@gitgitgadget-git
Copy link

This patch series was integrated into seen via 8e4d522.

@gitgitgadget-git
Copy link

This patch series was integrated into seen via 5615462.

@gitgitgadget-git
Copy link

There was a status update in the "Discarded" section about the branch mc/switch-advice on the Git mailing list:

Use 'switch' instead of 'checkout' in an error message.

Will discard.
Getting tired of waiting for review response.

@gitgitgadget-git
Copy link

There was a status update in the "Discarded" section about the branch mc/switch-advice on the Git mailing list:

Use 'switch' instead of 'checkout' in an error message.

Will discard.
Getting tired of waiting for review response.

@gitgitgadget-git
Copy link

There was a status update in the "Discarded" section about the branch mc/switch-advice on the Git mailing list:

Use 'switch' instead of 'checkout' in an error message.

Will discard.
Getting tired of waiting for review response.

@gitgitgadget-git
Copy link

There was a status update in the "Discarded" section about the branch mc/switch-advice on the Git mailing list:

Use 'switch' instead of 'checkout' in an error message.

Will discard.
Getting tired of waiting for review response.

@gitgitgadget-git
Copy link

There was a status update in the "Discarded" section about the branch mc/switch-advice on the Git mailing list:

Use 'switch' instead of 'checkout' in an error message.

Will discard.
Getting tired of waiting for review response.

@gitgitgadget-git
Copy link

There was a status update in the "Discarded" section about the branch mc/switch-advice on the Git mailing list:

Use 'switch' instead of 'checkout' in an error message.

Will discard.
Getting tired of waiting for review response.

@gitgitgadget-git
Copy link

There was a status update in the "Discarded" section about the branch mc/switch-advice on the Git mailing list:

Use 'switch' instead of 'checkout' in an error message.

Will discard.
Getting tired of waiting for review response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants