devguide icon indicating copy to clipboard operation
devguide copied to clipboard

Add git config alias for devguide

Open eamanu opened this issue 6 years ago • 6 comments

Hello everyboy!

I am not sure if here is the appropriate place to this issue. Sorry if not.

On gitbootcamp.rst there is a recommendation to made easy the creation of a branch for PR to test it. I am talking about this:

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

What about if is added something similar for maintain updated the CPython repo. I am thinking about something have (like result)

$ git update

To avoid:

$ git checkout master
$ git pull origin master
$ git pull upstream master
$ git push origin master

What do you think about that?

Thanks!

eamanu avatar Feb 06 '19 16:02 eamanu

GitMate.io thinks possibly related issues are https://github.com/python/devguide/issues/61 (devguide-git bot), https://github.com/python/devguide/issues/8 (Add Quick Start: Communications section to devguide), https://github.com/python/devguide/issues/9 (Add tips for effective online communication to devguide), https://github.com/python/devguide/issues/217 (Quoting for config alias.pr), and https://github.com/python/devguide/issues/7 (Add a Sprints organization/preparation section to devguide).

Mariatta avatar Feb 06 '19 16:02 Mariatta

Hello @eamanu and @Mariatta i would like to work on this issue

dorothykiz1 avatar Feb 20 '19 06:02 dorothykiz1

Do you need to update your local master copy? If the master is tracked against upstream and git checkout master && git pull fetches upstream -- there is no need to keep your local (origin) master up to date. Actually, you can even remove the branch -- everything still works fine.

asvetlov avatar Feb 20 '19 07:02 asvetlov

Hi @asvetlov,

Thanks for you response

Do you need to update your local master copy?

hmmm I think yes. Because this way you can create a branch from master to make the PR. If you have an old master branch maybe when you made the PR this can have some conflicts. This is for local (your computer) copy.

Maybe could not be necessary have and updated copy on my own cpython fork (master branch) on Gihub, but if you follow the devguide, this mentions on https://devguide.python.org/gitbootcamp/#syncing-with-upstream the push to origin master.

eamanu avatar Feb 21 '19 00:02 eamanu

For that reason I create the alias.

eamanu avatar Feb 21 '19 00:02 eamanu

I use these ones:

pr = !sh -c \"git fetch upstream pull/${1}/head:pr_${1} && git checkout pr_${1}\" -
wpr = !bash -c \"git fetch upstream pull/${1}/head:pr_${1} && git worktree add ../$(basename $(git rev-parse --show-toplevel))-pr-${1} pr_${1}\" -

matrixise avatar Feb 21 '19 15:02 matrixise

Closing, this was added and generalised in PR https://github.com/python/devguide/pull/459.

hugovk avatar Dec 23 '22 09:12 hugovk