{"thread":{"id":"9345","subject":"multiple checked out branches","startedAt":"2007-08-01T22:04:35Z","lastAt":"2007-08-02T17:16:08Z","messageCount":6,"participants":["Domenico Andreoli","Julian Phillips","Alex Riesen","Johannes Schindelin","Guilhem Bonnefille"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"49354","messageId":"20070801220435.GA19226@raptus.dandreoli.com","threadId":"9345","inReplyTo":null,"subject":"multiple checked out branches","fromName":"Domenico Andreoli","fromEmail":"cavokz@gmail.com","sentAt":"2007-08-01T22:04:35Z","receivedAt":"2007-08-01T22:04:35Z","isPatch":false,"sender":{"key":"cavokz@gmail.com","avatar":null},"body":"Hi again,\n\n  I would like to contemporaneously work with multiple branches out of\nthe same git repository. This does not work out of the box.\n\nSo I prepare multiple copies of the same repository, every one will have\nits own checked out branch but I want to share most of their .git subdir.\n\nI surely want to share the object db, the local and remote refs.\nThis way it is enough to make a round of fetches/merges/pushes to have\nall the shared-repositories up to date.\n\nI expect to do the trick with some symlinks but I am not an expert of\ngit internals. Which traps are waiting me? Any hint? Thank you.\n\nRegards,\nDomenico\n\n-----[ Domenico Andreoli, aka cavok\n --[ http://www.dandreoli.com/gpgkey.asc\n   ---[ 3A0F 2F80 F79C 678A 8936  4FEE 0677 9033 A20E BC50\n"},{"id":"49360","messageId":"Pine.LNX.4.64.0708012309010.28202@beast.quantumfyre.co.uk","threadId":"9345","inReplyTo":"20070801220435.GA19226@raptus.dandreoli.com","subject":"Re: multiple checked out branches","fromName":"Julian Phillips","fromEmail":"julian@quantumfyre.co.uk","sentAt":"2007-08-01T22:19:25Z","receivedAt":"2007-08-01T22:19:25Z","isPatch":false,"sender":{"key":"julian@quantumfyre.co.uk","avatar":"https://avatars.githubusercontent.com/u/948888?v=4"},"body":"On Thu, 2 Aug 2007, Domenico Andreoli wrote:\n\n> Hi again,\n>\n>  I would like to contemporaneously work with multiple branches out of\n> the same git repository. This does not work out of the box.\n\nDepends on how you define \"the box\" ...\n\nThere is a script to do this in contrib called git-new-workdir.  It allows \nyou to have multiple working directories from the same repository for \nexactly this purpose.\n\n> So I prepare multiple copies of the same repository, every one will have\n> its own checked out branch but I want to share most of their .git subdir.\n>\n> I surely want to share the object db, the local and remote refs.\n> This way it is enough to make a round of fetches/merges/pushes to have\n> all the shared-repositories up to date.\n>\n> I expect to do the trick with some symlinks but I am not an expert of\n> git internals. Which traps are waiting me? Any hint? Thank you.\n\nSymlinks are exactly what is used by new-workdir to link the workdirs back \nto the original repository.\n\nThe biggest issue with doing this is that you have no protection against \nmaking changes on the same branch in more than one place - something you \nreally don't want to be dealing with.  Basically you need to be careful \nabout updating refs that you have checkedout in workdirs.\n\n-- \nJulian\n\n  ---\n...when fits of creativity run strong, more than one programmer or writer has\nbeen known to abandon the desktop for the more spacious floor.\n- Fred Brooks, Jr.\n"},{"id":"49363","messageId":"20070801223430.GC2911@steel.home","threadId":"9345","inReplyTo":"20070801220435.GA19226@raptus.dandreoli.com","subject":"Re: multiple checked out branches","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2007-08-01T22:34:30Z","receivedAt":"2007-08-01T22:34:30Z","isPatch":false,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"Domenico Andreoli, Thu, Aug 02, 2007 00:04:35 +0200:\n> Hi again,\n> \n>   I would like to contemporaneously work with multiple branches out of\n> the same git repository. This does not work out of the box.\n> \n> So I prepare multiple copies of the same repository, every one will have\n> its own checked out branch but I want to share most of their .git subdir.\n> \n> I surely want to share the object db, the local and remote refs.\n> This way it is enough to make a round of fetches/merges/pushes to have\n> all the shared-repositories up to date.\n> \n> I expect to do the trick with some symlinks but I am not an expert of\n> git internals. Which traps are waiting me? Any hint? Thank you.\n> \n\nNo traps. Supported. See for \"git clone -s\" and \"git clone -l\"\n"},{"id":"49365","messageId":"Pine.LNX.4.64.0708012338250.14781@racer.site","threadId":"9345","inReplyTo":"20070801223430.GC2911@steel.home","subject":"Re: multiple checked out branches","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-08-01T22:39:47Z","receivedAt":"2007-08-01T22:39:47Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Thu, 2 Aug 2007, Alex Riesen wrote:\n\n> Domenico Andreoli, Thu, Aug 02, 2007 00:04:35 +0200:\n> > \n> >   I would like to contemporaneously work with multiple branches out of\n> > the same git repository. This does not work out of the box.\n> > \n> > So I prepare multiple copies of the same repository, every one will have\n> > its own checked out branch but I want to share most of their .git subdir.\n> > \n> > I surely want to share the object db, the local and remote refs.\n> > This way it is enough to make a round of fetches/merges/pushes to have\n> > all the shared-repositories up to date.\n> > \n> > I expect to do the trick with some symlinks but I am not an expert of\n> > git internals. Which traps are waiting me? Any hint? Thank you.\n> > \n> \n> No traps. Supported. See for \"git clone -s\" and \"git clone -l\"\n\nThat is not completely what is wanted, AFAIU:  \"git clone -s\" and \"git \nclone -l\" allow for unsynchronised branches.  For example, when you \ncommitted to branch \"foo\" in the cloned repo, branch \"foo\" in the original \nrepo will be older until you push.\n\nCiao,\nDscho\n"},{"id":"49377","messageId":"20070802000217.GA20018@raptus.dandreoli.com","threadId":"9345","inReplyTo":"Pine.LNX.4.64.0708012309010.28202@beast.quantumfyre.co.uk","subject":"Re: multiple checked out branches","fromName":"Domenico Andreoli","fromEmail":"cavokz@gmail.com","sentAt":"2007-08-02T00:02:17Z","receivedAt":"2007-08-02T00:02:17Z","isPatch":false,"sender":{"key":"cavokz@gmail.com","avatar":null},"body":"On Wed, Aug 01, 2007 at 11:19:25PM +0100, Julian Phillips wrote:\n>\n> The biggest issue with doing this is that you have no protection against \n> making changes on the same branch in more than one place - something you \n> really don't want to be dealing with.  Basically you need to be careful \n> about updating refs that you have checkedout in workdirs.\n\nYes, I figured out this would have been a problem after thinking at it\na bit more. I surely do not want to be careful about acting on the same\nbranch in two working repositories at the same place.\n\nThe actual problem is that switching form a branch to another makes\nmy autotools fuck and I have to rebuild stuff all the time. My box is\nstill a faint-hearted single core...\n\ncheers,\nDomenico\n\n-----[ Domenico Andreoli, aka cavok\n --[ http://www.dandreoli.com/gpgkey.asc\n   ---[ 3A0F 2F80 F79C 678A 8936  4FEE 0677 9033 A20E BC50\n"},{"id":"49445","messageId":"8b65902a0708021016j4eb11577v8da5bd67df58adea@mail.gmail.com","threadId":"9345","inReplyTo":"20070802000217.GA20018@raptus.dandreoli.com","subject":"Re: multiple checked out branches","fromName":"Guilhem Bonnefille","fromEmail":"guilhem.bonnefille@gmail.com","sentAt":"2007-08-02T17:16:08Z","receivedAt":"2007-08-02T17:16:08Z","isPatch":false,"sender":{"key":"guilhem.bonnefille@gmail.com","avatar":"https://gravatar.com/avatar/375364bfee1f61197c540e37465abe3619fc24eb3a36b0edcea7f15b124036b0?d=mp&s=160"},"body":"On 8/2/07, Domenico Andreoli <cavokz@gmail.com> wrote:\n> On Wed, Aug 01, 2007 at 11:19:25PM +0100, Julian Phillips wrote:\n> The actual problem is that switching form a branch to another makes\n> my autotools fuck and I have to rebuild stuff all the time. My box is\n> still a faint-hearted single core...\n\nI encounter same problem. Actually, I did full rebuild every time\n(which is counter-productive). But, reading at your mail, I have an\nother idea: what about the \"remote\" compilation offered by autotools?\n\nNormally, autotools are design in such way that you can share the same\nsource for different configuration. To do this, simply create one\n\"build\" directory per branch, go to this directory and do:\n../configure && make\n\nI'm unable to try it now, so I express now all my \"confuses\" if it was\na bad idea.\n-- \nGuilhem BONNEFILLE\n-=- #UIN: 15146515 JID: guyou@im.apinc.org MSN: guilhem_bonnefille@hotmail.com\n-=- mailto:guilhem.bonnefille@gmail.com\n-=- http://nathguil.free.fr/\n"}]}