Working with git and sending in patches
Hi,
Just trying to put all jigsaw puzzle together here. Please correct me if I'm wrong.
First of all, philosophy for version control with git:
. While developing, small/independent commits are good thing, so that it's easy to decouple different changes.
. But when integrating something in a main branch, commits should contain all logical/related changes.
Steps (using grml-debootstrap as an example):
- do initial git pull into grml-debootstrap
git pull git://git.grml.org/grml-debootstrap master
- Go into grml-debootstrap and start a new branch
git checkout -b t/my-working-branch
- work on the code, commit, hack, commit, hack, commit -- commit often & commit small
- when AOK and need to integrate patches into main branch, squash all patches into one
git rebase -i origin/master
- send in patches via email (to grml-devel@ml.grml.org)
git format-patch origin git send-email --to grml-devel@ml.grml.org ...
Please correct me if anything above is wrong.
Now, question, having following the above, I am having problem pulling in the latest master from head:
$ git pull [ . . . ] You asked me to pull without telling me which branch you want to merge with, and 'branch.t/apt_cache.merge' in your configuration file does not tell me, either. Please specify which branch you want to use on the command line and try again (e.g. 'git pull <repository> <refspec>'). See git-pull(1) for details.
$ git pull git://git.grml.org/grml-debootstrap master
From git://git.grml.org/grml-debootstrap
* branch master -> FETCH_HEAD Auto-merging chroot-script CONFLICT (content): Merge conflict in chroot-script Auto-merging cmdlineopts.clp CONFLICT (content): Merge conflict in cmdlineopts.clp Auto-merging config Auto-merging grml-debootstrap CONFLICT (content): Merge conflict in grml-debootstrap Auto-merging grml-debootstrap.8.txt Automatic merge failed; fix conflicts and then commit the result.
So,
- what's the normal steps here to pulling in the latest master from head? - how to solve the above specific problem? I'm thinking just to abandon this directory and pull from git from scratch again.
Thanks
* Tong Sun wrote [07.06.10 02:56]: Hi,
- work on the code, commit, hack, commit, hack, commit -- commit often &
commit small
Would be good, but this is your private workflow. You can do whatever you liket there. But it makes life easier.
- when AOK and need to integrate patches into main branch, squash all
patches into one
git rebase -i origin/master
Not all patches but logical changes.
Now, question, having following the above, I am having problem pulling in the latest master from head:
$ git pull [ . . . ] try again (e.g. 'git pull <repository> <refspec>'). See git-pull(1) for details.
$ git pull git://git.grml.org/grml-debootstrap master [ merge worked ] CONFLICT (content): Merge conflict in grml-debootstrap Auto-merging grml-debootstrap.8.txt Automatic merge failed; fix conflicts and then commit the result.
So,
- what's the normal steps here to pulling in the latest master from head?
- how to solve the above specific problem? I'm thinking just to abandon this
directory and pull from git from scratch again.
git pull does an git fetch and git merge. But in your first issue you never specified which branch should be merged into.
Te problem with the second command is that you have some merge conflict here. Have a look at http://stackoverflow.com/questions/161813/how-do-i-fix-merge-conflicts-in-gi... how to fix it.
regards, Ulrich
On Mon, Jun 7, 2010 at 1:58 AM, Ulrich Dangel mru@grml.org wrote:
git rebase -i origin/master
Not all patches but logical changes.
Ok, yes, only squash all logically related patches together.
Here's one more question for me to put all jigsaw puzzle together -- having done above, if I start to work some logically unrelated patches, what steps should I take? (I don't want 'git rebase' to pick up patches that I've already sent in).
Thanks
On Wed, Jun 9, 2010 at 6:59 PM, Tong Sun suntong@cpan.org wrote:
Here's one more question for me to put all jigsaw puzzle together -- having done above, if I start to work some logically unrelated patches, what steps should I take? (I don't want 'git rebase' to pick up patches that I've already sent in).
Hi,
This is in fact the second time that I asked the same question. Not getting the answer to the it has prevented me from working further on any grml projects. Good news is that I've got the answer now (since I want to patch again).
Now, is it possible to add in our http://grml.org/git/ doc a section for "leaf" contributors, a work flow cook book for them to easily follow? FYI, most the work flow doc can be found in http://thread.gmane.org/gmane.comp.version-control.git/151948 and the OP of the thread.
thanks
Teilnehmer (2)
-
Tong Sun -
Ulrich Dangel