{"thread":{"id":"26414","subject":"[idea] separate .git dir and the working tree","startedAt":"2011-02-05T02:53:58Z","lastAt":"2011-05-23T14:40:57Z","messageCount":12,"participants":["redstun","Mike Gant","Jonathan Nieder","Jared Hance","Konstantin Khomoutov","Nicolas Sebrecht","Michael Witten"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"160421","messageId":"AANLkTik4MjnpOzPdGy7ZDiH0in4e1DpjrhQFOHjUiEEE@mail.gmail.com","threadId":"26414","inReplyTo":null,"subject":"[idea] separate .git dir and the working tree","fromName":"redstun","fromEmail":"redstun@gmail.com","sentAt":"2011-02-05T02:53:58Z","receivedAt":"2011-02-05T02:53:58Z","isPatch":false,"sender":{"key":"redstun@gmail.com","avatar":null},"body":"First please shout if this is a known feature :-)\n\nI think separating the .git directory from its working tree could\nincrease the safety of the data to one more level higher.\n\nWe might have a git variable set to specify (a shared place) where to\nput the .git directories (or the data inside it), then use\n\"/path/to/working/tree\" as (or the seed to calculate) a hash key to\nmap from the (.git directory in the) shared place to the working tree\ndirectory.\n\nOr we may have just a few data (that can be re-created) stored in the\n.git directory along with the working tree, and most of the revision\nhistory stored in the shared place.\n"},{"id":"160423","messageId":"20110205032339.GA15303@mg1","threadId":"26414","inReplyTo":"AANLkTik4MjnpOzPdGy7ZDiH0in4e1DpjrhQFOHjUiEEE@mail.gmail.com","subject":"Re: [idea] separate .git dir and the working tree","fromName":"Mike Gant","fromEmail":"mike@gantsfort.com","sentAt":"2011-02-05T03:23:39Z","receivedAt":"2011-02-05T03:23:39Z","isPatch":false,"sender":{"key":"mike@gantsfort.com","avatar":null},"body":"On Sat, Feb 05, 2011 at 10:53:58AM +0800, redstun wrote:\n> First please shout if this is a known feature :-)\n> \n> I think separating the .git directory from its working tree could\n> increase the safety of the data to one more level higher.\n> \n> We might have a git variable set to specify (a shared place) where to\n> put the .git directories (or the data inside it), then use\n> \"/path/to/working/tree\" as (or the seed to calculate) a hash key to\n> map from the (.git directory in the) shared place to the working tree\n> directory.\n> \n> Or we may have just a few data (that can be re-created) stored in the\n> .git directory along with the working tree, and most of the revision\n> history stored in the shared place.\n\nGIT_DIR and GIT_WORK_TREE might be what you are looking for. Explanation\nof usage in 'man git'\n\nHTH\nMike\n\n> --\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n"},{"id":"160438","messageId":"20110205132708.GA18391@elie","threadId":"26414","inReplyTo":"20110205032339.GA15303@mg1","subject":"Re: [idea] separate .git dir and the working tree","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2011-02-05T13:27:08Z","receivedAt":"2011-02-05T13:27:08Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"(restoring cc list; please do not cull cc's)\n\nMike Gant wrote:\n> On Sat, Feb 05, 2011 at 10:53:58AM +0800, redstun wrote:\n\n>> I think separating the .git directory from its working tree could\n>> increase the safety of the data to one more level higher.\n[...]\n> GIT_DIR and GIT_WORK_TREE might be what you are looking for. Explanation\n> of usage in 'man git'\n\nThe .git directory is allowed to be a symlink.  Or a file like so\n\n\tgitdir: /path/to/git/repo\n\nfor symlink-challenged operating systems.  See gitrepository-layout(7)\nfor details.\n\nCheers,\nJonathan\n"},{"id":"160443","messageId":"AANLkTinYMuXSvKjgtpSCbJPuo=PHDGR_OgOkwtV4Azmz@mail.gmail.com","threadId":"26414","inReplyTo":"20110205132708.GA18391@elie","subject":"Re: [idea] separate .git dir and the working tree","fromName":"redstun","fromEmail":"redstun@gmail.com","sentAt":"2011-02-05T14:24:25Z","receivedAt":"2011-02-05T14:24:25Z","isPatch":false,"sender":{"key":"redstun@gmail.com","avatar":null},"body":"Making .git a symbol link is nice.\n\nRegarding the GIT_DIR variable, looks like it needs to be paired with\nthe GIT_WORK_TREE variable, does this mean that I can only have one\nlocal git repository?\n\nwhat I wanted is, I may have multiple git working tree in my $HOME, like:\n$HOME/proj1\n$HOME/proj2,\n\nI then wanted their .git directories respectively located at\n/safe/disk/.git_proj1\n/safe/disk/.git_proj2\n\nHow can I get this? I tried to read the doc but didn't have much luck.\n\nThanks\n\nOn Sat, Feb 5, 2011 at 9:27 PM, Jonathan Nieder <jrnieder@gmail.com> wrote:\n> (restoring cc list; please do not cull cc's)\n>\n> Mike Gant wrote:\n>> On Sat, Feb 05, 2011 at 10:53:58AM +0800, redstun wrote:\n>\n>>> I think separating the .git directory from its working tree could\n>>> increase the safety of the data to one more level higher.\n> [...]\n>> GIT_DIR and GIT_WORK_TREE might be what you are looking for. Explanation\n>> of usage in 'man git'\n>\n> The .git directory is allowed to be a symlink.  Or a file like so\n>\n>        gitdir: /path/to/git/repo\n>\n> for symlink-challenged operating systems.  See gitrepository-layout(7)\n> for details.\n>\n> Cheers,\n> Jonathan\n>\n"},{"id":"160452","messageId":"20110205180425.GA18961@elie","threadId":"26414","inReplyTo":"AANLkTinYMuXSvKjgtpSCbJPuo=PHDGR_OgOkwtV4Azmz@mail.gmail.com","subject":"Re: [idea] separate .git dir and the working tree","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2011-02-05T18:04:25Z","receivedAt":"2011-02-05T18:04:25Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"redstun wrote:\n\n> what I wanted is, I may have multiple git working tree in my $HOME, like:\n> $HOME/proj1\n> $HOME/proj2,\n> \n> I then wanted their .git directories respectively located at\n> /safe/disk/.git_proj1\n> /safe/disk/.git_proj2\n> \n> How can I get this? I tried to read the doc but didn't have much luck.\n\nBy making .git in $HOME/proj1 a symlink to /safe/disk/.git_proj1 and\nmaking $HOME/proj2/.git a symlink to /safe/disk/.git_proj2.\nGIT_DIR should be left unset for this to work.\n\nThe GIT_DIR variable is for more complicated use cases in which you\ndo not want a .git directory, file, or symlink in the worktree at all.\n\nOne uses it as follows:\n\n\tGIT_DIR=/somewhere/else/.git git <command> ...\n\nThe top level of the work tree is inferred to be the current working\ndirectory and git metadata is taken from somewhere else.\n\nSometimes a person does not only want to work in the top level of the\nworking tree.  To tell git where the top level is, use the\nGIT_WORK_TREE variable:\n\n\t(\n\t\tGIT_DIR=/somewhere/else/.git; export GIT_DIR\n\t\tGIT_WORK_TREE=$(pwd); export GIT_WORK_TREE\n\n\t\tcd sub/directory\n\t\tgit <command>...\n\n\t\tcd ../other/directory\n\t\tgit <other command>...\n\t)\n\nThese are not variables for your .profile, since as you mentioned, a\nperson typically will work with one git repo and worktree sometimes,\nanother git repo and work tree another time.\n\nHope that helps,\nJonathan\n\nSide note: I don't think you mentioned wanting it, but for reference,\nthere is a nice tool for sharing objects between multiple worktrees in\ncontrib/worktree.  It comes with some sharp edges, as described in [1].\n\n[1] http://thread.gmane.org/gmane.comp.version-control.git/150559\n"},{"id":"160480","messageId":"20110206002009.GA13594@mg1","threadId":"26414","inReplyTo":"20110205132708.GA18391@elie","subject":"Re: [idea] separate .git dir and the working tree","fromName":"Mike Gant","fromEmail":"mike@gantsfort.com","sentAt":"2011-02-06T00:20:09Z","receivedAt":"2011-02-06T00:20:09Z","isPatch":false,"sender":{"key":"mike@gantsfort.com","avatar":null},"body":"On Sat, Feb 05, 2011 at 07:27:08AM -0600, Jonathan Nieder wrote:\n> (restoring cc list; please do not cull cc's)\n\nMy apologies, but I didn't see a cc list in the original. Please\nexplain.\n\n-Mike\n"},{"id":"160484","messageId":"20110206004013.GB13594@mg1","threadId":"26414","inReplyTo":"20110206002009.GA13594@mg1","subject":"Re: [idea] separate .git dir and the working tree","fromName":"Mike Gant","fromEmail":"mike@gantsfort.com","sentAt":"2011-02-06T00:40:13Z","receivedAt":"2011-02-06T00:40:13Z","isPatch":false,"sender":{"key":"mike@gantsfort.com","avatar":null},"body":"On Sat, Feb 05, 2011 at 05:20:09PM -0700, Mike Gant wrote:\n> On Sat, Feb 05, 2011 at 07:27:08AM -0600, Jonathan Nieder wrote:\n> > (restoring cc list; please do not cull cc's)\n> \n> My apologies, but I didn't see a cc list in the original. Please\n> explain.\n> \n> -Mike\n\nNever mind, I think I understand.\n\nSo does anyone use Mutt? And do they know a recipe to move the sender\naddress to the cc list? If not, I'll figure it out.\n\nThanks,\n-Mike\n"},{"id":"160486","messageId":"1296954015.4048.0.camel@localhost.localdomain","threadId":"26414","inReplyTo":"20110206004013.GB13594@mg1","subject":"Re: [idea] separate .git dir and the working tree","fromName":"Jared Hance","fromEmail":"jaredhance@gmail.com","sentAt":"2011-02-06T01:00:15Z","receivedAt":"2011-02-06T01:00:15Z","isPatch":false,"sender":{"key":"jaredhance@gmail.com","avatar":"https://avatars.githubusercontent.com/u/170192?v=4"},"body":"On Sat, 2011-02-05 at 17:40 -0700, Mike Gant wrote:\n> On Sat, Feb 05, 2011 at 05:20:09PM -0700, Mike Gant wrote:\n> > On Sat, Feb 05, 2011 at 07:27:08AM -0600, Jonathan Nieder wrote:\n> > > (restoring cc list; please do not cull cc's)\n> > \n> > My apologies, but I didn't see a cc list in the original. Please\n> > explain.\n> > \n> > -Mike\n> \n> Never mind, I think I understand.\n> \n> So does anyone use Mutt? And do they know a recipe to move the sender\n> address to the cc list? If not, I'll figure it out.\n> \n> Thanks,\n> -Mike\n> --\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n\nWhen I used Mutt, if I remember correctly, L did the job (list reply).\n"},{"id":"160489","messageId":"20110206104952.GD20056@localhost.localdomain","threadId":"26414","inReplyTo":"1296954015.4048.0.camel@localhost.localdomain","subject":"Re: [idea] separate .git dir and the working tree","fromName":"Konstantin Khomoutov","fromEmail":"flatworm@users.sourceforge.net","sentAt":"2011-02-06T10:49:53Z","receivedAt":"2011-02-06T10:49:53Z","isPatch":false,"sender":{"key":"flatworm@users.sourceforge.net","avatar":null},"body":"On Sat, Feb 05, 2011 at 08:00:15PM -0500, Jared Hance wrote:\n\n> > > My apologies, but I didn't see a cc list in the original. Please\n> > > explain.\n> > Never mind, I think I understand.\n> > So does anyone use Mutt? And do they know a recipe to move the sender\n> > address to the cc list? If not, I'll figure it out.\n> When I used Mutt, if I remember correctly, L did the job (list reply).\nAlso \"g\" is \"group reply\" -- it simply replies to all e-mails mentioned\nin the mail which is being replied to.\n"},{"id":"160490","messageId":"20110206105510.GA14195@vidovic","threadId":"26414","inReplyTo":"20110206004013.GB13594@mg1","subject":"[idea] Re: separate .git dir and the working tree","fromName":"Nicolas Sebrecht","fromEmail":"nicolas.s.dev@gmx.fr","sentAt":"2011-02-06T10:55:10Z","receivedAt":"2011-02-06T10:55:10Z","isPatch":false,"sender":{"key":"nicolas.s.dev@gmx.fr","avatar":null},"body":"The 05/02/11, Mike Gant wrote:\n\n> So does anyone use Mutt? And do they know a recipe to move the sender\n> address to the cc list? If not, I'll figure it out.\n\ng (group answer).\n\n-- \nNicolas Sebrecht\n"},{"id":"160575","messageId":"20110207045757.GC13594@mg1","threadId":"26414","inReplyTo":"20110206105510.GA14195@vidovic","subject":"Re: [idea] Re: separate .git dir and the working tree","fromName":"Mike Gant","fromEmail":"mike@gantsfort.com","sentAt":"2011-02-07T04:57:57Z","receivedAt":"2011-02-07T04:57:57Z","isPatch":false,"sender":{"key":"mike@gantsfort.com","avatar":null},"body":"On Sun, Feb 06, 2011 at 11:55:10AM +0100, Nicolas Sebrecht wrote:\n> The 05/02/11, Mike Gant wrote:\n> \n> > So does anyone use Mutt? And do they know a recipe to move the sender\n> > address to the cc list? If not, I'll figure it out.\n> \n> g (group answer).\n> \n\nThanks. I knew about L (list reply) and g (group reply). L only replies\nto the list address, git@vger.kernel.org, in this case. Certainly, g is\nthe closest behavior as long as it is acceptable to have the sender name\nin the To: header along with the list address (as in this response).\n\nOn the other hand, if it is only acceptable to have the list address in\nthe To: header and all others in the cc list then I don't know of any\ncommand to do that.\n\n-Mike\n"},{"id":"168502","messageId":"BANLkTinL_y8oAW2kQdyP-+CmdmrRWOrEsA@mail.gmail.com","threadId":"26414","inReplyTo":"20110206004013.GB13594@mg1","subject":"Re: [idea] separate .git dir and the working tree","fromName":"Michael Witten","fromEmail":"mfwitten@gmail.com","sentAt":"2011-05-23T14:40:57Z","receivedAt":"2011-05-23T14:40:57Z","isPatch":false,"sender":{"key":"mfwitten@gmail.com","avatar":"https://avatars.githubusercontent.com/u/597101?v=4"},"body":"On Sun, Feb 6, 2011 at 00:40, Mike Gant <mike@gantsfort.com> wrote:\n> So does anyone use Mutt? And do they know a recipe to move the sender\n> address to the cc list? If not, I'll figure it out.\n\nYour `To:' header should list the sender (usually what's listed in the\n`From:' header); the `Cc:' header should list everything else\n(including the mailing list(s) in question).\n"}]}