git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: parallel dev. with email

From
MCMarcel M. Cary <marcel@earth.care2.com>
Date
Mar 3, 2009, 17:20 UTC
Message-ID
<49AD66DB.1090903@earth.care2.com>
In-Reply-To
<20090303153141.246620@gmx.net>
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
Previous: stoecher@gmx.atNext: Peter Baumann
Message 2 of 3 in “parallel dev. with email”
  1. stoecher@gmx.atMar 3, 2009
  2. Marcel M. CaryMar 3, 2009
  3. Peter BaumannMar 3, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.