Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Update bootcamp FAQ about "Checking out others' PRs"#1694

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
ezio-melotti wants to merge4 commits intopython:main
base:main
Choose a base branch
Loading
fromezio-melotti:update-alias

Conversation

@ezio-melotti
Copy link
Member

@ezio-melottiezio-melotti commentedNov 18, 2025
edited
Loading

I wanted to pull a PR branch and I was looking up"Checking out others' PRs", and the options were either to installgh,hub, or creating a Git alias.

Since I wanted a less permanent solution, I created this PR to show the commands individually before suggesting adding them as an alias. In addition I replacedcheckout with the more modernswitch, and capitalized "Git".

Another possible solution is to add the contributor's repo as a remote and fetch their branch from there, but I didn't want to add yet another solution. If people want to add it, we can create another PR.


📚 Documentation preview 📚:https://cpython-devguide--1694.org.readthedocs.build/

Copy link
Member

@hugovkhugovk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

And replace the other twogit checkout on this page withgit switch?

And also ongetting-started/pull-request-lifecycle.rst andindex.rst?

..code-block::shell
$ git config --global alias.pr'!sh -c "git fetch upstream pull/${1}/head:pr_${1} && gitcheckout pr_${1}" -'
$ git config --global alias.pr'!sh -c "git fetch upstream pull/${1}/head:pr_${1} && gitswitch pr_${1}" -'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Suggested change
$git config --global alias.pr '!sh -c "git fetch upstream pull/${1}/head:pr_${1} && git switch pr_${1}" -'
git config --global alias.pr '!sh -c "git fetch upstream pull/${1}/head:pr_${1} && git switch pr_${1}" -'

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Most command in the page have the$, even though I don't remember if there was a specific reason/convention, so I didn't remove it. We could remove most/all of them in a separate PR.

https://devguide.python.org/documentation/style-guide/#code-examples says to use prompts sparingly to differentiate input/output lines, even though it's talking mainly about Python>>>/.... We could remove most/all of them in a separate PR.

Also note that theshell highlight is for shell scripts, whereas theconsole highlight for shell sessions with prompts (seehttps://pygments.org/docs/lexers/#lexers-for-various-shells).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Yeah,console is useful when you have a prompt and output to show. Otherwiseshell for plain commands.

Console:

$ls| wc -l# good formatting for command + output 👍     158
ls | wc -l  # bad formatting for command 👎

Shell:

$ ls| wc -l# bad formatting for output 👎     158
ls| wc -l# good formatting for command 👍

ezio-melotti reacted with thumbs up emoji
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
..code-block::shell
$ git config --global alias.pr'!sh -c "git fetch upstream pull/${1}/head:pr_${1} && gitcheckout pr_${1}" -'
$ git config --global alias.pr'!sh -c "git fetch upstream pull/${1}/head:pr_${1} && gitswitch pr_${1}" -'
Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Most command in the page have the$, even though I don't remember if there was a specific reason/convention, so I didn't remove it. We could remove most/all of them in a separate PR.

https://devguide.python.org/documentation/style-guide/#code-examples says to use prompts sparingly to differentiate input/output lines, even though it's talking mainly about Python>>>/.... We could remove most/all of them in a separate PR.

Also note that theshell highlight is for shell scripts, whereas theconsole highlight for shell sessions with prompts (seehttps://pygments.org/docs/lexers/#lexers-for-various-shells).

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@hugovkhugovkhugovk approved these changes

Assignees

@ezio-melottiezio-melotti

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@ezio-melotti@hugovk

[8]ページ先頭

©2009-2025 Movatter.jp