{"thread":{"id":"21745","subject":"Git repository mesh?","startedAt":"2009-11-25T04:07:51Z","lastAt":"2009-11-25T18:23:29Z","messageCount":9,"participants":["Nguyen Thai Ngoc Duy","Matthieu Moy","Sergio","Alex Riesen","Jakub Narebski"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"128282","messageId":"fcaeb9bf0911242007t1294bddej87b48691ea283e21@mail.gmail.com","threadId":"21745","inReplyTo":null,"subject":"Git repository mesh?","fromName":"Nguyen Thai Ngoc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2009-11-25T04:07:51Z","receivedAt":"2009-11-25T04:07:51Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Hi,\n\nI work on a few machines so I have repositories on all of them. One\nrepository can pull from or push to any other repositories (in case of\npush, it pushes on remote branches). I avoid a central repository\nbecause it's quite inconvenient when you just need to push some\nchanges to a machine, you have to push it to the central repository\nthen pull from that (and if the central repository is on WAN, double\ninconvenient). Maybe this model is just plain wrong, but it'd be fun\nto see if Git can work with this model.\n\nThe first thing that annoys me is remote repository management.\nEverytime I add a new repository to the mesh, I need to update .config\nof all repositories. Putting part of $GIT_DIR/config into working\ndirectory may help (though there will be security concerns, perhaps\nonly remote.* should be allowed in in-tree config file). Next thing is\nsometimes I want to see how many commits ahead/behind other\nrepositories, from a repository. \"git status\" does not help much.\nNever used Mercurial but the idea of \"git in\" and \"git out\" to see how\nmany commits ahead/behind would be nice.\n\nHas anyone done something like this? Any suggestions?\n--\nDuy\n"},{"id":"128284","messageId":"vpqaaybf37f.fsf@bauges.imag.fr","threadId":"21745","inReplyTo":"fcaeb9bf0911242007t1294bddej87b48691ea283e21@mail.gmail.com","subject":"Re: Git repository mesh?","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2009-11-25T07:55:48Z","receivedAt":"2009-11-25T07:55:48Z","isPatch":false,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes:\n\n> Never used Mercurial but the idea of \"git in\" and \"git out\" to see how\n> many commits ahead/behind would be nice.\n\nIn Git, you'd run \"git fetch\" to get everything locally, and then\n\ngit log ..origin/master => what origin/master has that you don't\ngit log origin/master.. => what you have that origin/master doesn't\n\n(and you can define aliases for that)\n\n--\nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"128285","messageId":"fcaeb9bf0911250000u395c0153q43c8c7a60ca9b876@mail.gmail.com","threadId":"21745","inReplyTo":"vpqaaybf37f.fsf@bauges.imag.fr","subject":"Re: Git repository mesh?","fromName":"Nguyen Thai Ngoc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2009-11-25T08:00:28Z","receivedAt":"2009-11-25T08:00:28Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Wed, Nov 25, 2009 at 2:55 PM, Matthieu Moy\n<Matthieu.Moy@grenoble-inp.fr> wrote:\n> Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes:\n>\n>> Never used Mercurial but the idea of \"git in\" and \"git out\" to see how\n>> many commits ahead/behind would be nice.\n>\n> In Git, you'd run \"git fetch\" to get everything locally, and then\n>\n> git log ..origin/master => what origin/master has that you don't\n> git log origin/master.. => what you have that origin/master doesn't\n>\n> (and you can define aliases for that)\n\nBut I have many origins (any repository could be origin). \"git status\"\nalso have this kind of information, but only for \"origin\".\n-- \nDuy\n"},{"id":"128287","messageId":"loom.20091125T092917-792@post.gmane.org","threadId":"21745","inReplyTo":"fcaeb9bf0911242007t1294bddej87b48691ea283e21@mail.gmail.com","subject":"Re: Git repository mesh?","fromName":"Sergio","fromEmail":"sergio.callegari@gmail.com","sentAt":"2009-11-25T08:42:37Z","receivedAt":"2009-11-25T08:42:37Z","isPatch":false,"sender":{"key":"sergio.callegari@gmail.com","avatar":"https://gravatar.com/avatar/c98f41317e0422c1e630385de0e3970227b8e5ad15f35ba8586066467cc833bc?d=mp&s=160"},"body":"Nguyen Thai Ngoc Duy <pclouds <at> gmail.com> writes:\n\n> \n> Hi,\n> \n> I work on a few machines so I have repositories on all of them. One\n> repository can pull from or push to any other repositories (in case of\n> push, it pushes on remote branches). I avoid a central repository\n> because it's quite inconvenient when you just need to push some\n> changes to a machine, you have to push it to the central repository\n> then pull from that (and if the central repository is on WAN, double\n> inconvenient). Maybe this model is just plain wrong, but it'd be fun\n> to see if Git can work with this model.\n> \n> The first thing that annoys me is remote repository management.\n> Everytime I add a new repository to the mesh, I need to update .config\n> of all repositories. \n\nIf I remember correctly, there was in the past the idea of allowing some limited\nshell variable substitution in the config file.\n\nThis would allow to have a single config for all the machines with remote\nentries. Something like\n\n[remote \"host1\"]\n        url = ssh://host1/path\n        fetch = +refs/heads/*:refs/remotes/host1/*\n        push = +refs/heads/*:refs/remotes/$hostname/*\n[remote \"host2\"]\n        url = ssh://host2/path\n        fetch = +refs/heads/*:refs/remotes/host2/*\n        push = +refs/heads/*:refs/remotes/$hostname/*\n...\n\nIn other terms, admitting that all the candidate machines are known at the very\nstart, you could start a repo on any of the host, placing in the config file all\nthe possible hosts.  Moreover, not needing to have a different config for each\nhost may make it easier to manage (propagate by simple scp) or even to version\ncontrol.\n\nTo the best of my knowledge the idea was not implemented in the end, but I think\nthat a patch for variable substitution in the config file might still be found\non the ML.\n\nSergio\n"},{"id":"128291","messageId":"81b0412b0911250208v67a16637s72551a892af4b0d8@mail.gmail.com","threadId":"21745","inReplyTo":"fcaeb9bf0911242007t1294bddej87b48691ea283e21@mail.gmail.com","subject":"Re: Git repository mesh?","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2009-11-25T10:08:46Z","receivedAt":"2009-11-25T10:08:46Z","isPatch":false,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"On Wed, Nov 25, 2009 at 05:07, Nguyen Thai Ngoc Duy <pclouds@gmail.com> wrote:\n> I work on a few machines so I have repositories on all of them. One\n> repository can pull from or push to any other repositories (in case of\n> push, it pushes on remote branches). I avoid a central repository\n> because it's quite inconvenient when you just need to push some\n> changes to a machine, you have to push it to the central repository\n> then pull from that (and if the central repository is on WAN, double\n> inconvenient). Maybe this model is just plain wrong, but it'd be fun\n> to see if Git can work with this model.\n\nYou can always use fetch (and pull) without specifying a remote:\n\n  $ git fetch host:/path/repo some-branch\n  $ git log ..FETCH_HEAD # git merge FETCH_HEAD\n\nMaybe fetch should be extended to record this operation in .git/config?\n\n  $ git fetch ---save=host-some host:/path/repo some-branch some-branch\n  $ git remote -v\n  ...\n  host-some\thost:/path/repo (fetch)\n  $\n"},{"id":"128301","messageId":"vpqy6lues5j.fsf@bauges.imag.fr","threadId":"21745","inReplyTo":"fcaeb9bf0911250000u395c0153q43c8c7a60ca9b876@mail.gmail.com","subject":"Re: Git repository mesh?","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2009-11-25T11:54:32Z","receivedAt":"2009-11-25T11:54:32Z","isPatch":false,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes:\n\n> On Wed, Nov 25, 2009 at 2:55 PM, Matthieu Moy\n> <Matthieu.Moy@grenoble-inp.fr> wrote:\n>> Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes:\n>>\n>>> Never used Mercurial but the idea of \"git in\" and \"git out\" to see how\n>>> many commits ahead/behind would be nice.\n>>\n>> In Git, you'd run \"git fetch\" to get everything locally, and then\n>>\n>> git log ..origin/master => what origin/master has that you don't\n>> git log origin/master.. => what you have that origin/master doesn't\n>>\n>> (and you can define aliases for that)\n>\n> But I have many origins (any repository could be origin). \"git status\"\n> also have this kind of information, but only for \"origin\".\n\nThen, fetch from all of them and:\n\n  git log ^HEAD repo1/master repo2/master repo3/master\n\n--\nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"128303","messageId":"fcaeb9bf0911250416u7e363ab2yf9334bad09f957fb@mail.gmail.com","threadId":"21745","inReplyTo":"vpqy6lues5j.fsf@bauges.imag.fr","subject":"Re: Git repository mesh?","fromName":"Nguyen Thai Ngoc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2009-11-25T12:16:38Z","receivedAt":"2009-11-25T12:16:38Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On 11/25/09, Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> wrote:\n> Then, fetch from all of them and:\n>\n>   git log ^HEAD repo1/master repo2/master repo3/master\n\nVery nice. Thanks I did not know about \"^HEAD\". Now I need to think of\nhow to avoid typing all \"repo*/master\" stuff..\n-- \nDuy\n"},{"id":"128308","messageId":"m3d436burx.fsf@localhost.localdomain","threadId":"21745","inReplyTo":"fcaeb9bf0911250416u7e363ab2yf9334bad09f957fb@mail.gmail.com","subject":"Re: Git repository mesh?","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2009-11-25T13:26:54Z","receivedAt":"2009-11-25T13:26:54Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes:\n\n> On 11/25/09, Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> wrote:\n> > Then, fetch from all of them and:\n> >\n> >   git log ^HEAD repo1/master repo2/master repo3/master\n> \n> Very nice. Thanks I did not know about \"^HEAD\". Now I need to think of\n> how to avoid typing all \"repo*/master\" stuff..\n\nHmmm... shouldn't 'repo1' expand to 'repo1/HEAD', which is 'repo1/master'?\nI mean shouldn't simply\n\n  git log ^HEAD repo1 repo2 repo3\n\nwork?\n\nAlso, git aliases (so you would be able to just say \"git in\").\n\n-- \nJakub Narebski\nPoland\n"},{"id":"128325","messageId":"vpqfx82a2fy.fsf@bauges.imag.fr","threadId":"21745","inReplyTo":"fcaeb9bf0911250416u7e363ab2yf9334bad09f957fb@mail.gmail.com","subject":"Re: Git repository mesh?","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2009-11-25T18:23:29Z","receivedAt":"2009-11-25T18:23:29Z","isPatch":false,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes:\n\n> On 11/25/09, Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> wrote:\n>> Then, fetch from all of them and:\n>>\n>>   git log ^HEAD repo1/master repo2/master repo3/master\n>\n> Very nice. Thanks I did not know about \"^HEAD\".\n\nRead \"not HEAD\", this means \"remove the ancestry of HEAD in the output\".\n\nSee \"man git-rev-parse\" for details.\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"}]}