threads / discuss / 18111

parallel dev. with email

Subject: parallel dev. with email

## tl;dr

3 messages between Mar 3, 2009 and Mar 3, 2009.

replies: 2people: 3as markdown or json

stoecher@gmx.at· Mar 3, 2009, 15:31 UTC · lore
Hi,
I am new to git and I am wondering what git commands to use for this szenario: two developers without the possibility of sharing a server communicate their changes via email.
This is how far I have come reading the online docu:
* Each developer can create the diff-info of his commits with
  git format-patch
* and the other developer can incorporate these changes with
  git am
After creating the patches with format-patch one could set a tag:
  git tag -f patchesDone
so next time one wants to create patches, this tag can be used as the starting point:
  git format-patch patchesDone..
But what if in the meantime one has incorporated the other developer's changes with git am? Then these changes will also be among the patches created with format-patch. What will happen, if these patches are sent to the other developer, who does not need his own changes again. Will his own changes be silently ignored by git am? Or how else to effectively coordinate the work of two developers with git via email?
thank you,
Wolfgang
-- 
Computer Bild Tarifsieger! GMX FreeDSL - Telefonanschluss + DSL
für nur 17,95 ¿/mtl.!* http://dsl.gmx.de/?ac=OM.AD.PD003K11308T4569a
Marcel M. Cary· Mar 3, 2009, 17:20 UTC · re: stoecher@gmx.at · lore

Re: parallel dev. with email

stoecher@gmx.at wrote:
> Hi,
> 
> I am new to git and I am wondering what git commands to use for 
 > this szenario: two developers without the possibility of sharing
 > a server communicate their changes via email.
 >
Show 10 quoted lines
> This is how far I have come reading the online docu:
> * Each developer can create the diff-info of his commits with
>   git format-patch
> * and the other developer can incorporate these changes with
>   git am
> 
> After creating the patches with format-patch one could set a tag:
>   git tag -f patchesDone
> so next time one wants to create patches, this tag can be used as the starting point:
>   git format-patch patchesDone..

I wonder if it would be easier to maintain a separate branch containing changes which you have both integrated. Suppose you call it "master". And then do your own work on another branch called "private". Then when you want to send all your new work, you can just do:

   git format-patch master..private
possibly threading the messages, etc.

When your collaborator has acknowledged receipt of the patches, you put them on your master also, and rebase your "private" branch. If the patch doesn't apply cleanly for your collaborator, you'd need to apply your collaborator's resolution to your master instead of your original patch. Or you could apply whatever work your collaborator has that is conflicting with your own patch, and resolve the conflict yourself.

I would expect you can periodically verify that your "master" source code is synchronized by comparing tree hashes, even though the commit hashes may differ.

I imagine you might find that your patches might sometimes have a different order than your collaborator's if your emails cross, and their commit hashes may differ. But I expect that would mostly work out ok. You could probably verify that your "master" source code is synchronized by comparing tree hashes from time to time, even though the commit hashes may differ.

You could even split your work among several "feature branches".  But 
one piece of information that "git format-patch" does not advertise, but 
which "git push" does, is the branch that a patch should be applied to. 
  So if your protocol is email-only, and you want to share many branches 
with your collaborator, you'd have to communicate that explicity in the 
email.
> But what if in the meantime one has incorporated the other 
 > developer's changes with git am? Then these changes will also
 > be among the patches created with format-patch. What will
 > happen, if these patches are sent to the other developer,
> who does not need his own changes again. Will his own changes 
 > be silently ignored by git am?

Yes, provided the actual code changes in the duplicate patch are exactly the same, git am will skip it, even if the committer, timestamps, or comment are slightly different.

Marcel
Peter Baumann· Mar 3, 2009, 19:35 UTC · re: stoecher@gmx.at · lore

Re: parallel dev. with email

On Tue, Mar 03, 2009 at 04:31:41PM +0100, stoecher@gmx.at wrote:
Show 20 quoted lines
> Hi,
> 
> I am new to git and I am wondering what git commands to use for this szenario: two developers without the possibility of sharing a server communicate their changes via email.
> 
> This is how far I have come reading the online docu:
> * Each developer can create the diff-info of his commits with
>   git format-patch
> * and the other developer can incorporate these changes with
>   git am
> 
> After creating the patches with format-patch one could set a tag:
>   git tag -f patchesDone
> so next time one wants to create patches, this tag can be used as the starting point:
>   git format-patch patchesDone..
> 
> But what if in the meantime one has incorporated the other developer's changes with git am? Then these changes will also be among the patches created with format-patch. What will happen, if these patches are sent to the other developer, who does not need his own changes again. Will his own changes be silently ignored by git am? Or how else to effectively coordinate the work of two developers with git via email?
> 
> thank you,
> 
> Wolfgang
[ Disclaimer: It was a *very* long time since I used this; there might
  be a better way to use bundles already ]

You could also use 'git bundle' to send your changes. E.g. if you have all your already released/send patches in master branch and all your locale changes in private

 $ git bundle create mybundle private ^master  	# not sure if private..master
						# will work here
and your friend could to
 $ git bundle verify mybundle
 $ git fetch mybundle master:localRef

to import the changes. (Pls have a look in the manpage of git bundle, there are many examples)

-Peter

← back to recent threads