{"thread":{"id":"11145","subject":"Put part of working tree on another file-system.","startedAt":"2007-12-05T13:44:39Z","lastAt":"2007-12-05T17:07:13Z","messageCount":3,"participants":["Sergei Organov","Rogan Dawes"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"62013","messageId":"87mysp8ddk.fsf@osv.gnss.ru","threadId":"11145","inReplyTo":null,"subject":"Put part of working tree on another file-system.","fromName":"Sergei Organov","fromEmail":"osv@javad.com","sentAt":"2007-12-05T13:44:39Z","receivedAt":"2007-12-05T13:44:39Z","isPatch":false,"sender":{"key":"osv@javad.com","avatar":null},"body":"Hello,\n\nI've a desire to put a sub-tree of my working tree into another\nfile-system. With CVS I've used symlink to achieve this. It works fine\nwith CVS as it doesn't care about directories and symlinks at all. I had\nlittle hope it will work with GIT, but I've performed a test anyway. To\nmy surprise it almost worked, so I have a hope that maybe it's not that\ndifficult to support this. What do you think? Or maybe there is a\ndifferent way to achieve the goal with GIT?\n\nThe test has been performed in a clone of the git tree (my comments are\nprefixed by \"osv>\"):\n\n$ git status\n# On branch master\nnothing to commit (working directory clean)\n$ mv gitweb ../ && ln -s ../gitweb .\n$ git status\n# On branch master\n# Untracked files:\n#   (use \"git add <file>...\" to include in what will be committed)\n#\n#       gitweb\nnothing added to commit but untracked files present (use \"git add\" to track)\n\nosv> here GIT is slightly confused by the change of a directory to a\nosv> symlink to a directory.\n\n$ echo hehe >> gitweb/INSTALL\n$ git status\n# On branch master\n# Changed but not updated:\n#   (use \"git add <file>...\" to update what will be committed)\n#\n#       modified:   gitweb/INSTALL\n#\n# Untracked files:\n#   (use \"git add <file>...\" to include in what will be committed)\n#\n#       gitweb\nno changes added to commit (use \"git add\" and/or \"git commit -a\")\n\nosv> here confusion is more obvious as GIT reports modified file in an\nosv> untracked directory.\n\n$ git commit -a\n\nCreated commit 7470207: The commit\n 1 files changed, 1 insertions(+), 0 deletions(-)\n$ git status\n# On branch master\n# Untracked files:\n#   (use \"git add <file>...\" to include in what will be committed)\n#\n#       gitweb\nnothing added to commit but untracked files present (use \"git add\" to track)\n\nosv> surprisingly nothing very bad happened, -- GIT has commited the\nosv> modified file just fine, and left the symlink unchanged.\n \n$ git reset --hard HEAD^\nHEAD is now at 7a4a2e1... Set OLD_ICONV on Cygwin.\n[osv@fulcrum git]$ git status\n# On branch master\n# Changed but not updated:\n#   (use \"git add/rm <file>...\" to update what will be committed)\n#\n#       deleted:    gitweb/README\n#       deleted:    gitweb/git-favicon.png\n#       deleted:    gitweb/git-logo.png\n#       deleted:    gitweb/gitweb.css\n#       deleted:    gitweb/gitweb.perl\n#       deleted:    gitweb/test/Märchen\n#       deleted:    gitweb/test/file with spaces\n#       deleted:    gitweb/test/file+plus+sign\n#\nno changes added to commit (use \"git add\" and/or \"git commit -a\")\n\nosv> Ooops, -- now things begin to be more seriously broken. The result\nosv> is that GIT removed the symlink, created gitweb directory, and put\nosv> only INSTALL file into it. The directory the symlink was pointing\nosv> to has the rest of files but INSTALL.\n\n$ git reset --hard HEAD\nHEAD is now at 7a4a2e1... Set OLD_ICONV on Cygwin.\n$ git status\n# On branch master\nnothing to commit (working directory clean)\n\nosv> This is now as expected, -- GIT just re-populated the gitweb\nosv> directory as there is no symlink anymore.\n\n-- \nSergei.\n"},{"id":"62021","messageId":"4756C51C.8080608@dawes.za.net","threadId":"11145","inReplyTo":"87mysp8ddk.fsf@osv.gnss.ru","subject":"Re: Put part of working tree on another file-system.","fromName":"Rogan Dawes","fromEmail":"lists@dawes.za.net","sentAt":"2007-12-05T15:34:52Z","receivedAt":"2007-12-05T15:34:52Z","isPatch":false,"sender":{"key":"lists@dawes.za.net","avatar":null},"body":"Sergei Organov wrote:\n> Hello,\n> \n> I've a desire to put a sub-tree of my working tree into another\n> file-system. With CVS I've used symlink to achieve this. It works fine\n> with CVS as it doesn't care about directories and symlinks at all. I had\n> little hope it will work with GIT, but I've performed a test anyway. To\n> my surprise it almost worked, so I have a hope that maybe it's not that\n> difficult to support this. What do you think? Or maybe there is a\n> different way to achieve the goal with GIT?\n> \n\nI needed to do this in Cygwin, and saw the same behaviour. I worked \naround it by using cygwin's \"mount\" command to \"mount\" the other \ndirectory in Cygwin's namespace. With this done, cygwin does not detect \na symlink (since there is none), and works as expected.\n\nWith sufficient permissions, you can probably achieve the same effect \nwith bind mounts perhaps (assuming Linux, of course).\n\nRogan\n"},{"id":"62030","messageId":"87ir3d83zy.fsf@osv.gnss.ru","threadId":"11145","inReplyTo":"4756C51C.8080608@dawes.za.net","subject":"Re: Put part of working tree on another file-system.","fromName":"Sergei Organov","fromEmail":"osv@javad.com","sentAt":"2007-12-05T17:07:13Z","receivedAt":"2007-12-05T17:07:13Z","isPatch":false,"sender":{"key":"osv@javad.com","avatar":null},"body":"Rogan Dawes <lists@dawes.za.net> writes:\n\n> Sergei Organov wrote:\n>> Hello,\n>>\n>> I've a desire to put a sub-tree of my working tree into another\n>> file-system. With CVS I've used symlink to achieve this. It works fine\n>> with CVS as it doesn't care about directories and symlinks at all. I had\n>> little hope it will work with GIT, but I've performed a test anyway. To\n>> my surprise it almost worked, so I have a hope that maybe it's not that\n>> difficult to support this. What do you think? Or maybe there is a\n>> different way to achieve the goal with GIT?\n>>\n>\n> I needed to do this in Cygwin, and saw the same behaviour. I worked\n> around it by using cygwin's \"mount\" command to \"mount\" the other\n> directory in Cygwin's namespace. With this done, cygwin does not\n> detect a symlink (since there is none), and works as expected.\n>\n> With sufficient permissions, you can probably achieve the same effect\n> with bind mounts perhaps (assuming Linux, of course).\n\nThanks for the idea, -- it seems to work.\n\n[In fact it is Linux, and those \"another file-system\" is FAT32 partition,\nso that, when rebooting to Windoze, this directory could be accessed from\nthere. I can't put all the working tree there as there are parts of the\ntree that depend on file system being case-sensitive.]\n\n-- \nSergei.\n"}]}