{"thread":{"id":"18111","subject":"parallel dev. with email","startedAt":"2009-03-03T15:31:41Z","lastAt":"2009-03-03T19:35:33Z","messageCount":3,"participants":["stoecher@gmx.at","Marcel M. Cary","Peter Baumann"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"106849","messageId":"20090303153141.246620@gmx.net","threadId":"18111","inReplyTo":null,"subject":"parallel dev. with email","fromName":"","fromEmail":"stoecher@gmx.at","sentAt":"2009-03-03T15:31:41Z","receivedAt":"2009-03-03T15:31:41Z","isPatch":false,"sender":{"key":"stoecher@gmx.at","avatar":null},"body":"Hi,\n\nI 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.\n\nThis is how far I have come reading the online docu:\n* Each developer can create the diff-info of his commits with\n  git format-patch\n* and the other developer can incorporate these changes with\n  git am\n\nAfter creating the patches with format-patch one could set a tag:\n  git tag -f patchesDone\nso next time one wants to create patches, this tag can be used as the starting point:\n  git format-patch patchesDone..\n\nBut 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?\n\nthank you,\n\nWolfgang\n-- \nComputer Bild Tarifsieger! GMX FreeDSL - Telefonanschluss + DSL\nfür nur 17,95 ¿/mtl.!* http://dsl.gmx.de/?ac=OM.AD.PD003K11308T4569a\n"},{"id":"106890","messageId":"49AD66DB.1090903@earth.care2.com","threadId":"18111","inReplyTo":"20090303153141.246620@gmx.net","subject":"Re: parallel dev. with email","fromName":"Marcel M. Cary","fromEmail":"marcel@earth.care2.com","sentAt":"2009-03-03T17:20:27Z","receivedAt":"2009-03-03T17:20:27Z","isPatch":false,"sender":{"key":"marcel@earth.care2.com","avatar":null},"body":"stoecher@gmx.at wrote:\n> Hi,\n> \n> I am new to git and I am wondering what git commands to use for \n > this szenario: two developers without the possibility of sharing\n > a server communicate their changes via email.\n >\n> This is how far I have come reading the online docu:\n> * Each developer can create the diff-info of his commits with\n>   git format-patch\n> * and the other developer can incorporate these changes with\n>   git am\n> \n> After creating the patches with format-patch one could set a tag:\n>   git tag -f patchesDone\n> so next time one wants to create patches, this tag can be used as the starting point:\n>   git format-patch patchesDone..\n\nI wonder if it would be easier to maintain a separate branch containing \nchanges which you have both integrated.  Suppose you call it \"master\". \nAnd then do your own work on another branch called \"private\".  Then when \nyou want to send all your new work, you can just do:\n\n   git format-patch master..private\n\npossibly threading the messages, etc.\n\nWhen your collaborator has acknowledged receipt of the patches, you put \nthem on your master also, and rebase your \"private\" branch.  If the \npatch doesn't apply cleanly for your collaborator, you'd need to apply \nyour collaborator's resolution to your master instead of your original \npatch.  Or you could apply whatever work your collaborator has that is \nconflicting with your own patch, and resolve the conflict yourself.\n\nI would expect you can periodically verify that your \"master\" source \ncode is synchronized by comparing tree hashes, even though the commit \nhashes may differ.\n\nI imagine you might find that your patches might sometimes have a \ndifferent order than your collaborator's if your emails cross, and their \ncommit hashes may differ.  But I expect that would mostly work out ok. \nYou could probably verify that your \"master\" source code is synchronized \nby comparing tree hashes from time to time, even though the commit \nhashes may differ.\n\nYou could even split your work among several \"feature branches\".  But \none piece of information that \"git format-patch\" does not advertise, but \nwhich \"git push\" does, is the branch that a patch should be applied to. \n  So if your protocol is email-only, and you want to share many branches \nwith your collaborator, you'd have to communicate that explicity in the \nemail.\n\n> But what if in the meantime one has incorporated the other \n > developer's changes with git am? Then these changes will also\n > be among the patches created with format-patch. What will\n > happen, if these patches are sent to the other developer,\n> who does not need his own changes again. Will his own changes \n > be silently ignored by git am?\n\nYes, provided the actual code changes in the duplicate patch are exactly \nthe same, git am will skip it, even if the committer, timestamps, or \ncomment are slightly different.\n\nMarcel\n"},{"id":"106918","messageId":"20090303193533.GC9964@m62s10.vlinux.de","threadId":"18111","inReplyTo":"20090303153141.246620@gmx.net","subject":"Re: parallel dev. with email","fromName":"Peter Baumann","fromEmail":"waste.manager@gmx.de","sentAt":"2009-03-03T19:35:33Z","receivedAt":"2009-03-03T19:35:33Z","isPatch":false,"sender":{"key":"waste.manager@gmx.de","avatar":null},"body":"On Tue, Mar 03, 2009 at 04:31:41PM +0100, stoecher@gmx.at wrote:\n> Hi,\n> \n> 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.\n> \n> This is how far I have come reading the online docu:\n> * Each developer can create the diff-info of his commits with\n>   git format-patch\n> * and the other developer can incorporate these changes with\n>   git am\n> \n> After creating the patches with format-patch one could set a tag:\n>   git tag -f patchesDone\n> so next time one wants to create patches, this tag can be used as the starting point:\n>   git format-patch patchesDone..\n> \n> 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?\n> \n> thank you,\n> \n> Wolfgang\n\n[ Disclaimer: It was a *very* long time since I used this; there might\n  be a better way to use bundles already ]\n\nYou could also use 'git bundle' to send your changes.  E.g. if you have\nall your already released/send patches in master branch and all your\nlocale changes in private\n\n $ git bundle create mybundle private ^master  \t# not sure if private..master\n\t\t\t\t\t\t# will work here\n\n\nand your friend could to\n\n $ git bundle verify mybundle\n $ git fetch mybundle master:localRef\n\nto import the changes. (Pls have a look in the manpage of git bundle,\nthere are many examples)\n\n-Peter\n"}]}