Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

If you are merging a patch attached to a JIRA (and not a github PR), here is a suggested workflow.

Github Workflow

Apache doesn't seem to provide a place to stash your work-in-progress branches or provide some of the nice social features github has. This can be a problem for larger features. Here are instructions for using github as a place to stash your work in progress changes.

Setting Up

1. As in the other workflows begin by checking out kafka (if you haven't already):

Code Block
  git clone https://git-wip-us.apache.org/repos/asf/kafka.git

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 remote add github https://github.com/<your_user>/kafka.git

Now you can push either to origin or to github.

Doing Work

1. You can create a branch named xyz in your local repository and check it out

Code Block
  git checkout -b xyz remotes/origin/trunk

2. To set up a second machine to work on you can clone the github url.
3. To save your branch to your github repo do

Code Block
  git push github xyz

4. To pull these changes onto the other machine where you have a copy of the repository you can do:

Code Block
  git fetch github
  git checkout xyz
  git merge remotes/github/xyz

Review and pushing changes back to Apache works just as before.

Merging GitHub Pull Requests

...

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):

...