{"thread":{"id":"11100","subject":"git + unison","startedAt":"2007-12-02T17:59:36Z","lastAt":"2007-12-02T19:05:22Z","messageCount":3,"participants":["Matthieu Moy","Remi Vanicat","J. Bruce Fields"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"61664","messageId":"vpqd4tpgepj.fsf@bauges.imag.fr","threadId":"11100","inReplyTo":null,"subject":"git + unison","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2007-12-02T17:59:36Z","receivedAt":"2007-12-02T17:59:36Z","isPatch":false,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"Hi,\n\nI'm wondering how dangerous the interaction of git with the unison\nfile synchronizer[1] can be.\n\nAnother way of asking the question can be: what's the best way to\nkeep two machines with many git repositories in sync?\n\nUnison is a userland application that does bi-directional\nsynchronization of two directories. Typically, to keep a laptop and a\ndesktop synchronized (modify a file on the desktop and another on the\nlaptop, unison will copy the files). I find it very usefull to keep\nlarge directories containing unrelated projects (typically,\n~/teaching/, ~/research, ..., my colleagues even synchronize $HOME on\ntheir laptops) in sync between two machines.\n\nActually, git achives something similar (and lot more, of course):\nmodify a file here, commit, modify another there, commit, and then\npush & pull can do the sync. I find git excellent to manage somehow\nself-contained projects (~/teaching/2007-2008/whatever-course/), but\ninappropriate for $HOME or such big containers (need to run more\ncommands, disk-space overhead, ...).\n\nSo, at the moment, I have both unison and git. My fear is that unison\ntouches the content of the .git/ directories. So, for example, if I\ncommit on one side, and commit something else on the other side, I'll\nget unison conflicts at least on .git/refs/heads/master and\n.git/index, and resolving the conflict in favor of either side leads\nto dangling objects whith important content.\n\nWhat I'm doing right now is that I try to make sure I don't run unison\nwhen trees have diverged, which is not really satisfactory since 1) I\ncan be wrong, and a miss-synchronization could lead to data-loss, and\n2) that means not really taking advantage of unison.\n\n\nWhat about you? What do you use to synchronize your laptop and\ndesktop, or home and office? Anybody using unison and git on the same\nfilesystem?\n\nThanks for your hints,\n\n-- \nMatthieu\n\n[1] : http://www.cis.upenn.edu/~bcpierce/unison/\n"},{"id":"61666","messageId":"87y7cd7yo9.dlv@vanicat.homelinux.org","threadId":"11100","inReplyTo":"vpqd4tpgepj.fsf@bauges.imag.fr","subject":"Re: git + unison","fromName":"Remi Vanicat","fromEmail":"vanicat@debian.org","sentAt":"2007-12-02T18:13:10Z","receivedAt":"2007-12-02T18:13:10Z","isPatch":false,"sender":{"key":"vanicat@debian.org","avatar":"https://gravatar.com/avatar/cd491a7f4c221349809a60f88fc21326b97cce2a705e318898aa74851db92409?d=mp&s=160"},"body":"Matthieu Moy <Matthieu.Moy@imag.fr> writes:\n\n> Hi,\n>\n[...]\nNote that I do use I do use both unison and git, but I don't use\nunison on git repository (I use git to synchronize git repository).\n\n> So, at the moment, I have both unison and git. My fear is that unison\n> touches the content of the .git/ directories. So, for example, if I\n> commit on one side, and commit something else on the other side, I'll\n> get unison conflicts at least on .git/refs/heads/master and\n> .git/index, and resolving the conflict in favor of either side leads\n> to dangling objects whith important content.\n\nWell, at least with my configuration, when a file have been change on\nboth side, unison offer the possibility to transfer one way or the\nother or to do nothing. I believe that if this happen, the correct\nprocure is to use git tool to merge (as git is better for merging\nthan unison, even more when we are speaking about git repository)\n\n>\n> What I'm doing right now is that I try to make sure I don't run unison\n> when trees have diverged, which is not really satisfactory since 1) I\n> can be wrong, and a miss-synchronization could lead to data-loss, and\n> 2) that means not really taking advantage of unison.\n\nWell, as I've already said, I use unison in an interactive way, so if\na file have been changed in both side, unison say it, ask me what to\ndo. So I can choose to do nothing, and to stop unison right away to\nuse a better tool for this task.\n\n\n\n\n\n-- \nRémi Vanicat\n"},{"id":"61671","messageId":"20071202190522.GB20822@fieldses.org","threadId":"11100","inReplyTo":"vpqd4tpgepj.fsf@bauges.imag.fr","subject":"Re: git + unison","fromName":"J. Bruce Fields","fromEmail":"bfields@fieldses.org","sentAt":"2007-12-02T19:05:22Z","receivedAt":"2007-12-02T19:05:22Z","isPatch":false,"sender":{"key":"bfields@citi.umich.edu","avatar":null},"body":"On Sun, Dec 02, 2007 at 06:59:36PM +0100, Matthieu Moy wrote:\n> What about you? What do you use to synchronize your laptop and\n> desktop, or home and office? Anybody using unison and git on the same\n> filesystem?\n\nI just have a subdirectory of my home directory \"local\" that I tell\nunison not to synchronize:\n\n\tignore = Path local\n\nand keep all my git repos there, relying on git itself when I need to\ndistribute stuff--generally all my repos are associated with public\nrepos on a single (regularly backed-up) server, and I try not to let any\nwork accumulate in any particular repository for long without being\npushed to a branch in its public repo.\n\n--b.\n"}]}