...
Fork the Apache Geode mirror project on githubGitHub
Code Block [img]
Clone your fork locally so you can actually start working.
Code Block git clone https://github.com/markito/incubator-geode
After cloning add an upstream remote so your fork can actually reference the original Apache Geode repository.
Code Block git remote add upstream https://github.com/apache/incubator-geode
Your git remote should look like the following:
Code Block git remote -v origin https://github.com/markito/incubator-geode (fetch) origin https://github.com/markito/incubator-geode (push) upstream github.com/apache/incubator-geode (fetch) upstream github.com/apache/incubator-geode (push)
Fetch remote branches and checkout develop
Code Block git fetch upstream # update your local branch git checkout develop
Geode follows git-flow conventions so if you do have git-flow installed in your system just do:
Code Block git flow init
Then create your feature branch with the number of the JIRA task that describes your work (fix/feature).
Code Block git flow feature start GEODE-41 Switched to a new branch 'feature/GEODE-41' Summary of actions: - A new branch 'feature/GEODE-41' was created, based on 'develop' - You are now on branch 'feature/GEODE-41' Now, start committing on your feature. When done, use: git flow feature finish GEODE-41
Complete your work (commits) and in order to update the ticket with your progress use the following syntax in your commit messages:
Code Block git commit -a -m "[GEODE-41] #comment My new cool feature XYZ"
Execute the precheckin gradle task in order to perform tests related to the components affected by your change. All tests must pass. When in doubt ask on @dev list.
Code Block ./gradlew precheckin
- When work is complete, consider whether documentation to be updated or created due to the new feature.
If/When needed to push your local work to GitHub use the following command:
Code Block git push --set-upstream origin feature/GEODE-41
- Open GitHub web inteface and you should see your just pushed branch with a 'Compare & pull request' button
This will lead to Open a pull request page with detailed information on which fork and branch you going from/to. You should add some descriptive information if needed and finally click on Create pull request
- The review process starts and once approved your PR will be merged into develop. if it's not approved or require some additional work, go back to the commit step.
Now you can go ahead and finish your feature
Code Block git flow feature finish GEODE-41
Accepting the Pull-request
As a reviewer/committer do the review using GitHub or if needed request a ReviewBoard submission.
Once the PR is approved since the GitHub repository is a ready-only mirror you actually need to download the patch and apply. The JIRA ticket must have the link to the patch in the comments section, something like: https://github.com/apache/incubator-geode/pull/6.patch
Alternatively add GitHub as a remote to the ASF clone and just fetch pull requests. For example:
Clone the ASF git repository (if you haven't done yet)
Code Block git clone https://git-wip-us.apache.org/repos/asf/incubator-geode.git
Add GitHub remote
Code Block git remote add github https://github.com/apache/incubator-geode
(for local review) Fetch the pull request into a feature branch for review
Code Block git fetch github pull/6/head:feature/GEODE-41 git checkout feature/GEODE-41 Where: 6 -> PR number feature/GEODE-41 -> local destination branch
(for local review) After review is complete you can merge the feature into develop and remove the branch
Code Block git flow feature finish GEODE-41 -F Switched to branch 'develop' Your branch is up-to-date with 'origin/develop'. Updating f7af251..1f2e32a Fast-forward COMPILING.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) Deleted branch feature/GEODE-41 (was 1f2e32a). Summary of actions: - The feature branch 'feature/GEODE-41' was merged into 'develop' - Feature branch 'feature/GEODE-41' has been removed - You are now on branch 'develop'
(if review was done through GitHub) Pull and squash the pull request
Code Block git pull --squash github pull/6/head:feature/GEODE-41
- Update the RELEASE notes file properly including the JIRA ticket number and the brief description about the feature/issue.
Execute a commit amend in order close the PR (For example, append: "close #6")Commit the merge:
Code Block git commit -a -m "[GEODE-41] (contributor-id via committer-asf-id) closes #6" Where: 6 -> PR number GEODE-41 -> JIRA number contributor-id -> GitHub user handle commiter-asf-id -> Committer ID accepting the PR -amend
Finally push the commit the origin repositoryFinally push the repository.
Code Block git push -f origin
Given the commit message with the PR number after the push the PR on GitHub will be closed and the JIRA ticket updated.
When using git log command you will see that Author: and Committer: fields are properly updated and credit is given to the contributor. For example:Code Block commit c562d3439577c0bf12cc0e39157761a8dd69da1f Author: Dan Smith <dsmith@pivotal.io> Commit: William Markito <wmarkito@pivotal.io>
Rejecting PRs without committing
If reviewers or committers needs to close a PR if for instance, after proper evaluation it's something that won't get fixed it can be done through an empty commit message
Code Block git commit --allow-empty -m "Closes #6 *Won't fix*" git push github develop