kafka-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Arthur <mum...@gmail.com>
Subject Re: git workflow
Date Wed, 02 Jan 2013 22:16:43 GMT
Here is what I've been doing

* Clone Kafka locally (git clone git://github.com/apache/kafka.git)
* Create feature branch off of trunk (git branch KAFKA-657)
* Do work on the feature branch
* Rebase from trunk (git rebase trunk). This minimizes or eliminates any 
conflicts when people try to apply your patch.
* Generate a diff like: git diff HEAD~5 > KAFKA-657v7.diff (this 
essentially squashes all my commits into one diff)

To apply a patch and test I would (in theory), create a local branch 
from trunk (e.g., KAFKA-657-integration), apply the patch (git apply 
KAFKA-657v7.diff), and test the patch.

Another approach would be to use the built-in Git patch stuff (git 
format-patch and git am). git format-patch will create a patch file per 
commit, which may or may not be what you want.

Pushing local changes to a fork in GitHub is also pretty simple. You 
just need to have both GitHub repositories set up as remotes in your 
local repository. E.g., add your GitHub fork as a separate remote "git 
remote add mumrah git@github.com:mumrah/kafka.git", then push your 
feature branch to it "git push mumrah KAFKA-675"


On 1/2/13 4:45 PM, Jay Kreps wrote:
> I don't know about other people but I find git kind of confusing. I thought
> it would be useful to try to document the normal workflow for different use
> cases:
> 1. Contributing a patch
> 2. Reviewing and integrating a patch that is contributed
> 3. Doing development as a committer
> 4. Keeping a copy of your local work on github (since it doesn't seem
> Apache has a place to keep local backups of work in progress).
> https://cwiki.apache.org/confluence/display/KAFKA/Git+Workflow
> I would like to link this up from the contributor page to help people
> (including my future self). Objections?
> I am not a git expert, so any feedback to improve these recipes or bug
> fixes (since I haven't tried everything) would be very much appreciated. If
> you are about to do one of the above things, try the recipe and see if it
> can be improved.
> Cheers,
> -Jay

View raw message