{"thread":{"id":"26767","subject":"same files on different paths on different branches","startedAt":"2011-03-18T00:06:12Z","lastAt":"2011-03-18T13:12:37Z","messageCount":3,"participants":["Raul Dias","Carlos Martín Nieto"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"163603","messageId":"4D82A1F4.4060801@dias.com.br","threadId":"26767","inReplyTo":null,"subject":"same files on different paths on different branches","fromName":"Raul Dias","fromEmail":"raul@dias.com.br","sentAt":"2011-03-18T00:06:12Z","receivedAt":"2011-03-18T00:06:12Z","isPatch":false,"sender":{"key":"raul@dias.com.br","avatar":null},"body":"Hi,\n\nI want to know if the following is possible to accomplish with git.\n(please reply to me too)\n\nA project is composed of many sub-modules (not in git sense).\nThese sub-modules are developed independently of the main project.\nThey need to be reattached to the projects' tree.\n\nThe problems:\n    1 - a sub-module's tree does not have any projects file.\n    2 - when a sub-module is re-attached to the main project, its files\nare spread in many places (different from the the sub-module layout).\n\n\nIdeally the project would understand which files are the same, even on\ndifferent places and apply the changes in the right files.\nThis way a merge/cherry picking would keep the history information.\n\nIs it possible to accomplish something similar to this?\nI understand that this is not how a git super-project works.\nI don't think it is possible with different git repositories.\n\nI tried with a empty branch technique. \nCreated an empty branch with no history.\nStarted a sub-module (non git) there and tried to propagate the changes.\nGit almost did the right thing.\nA change in branch submodule's\n    /foo/a.txt\nshould have gone to branch master's\n    /bar/foo/a.txt\nbut instead it went to\n    /bar/somethingelse/a.txt (which is the same as /bar/foo/a.txt)\n\n\nSo is it possible to get closer to this with git  in a way or another?\n\n\nThanks\n-rsd\n"},{"id":"163621","messageId":"1300440036.4261.29.camel@bee.lab.cmartin.tk","threadId":"26767","inReplyTo":"4D82A1F4.4060801@dias.com.br","subject":"Re: same files on different paths on different branches","fromName":"Carlos Martín Nieto","fromEmail":"cmn@elego.de","sentAt":"2011-03-18T09:20:33Z","receivedAt":"2011-03-18T09:20:33Z","isPatch":false,"sender":{"key":"cmn@elego.de","avatar":"https://avatars.githubusercontent.com/u/335443?v=4"},"body":"On jue, 2011-03-17 at 21:06 -0300, Raul Dias wrote:\n> Hi,\n> \n> I want to know if the following is possible to accomplish with git.\n> (please reply to me too)\n> \n> A project is composed of many sub-modules (not in git sense).\n> These sub-modules are developed independently of the main project.\n> They need to be reattached to the projects' tree.\n> \n> The problems:\n>     1 - a sub-module's tree does not have any projects file.\n>     2 - when a sub-module is re-attached to the main project, its files\n> are spread in many places (different from the the sub-module layout).\n> \n> \n> Ideally the project would understand which files are the same, even on\n> different places and apply the changes in the right files.\n> This way a merge/cherry picking would keep the history information.\n> \n> Is it possible to accomplish something similar to this?\n> I understand that this is not how a git super-project works.\n> I don't think it is possible with different git repositories.\n> \n> I tried with a empty branch technique. \n> Created an empty branch with no history.\n> Started a sub-module (non git) there and tried to propagate the changes.\n> Git almost did the right thing.\n> A change in branch submodule's\n>     /foo/a.txt\n> should have gone to branch master's\n>     /bar/foo/a.txt\n> but instead it went to\n>     /bar/somethingelse/a.txt (which is the same as /bar/foo/a.txt)\n\n If the problem you are seeing here is that git reports the physical\npath instead of the logical one (compare `pwd -P` and `pwd -l`), then it\nshouldn't really represent a problem, as the data is being written in\nthe right places.\n\n> So is it possible to get closer to this with git  in a way or another?\n\n git uses almost exclusively physical paths internally, which is why the\nuser sees them. For example, this also happens:\n\n   carlos@bee:~/apps$ mkdir one\n   carlos@bee:~/apps$ ln -s one two\n   carlos@bee:~/apps$ ln -s two three\n   carlos@bee:~/apps$ cd three\n   carlos@bee:~/apps/three$ git init\n   Initialized empty Git repository in /home/carlos/apps/one/.git/\n\n Notice how git is reporting the \"right\" path.\n\n Is this the effect you're seeing? Above it's not clear whether you're\nusing symlinks in your file system or why /bar/somethingelse/a.txt is\nthe same as /foo/a.txt.\n\n   cmn\n"},{"id":"163631","messageId":"4D835A45.4070902@dias.com.br","threadId":"26767","inReplyTo":"1300440036.4261.29.camel@bee.lab.cmartin.tk","subject":"Re: same files on different paths on different branches","fromName":"Raul Dias","fromEmail":"raul@dias.com.br","sentAt":"2011-03-18T13:12:37Z","receivedAt":"2011-03-18T13:12:37Z","isPatch":false,"sender":{"key":"raul@dias.com.br","avatar":null},"body":"On 03/18/2011 06:20 AM, Carlos Martín Nieto wrote:\n> On jue, 2011-03-17 at 21:06 -0300, Raul Dias wrote:\n>> Hi,\n>>\n>> I want to know if the following is possible to accomplish with git.\n>> (please reply to me too)\n>>\n>> A project is composed of many sub-modules (not in git sense).\n>> These sub-modules are developed independently of the main project.\n>> They need to be reattached to the projects' tree.\n>>\n>> The problems:\n>>     1 - a sub-module's tree does not have any projects file.\n>>     2 - when a sub-module is re-attached to the main project, its files\n>> are spread in many places (different from the the sub-module layout).\n>>\n>>\n>> Ideally the project would understand which files are the same, even on\n>> different places and apply the changes in the right files.\n>> This way a merge/cherry picking would keep the history information.\n>>\n>> Is it possible to accomplish something similar to this?\n>> I understand that this is not how a git super-project works.\n>> I don't think it is possible with different git repositories.\n>>\n>> I tried with a empty branch technique. \n>> Created an empty branch with no history.\n>> Started a sub-module (non git) there and tried to propagate the changes.\n>> Git almost did the right thing.\n>> A change in branch submodule's\n>>     /foo/a.txt\n>> should have gone to branch master's\n>>     /bar/foo/a.txt\n>> but instead it went to\n>>     /bar/somethingelse/a.txt (which is the same as /bar/foo/a.txt)\n>  If the problem you are seeing here is that git reports the physical\n> path instead of the logical one (compare `pwd -P` and `pwd -l`), then it\n> shouldn't really represent a problem, as the data is being written in\n> the right places.\n>\n>> So is it possible to get closer to this with git  in a way or another?\n>  git uses almost exclusively physical paths internally, which is why the\n> user sees them. For example, this also happens:\n>\n>    carlos@bee:~/apps$ mkdir one\n>    carlos@bee:~/apps$ ln -s one two\n>    carlos@bee:~/apps$ ln -s two three\n>    carlos@bee:~/apps$ cd three\n>    carlos@bee:~/apps/three$ git init\n>    Initialized empty Git repository in /home/carlos/apps/one/.git/\n>\n>  Notice how git is reporting the \"right\" path.\n>\n>  Is this the effect you're seeing? Above it's not clear whether you're\n> using symlinks in your file system or why /bar/somethingelse/a.txt is\n> the same as /foo/a.txt.\nNo they are completely different files that happened to have the same\ncontent at that point.\n\n-rsd\n"}]}