-
Notifications
You must be signed in to change notification settings - Fork 69
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
[all] Pull Request methodology #779
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @Roman-Manevich!
This is a very good starting point. This is very similar to the flow I would use but before we recommend that everyone adopts a flow that allows a linear history we need a wider consensus.
Hi all, thanks for this initiative. I'd like to be clear about what history we have in the end: A linear history, with PR being merged one after the other, with explicit merge messages, without any overlap. This can be checked as
We also want the tests ( Hence, once the PR is ready, that is, once merge has been agreed, the PR authors can proceed as follows, from their branch (if I am not wrong):
It is to be noticed that the merger can do the same, but this means pushing to the author's clone and slightly alters authorship. Finally, the merger has to fill the merge message, it is often convenient to copy the initial message of the conversation, which usually describes the effect and purpose of the PR. |
Thanks for this @maranget. I agree with everything just some questions/comments.
I think there is still value in keeping multiple commits in a PR if:
On the other hand, sometime this is not information worth keeping. If the commit history in the PR is not clean, with fixes on top of each, I would argue that these sequence of changes is not worth keeping in the project's history, they only add noise and squashing is the right strategy.
I agree it's not ideal, but when I squash commits together, I retain the Author information. git automatically changes the Commit field.
That's a very good point. I will start doing it. |
Edited README.md to add an greed upon methodology for creating and publishing a pull request with git and github.
b46b20e
to
45a780d
Compare
45a780d
to
7d365dd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM -- this is more or less what I do too.
I added two nitpick-y comments, to check if I understood the flow correctly than anything else.
responsibly. | ||
Therefore, our recommendation to all contributors is to follow the following | ||
procedure: | ||
1. Create a [fork](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Step 6 as I understand it assumes that the remote pf the fork is called "origin" and does not rely on there being a name for the fork. Step 7 as I understand it assumes that "upstream" is indeed 'herd/herdtools7" on Github.
So, maybe this could be something like "Create a fork and clone it. Add a remote for the original repository, call it upstream"?
`make test`. | ||
6. Assuming `origin` is your clone of `herdtools7`, push with | ||
`git push --set-upstream origin feature` | ||
7. Rebase often, repeating 2--6 as much as needed: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strictly speaking not necessary for the sequence of steps here, but I wonder if it is useful to keep origin's master branch up to date with upstream's master branch. Presumably, step 2 is good to do branching off up-to-date master.
I usually press a button on the web interface for this ("Sync fork" on the forked page).
Therefore, our recommendation to all contributors is to follow the following | ||
procedure: | ||
1. Create a [fork](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo) | ||
of `herdtools7` named, for example, `upstream` and set `herdtools7` as your remote. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To make this more clear I think you can break it down into further steps
2. Clone your fork of herdtools7: git clone [email protected]:${GITHUB_USERNAME}/herdtools7
1 and 2 are steps need only the first time.
The one option would be to add herd/herdtools7 as a remote:
4. From the folder in which the repository is cloned add herd/herdtools7 as a remote: git remote add upstream https://github.com/herd/herdtools7.git
5. Fetch the latest refs form herd/herdtools7 git fetch upstream
Otherwise and as Artem suggested:
4. Sync your fork with the upstream repository using github's "Sync fork" (not sure of the details of this, I've never used it)
5. Fetch the latest refs of your remote repository with git fetch
procedure: | ||
1. Create a [fork](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo) | ||
of `herdtools7` named, for example, `upstream` and set `herdtools7` as your remote. | ||
2. Create a git branch: `git checkout -b feature` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2. Create a git branch: `git checkout -b feature` | |
2. Create a git branch: `git checkout upstream/master -b <feature_name>` |
or if you follow Artem's approach
git checkout origin/master -b <feature_name>
Also, `[all]` applies to changes that effect several components. | ||
5. Test the feature and make sure all relevant tests pass, including | ||
`make test`. | ||
6. Assuming `origin` is your clone of `herdtools7`, push with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As Artem said this is the default behaviour, if you want you can add a comment to this extend when you instruct users to add the upstream remote, but here this is unnecessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Roman-Manevich, thank you for writing this.
I agree with the comments that most of those steps need more explanation.
I would like to add that external references can (and probably should) be used to provide more detailed and up-to-date explanations. For example, the steps on rebasing are confusing, and we could point to an external tutorial, for example git-scm.
A fear I have is that such a text would deter occasional contributors. For example, while rebasing is good for people that do 5 PR a week (me? 🙄), it might not be the easiest if you don't have a good knowledge of the code base and you only occasionally work on it, in which case a merge commit is probably fine.
I'm hoping that we can agree on a methodology for using git/github to publish new features. Here is my attempt.