...
Fork the Apache Geode mirror project on GitHub - https://github.com/apache/geode
Clone the apache repository locally so you can start working:
Code Block git clone https://git-wip-us.apache.org/repos/asf/geode.gitgithub.com/apache/geode
After cloning add your fork as an additional remote so you can push code to your fork. Substitute your GitHub username for 'markito' in this example, or use the GitHub 'HTTPS Clone URL':
Code Block cd geode git remote add myfork https://github.com/markito/geode
Your git remote should look like the following:
Code Block git remote -v origin https://git-wip-us.apache.org/repos/asf/geode.gitgithub.com/apache/geode (fetch) origin https://git-wip-us.apache.org/repos/asf/geode.gitgithub.com/apache/geode (push) myfork https://github.com/markito/geode (fetch) myfork https://github.com/markito/geode (push)
Create a local develop branch (develop is where all new development work goes).
Code Block git checkout develop
Then create your feature branch with the number of the JIRA task that describes your work (fix/feature). The convention is to use feature/GEODE-XXX.
Code Block git checkout develop git pull git checkout -b feature/GEODE-41
Geode follows git flow conventions. If you want, you can install the command line tool git flow to help you follow those conventions.Complete your work (commits) and in order to update the ticket with your progress
Code Block git commit -a
Follow the guidelines for good commit messages. Here's an example:No Format GEODE-526: Fix oplog unit test race condition KRF files are created asynchronously. The test needs to wait for the files to be created before checking header content.
If you've modified source code, 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 -u myfork feature/GEODE-41
- Open GitHub web interface 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 requires some additional work, go back to the commit step.
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/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/geode.git
- as a committer you can just merge the PR using the Merge button at the bottom of the pull request. Click the arrow next to the merge button and select the appropriate merge choice (Usually squash and merge to create a single commit on develop).
- If there are conflicts, our you would rather you can merge a PR from the command line
Add GitHub remote
(for local review) Fetch the pull request into a feature branch for review (Here's a neat trick to make this easier: https://gist.github.com/gnarf/5406589)
Code Block git fetch githuborigin 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 -rF GEODE-41 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 checkout develop git merge feature/GEODE-41 (was 1f2e32a). Summary of actions: - The feature branch 'feature/GEODE-41' was merged into 'develop' - Feature branch ' git branch -d feature/GEODE-41' has been removed - You are now on branch 'develop'
Review the changes and rebase if necessary to clean up and modify the history. If there are multiple commits, you may want to squash them together. Remember to add 'This closes #6' to the last commit message so that github will automatically close the PR. If the PR is comprised of just one commit, you can omit the rebase and simply add 'This closes #6' by using '
commit --amend
'.Code Block git log git rebase -i --> Append line "This closes #6" where #6 is the pull request id.
- Finally, push the commit to the origin repository.
...