...
Code Block |
---|
git clone https://git-wip-us.apache.org/repos/asf/kafka.git kafka
|
This sets up the remote alias "origin" automatically which refers back to the Apache repo.
2. Create a new github repository on your github account to use for stashing changes. There are various ways to do this, I just forked the apache/kafka repo (https://github.com/apache/kafka) which creates a repo https://github.com/jkreps/kafka (where jkreps would be your user name).
3. Add an alias on your local repository to github to avoid typing:
Code Block |
---|
git remotesremote add github https://github.com/<your_user>/kafka.git |
...
Review and pushing changes back to Apache works just as before.
Merging GitHub Pull Requests
This section documents the process for reviewing and merging code changes contributed via Github Pull Requests. It assumes you have a clone of Kafka's Git repository.
kafka-merge-pr.py
is a script that automates the process of accepting a code change into the project. It creates a temporary branch from apache/trunk
, squashes the commits in the pull request, rewrites the commit message in the squashed commit to follow a standard format including information about each original commit, merges the squashed commit into the temporary branch, pushes the code to apache/trunk
and closes the JIRA ticket. The push will then be mirrored to apache-github/trunk
, which will cause the PR to be closed due to the pattern in the commit message. Note that the script will ask the user before executing remote updates (ie git push and closing JIRA ticket), so it can still be used even if the user wants to skip those steps.
Setting Up
1. Add aliases for the remotes expected by the merge script (if you haven't already):
Code Block |
---|
git remote add apache https://git-wip-us.apache.org/repos/asf/kafka.git
git remote add apache-github https://github.com/apache/kafka.git |
2. Install jira-python as described above.
Merging
Once the pull request is ready to be merged (it has been reviewed, feedback has been addressed, CI build has been successful and the branch merges cleanly into trunk):
1. Set the JIRA_USERNAME
and JIRA_PASSWORD
environment variables with the appropriate credentials if you intend to ask the script to close the issue associated with the pull request.
2. Run the merge script:
Code Block |
---|
python kafka-merge-pr.py |
3. Answer the questions prompted by the script.
How to get your patches reviewed
...