DOC better clarify upstream synchronization in contributing guide#13505
DOC better clarify upstream synchronization in contributing guide#13505adrinjalali merged 7 commits intoscikit-learn:masterfrom
Conversation
doc/developers/contributing.rst
Outdated
| $ git merge upstream/master | ||
|
|
||
| with ``master`` being synchronized with the ``upstream``. | ||
| In order to synchronize your ``master`` with the ``upstream``'s (assuming you |
There was a problem hiding this comment.
I don't understand this. I don't understand the benefit of teaching rebase either.
There was a problem hiding this comment.
Maybe git pull upstream master would be enough?
I'd remove the "(assuming you usually work on branches other than your local's master)" part, since we shouldn't give users the idea that it could be done another way.
There was a problem hiding this comment.
The rebase is just to leave users with a clean master history on their local copy, which I think is good practice and useful later on when users do git log stuff.
The "assuming..." part is kinda to tell users that's how a good practice may look like. Not all users create branches and they may just work on their master. My idea here is to give users an idea of how they can be doing the git-workflow by giving them hints and keywords.
Questions such as #13496 (comment) are not rare among new contributors, and there's a gap between "here's how you add an origin" and "assuming your master is synced with master" in our documentation.
@jnothman I'm not sure which part is not clear here to you. I'm happy to expand and clarify this part, I was trying to keep the additions minimal.
There was a problem hiding this comment.
I see. Then what about something like this
It is recommended to work on temporary branches rather than directly on master. Since these temporary branches are branched off master, it is helpful to keep your local master up to date with the upstream's master. Do do this, you can...
There was a problem hiding this comment.
I like that, change the wording.
NicolasHug
left a comment
There was a problem hiding this comment.
Still not convinced by rebase over pull but I don't mind, LGTM
doc/developers/contributing.rst
Outdated
| ``master``. To do this, you can:: | ||
|
|
||
| $ git fetch upstream | ||
| $ git rebase upstream/master |
There was a problem hiding this comment.
well, I would usually do git reset --hard upstream/master here.
There was a problem hiding this comment.
+1 although it's not necessary to ever use update the local master branch if all the feature branches are branched from upstream/master as recommended in the previous comment.
There was a problem hiding this comment.
well, I would usually do
git reset --hard upstream/masterhere.
reset --hard is fine as long as the user really knows they're not in their feature branch. I rather not have a command here which could be copy pasted by accident and result in the user loosing their changes.
doc/developers/contributing.rst
Outdated
| with ``master`` being synchronized with the ``upstream``. | ||
| It is recommended to work on temporary branches rather than directly on | ||
| ``master``. Since these temporary branches are branched off ``master``, it is | ||
| helpful to keep your local ``master`` up to date with the upstream's |
There was a problem hiding this comment.
Maybe rather than advising this, we should just recommend creating feature branches with:
git fetch upstream
get checkout -b myfeaturename upstream/master
doc/developers/contributing.rst
Outdated
| ``master``. To do this, you can:: | ||
|
|
||
| $ git fetch upstream | ||
| $ git rebase upstream/master |
There was a problem hiding this comment.
+1 although it's not necessary to ever use update the local master branch if all the feature branches are branched from upstream/master as recommended in the previous comment.
|
Is this now a good compromise? No rebase mentioned! (I'm genuinely curious why we don't want to mention it though) |
|
LGTM. |
doc/developers/contributing.rst
Outdated
| $ git merge upstream/master | ||
|
|
||
| with ``master`` being synchronized with the ``upstream``. | ||
| It is recommended to work on temporary branches rather than directly on |
There was a problem hiding this comment.
We're talking about how to solve the conflict when merging master from upstream. I can't understand why we mention these things here. (Notice that the next paragraph starts with "Subsequently")
There was a problem hiding this comment.
Fair point. Should we move it right after where the user clones the fork, and
add the upstream remote etc etc?
There was a problem hiding this comment.
Just saw that @qinhanmin2014's review is similar to mine :)
There was a problem hiding this comment.
We already have
Create a branch to hold your development changes:
$ git checkout -b my-feature
Anyway, this is not a big problem, as long as you can put these things in a suitable place, I won't oppose.
albertcthomas
left a comment
There was a problem hiding this comment.
Thanks @adrinjalali. We will be able to point the contributors to this section if they ask how to do this.
doc/developers/contributing.rst
Outdated
| $ git merge upstream/master | ||
|
|
||
| with ``master`` being synchronized with the ``upstream``. | ||
| It is recommended to work on temporary branches rather than directly on |
There was a problem hiding this comment.
It can be a bit confusing for a first time contributor to read this if he already did point 5. hereabove. We should maybe say : "As explained in 5, it is recommended to work [....]. You can also create your feature branch from the latest upstream/master:"
There was a problem hiding this comment.
And I would put this paragraph after the paragraph about solving conflicts so that the one about solving conflicts is just after the one explaining how to merge master.
|
This should now address the comments. |
doc/developers/contributing.rst
Outdated
| of it you can:: | ||
|
|
||
| $ git fetch upstream | ||
| $ git checkout -b mybranchname upstream/master |
There was a problem hiding this comment.
I would reuse the same name as above for the branch my-feature.
| of it you can:: | ||
|
|
||
| $ git fetch upstream | ||
| $ git checkout -b my-feature upstream/master |
There was a problem hiding this comment.
Maybe it's worth just changing the instructions above rather than adding a note. But I'm fine with this
|
I suppose it's hard to make everybody very happy here, but seems we have enough +1s, so merging. |
…ikit-learn#13505) * clarify upstream synchronization * apply Nicolas's comment * fix typo * don't mention the rebase * move the notes * fix branch name
…uide (scikit-learn#13505)" This reverts commit bb8d093.
…uide (scikit-learn#13505)" This reverts commit bb8d093.
…ikit-learn#13505) * clarify upstream synchronization * apply Nicolas's comment * fix typo * don't mention the rebase * move the notes * fix branch name
Changes the contributing guides to be explicit about how upstream/master synchronization can be done.