{"thread":{"id":"21489","subject":"git pull -s subtree doesn't work properly","startedAt":"2009-11-05T18:09:05Z","lastAt":"2010-01-01T00:05:42Z","messageCount":4,"participants":["Oliver Kullmann","Nanako Shiraishi"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"126910","messageId":"20091105180905.GP17628@cs-wsok.swansea.ac.uk","threadId":"21489","inReplyTo":null,"subject":"git pull -s subtree doesn't work properly","fromName":"Oliver Kullmann","fromEmail":"o.kullmann@swansea.ac.uk","sentAt":"2009-11-05T18:09:05Z","receivedAt":"2009-11-05T18:09:05Z","isPatch":false,"sender":{"key":"o.kullmann@swansea.ac.uk","avatar":null},"body":"Hello,\n\nusing\n\nIntroductionJava> git remote add -f CSM41 /home/kullmann/csoliver/UofT/Java0910/ProgrammingJava/CS-M41_Programs\nIntroductionJava> git merge -s ours --no-commit CSM41/master\nIntroductionJava> git read-tree --prefix=Artikel/Skripte/IntroductionJava/CS_M41/ -u CSM41/master\nIntroductionJava> git commit -m \"Einfuegen des CS-M41-Projektes als Verzeichnis CS_M41\"\n\nI have imported repository \"CS-M41_Programs\" into another repository. Later then\nI replaced in the config-file the old url /home/kullmann/csoliver/UofT/Java0910/ProgrammingJava/CS-M41_Programs\nby the new one\n\n[remote \"CSM41\"]\n\turl = git://github.com/OKullmann/CS-M41-Programming-in-Java.git\n\tfetch = +refs/heads/*:refs/remotes/CSM41/*\n\nBut now\n\nIntroductionJava> git pull -s subtree CSM41 master\n\ndoesn't work anymore: In the CSM41 repository just one file index.html was changed,\nand apparently the merge strategy recognises that the other files haven't\nbeen changed, while index.html is placed just as if the relative path would\nstart from the root of the repository.\n\nIntroductionJava> git pull -s subtree CSM41 master\nremote: Counting objects: 7, done.\nremote: Compressing objects: 100% (3/3), done.\nremote: Total 4 (delta 1), reused 0 (delta 0)\nUnpacking objects: 100% (4/4), done.\nFrom git://github.com/OKullmann/CS-M41-Programming-in-Java\n * branch            master     -> FETCH_HEAD\nCONFLICT (delete/modify): Artikel/LaTeX/SystemStile/Html/index.html deleted in HEAD a\nnd modified in 38b11a96fa009a5b2c24cfc94c0268ab9ca7ce39. Version 38b11a96fa009a5b2c24\ncfc94c0268ab9ca7ce39 of Artikel/LaTeX/SystemStile/Html/index.html left in tree.\nAutomatic merge failed; fix conflicts and then commit the result.\n\nIntroductionJava> git status\n# On branch master\n# Unmerged paths:\n#   (use \"git reset HEAD <file>...\" to unstage)\n#   (use \"git add <file>...\" to mark resolution)\n#\n#       deleted by us:      ../../LaTeX/SystemStile/Html/index.html\n#\nno changes added to commit (use \"git add\" and/or \"git commit -a\")\n\nThe path of index.html is Artikel/Skripte/IntroductionJava/CS_M41/Html/index.html.\nWhy git thinks that index.html should be placed into another directory Artikel/LaTeX/SystemStile/Html/\nI have no clue (this directory doesn't exist).\n\nIs it possible to tell \"git pull\" where the subtree really is, or is that\nnot really the cause of the problem?\n\nThanks for your consideration!\n\nOliver\n"},{"id":"130624","messageId":"20091231193800.GB19537@cs-wsok.swansea.ac.uk","threadId":"21489","inReplyTo":"20091105180905.GP17628@cs-wsok.swansea.ac.uk","subject":"Re: git pull -s subtree doesn't work properly","fromName":"Oliver Kullmann","fromEmail":"o.kullmann@swansea.ac.uk","sentAt":"2009-12-31T19:38:00Z","receivedAt":"2009-12-31T19:38:00Z","isPatch":false,"sender":{"key":"o.kullmann@swansea.ac.uk","avatar":null},"body":"Hello,\n\nit seems no reply yet (if I understand that web-email-interface\nproperly); has nobody any idea here, or is it a Git bug,\nor my fault?\n\nTo me it seems all pretty normal, so I would be glad to get\nsome reaction.\n\nThe situation didn't improve: It seems \"subtree\" is completely broken ---\nit has no idea that the files to be pulled are to be placed in\na subtree. (The pull via \"git pull -s subtree CSM41 master\" actually\nalso manages to ignore the ignore-patterns; don't know how this\ncould happen.)\n\nSo shouldn't one use this option?\nOr how can I restart?\n\nI would also need in other situations the ability of Git to have one independent repository (say,\nat Github), which is also included in some other bigger repository (where it is\nnot changed, only included) --- how to do so if the \"subtree\"-mechanism doesn't work?\n\nHope for some help.\n\nOliver\n\n\n\nOn Thu, Nov 05, 2009 at 06:09:05PM +0000, Oliver Kullmann wrote:\n> Hello,\n> \n> using\n> \n> IntroductionJava> git remote add -f CSM41 /home/kullmann/csoliver/UofT/Java0910/ProgrammingJava/CS-M41_Programs\n> IntroductionJava> git merge -s ours --no-commit CSM41/master\n> IntroductionJava> git read-tree --prefix=Artikel/Skripte/IntroductionJava/CS_M41/ -u CSM41/master\n> IntroductionJava> git commit -m \"Einfuegen des CS-M41-Projektes als Verzeichnis CS_M41\"\n> \n> I have imported repository \"CS-M41_Programs\" into another repository. Later then\n> I replaced in the config-file the old url /home/kullmann/csoliver/UofT/Java0910/ProgrammingJava/CS-M41_Programs\n> by the new one\n> \n> [remote \"CSM41\"]\n> \turl = git://github.com/OKullmann/CS-M41-Programming-in-Java.git\n> \tfetch = +refs/heads/*:refs/remotes/CSM41/*\n> \n> But now\n> \n> IntroductionJava> git pull -s subtree CSM41 master\n> \n> doesn't work anymore: In the CSM41 repository just one file index.html was changed,\n> and apparently the merge strategy recognises that the other files haven't\n> been changed, while index.html is placed just as if the relative path would\n> start from the root of the repository.\n> \n> IntroductionJava> git pull -s subtree CSM41 master\n> remote: Counting objects: 7, done.\n> remote: Compressing objects: 100% (3/3), done.\n> remote: Total 4 (delta 1), reused 0 (delta 0)\n> Unpacking objects: 100% (4/4), done.\n> >From git://github.com/OKullmann/CS-M41-Programming-in-Java\n>  * branch            master     -> FETCH_HEAD\n> CONFLICT (delete/modify): Artikel/LaTeX/SystemStile/Html/index.html deleted in HEAD a\n> nd modified in 38b11a96fa009a5b2c24cfc94c0268ab9ca7ce39. Version 38b11a96fa009a5b2c24\n> cfc94c0268ab9ca7ce39 of Artikel/LaTeX/SystemStile/Html/index.html left in tree.\n> Automatic merge failed; fix conflicts and then commit the result.\n> \n> IntroductionJava> git status\n> # On branch master\n> # Unmerged paths:\n> #   (use \"git reset HEAD <file>...\" to unstage)\n> #   (use \"git add <file>...\" to mark resolution)\n> #\n> #       deleted by us:      ../../LaTeX/SystemStile/Html/index.html\n> #\n> no changes added to commit (use \"git add\" and/or \"git commit -a\")\n> \n> The path of index.html is Artikel/Skripte/IntroductionJava/CS_M41/Html/index.html.\n> Why git thinks that index.html should be placed into another directory Artikel/LaTeX/SystemStile/Html/\n> I have no clue (this directory doesn't exist).\n> \n> Is it possible to tell \"git pull\" where the subtree really is, or is that\n> not really the cause of the problem?\n> \n> Thanks for your consideration!\n> \n> Oliver\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":"130630","messageId":"20091231203708.GA4158@cs-wsok.swansea.ac.uk","threadId":"21489","inReplyTo":"20091231193800.GB19537@cs-wsok.swansea.ac.uk","subject":"Re: git pull -s subtree doesn't work properly","fromName":"Oliver Kullmann","fromEmail":"o.kullmann@swansea.ac.uk","sentAt":"2009-12-31T20:37:08Z","receivedAt":"2009-12-31T20:37:08Z","isPatch":false,"sender":{"key":"o.kullmann@swansea.ac.uk","avatar":null},"body":"Just adding a bit more information about the apparently\nwrong behaviour of \"-s subtree\":\n\nThe question is what is the \"subtree\"??? Apparently git just\nlooks for the first matching file it finds (!) --- now there is in repository B\na file index.html, and there is index.html in A (while B is to be\nmerged into A), and thus git apparently deduces that must be\nthe \"subtree\". If this is not a bug ...\n\nDoes the repository name belong to what specifies a \"subtree\"?\nAs one can see below, the repository name has been changed.\nFor example when creating a repository a Github, then the name\nof the repository is not really under control, and also how\nGit treats repositories, it seems that the name of the repository\ndoesn't matter.\n\nIn this case we have in A the directory \"CS_M41\", while in B it was \n\"CS_M41_Programs\"; then later in Github the name of B was further\nchanged to \"CS-M41-Programming-in-Java\". Is this an issue (should it be)?\n\nOliver\n\nP.S. Would renaming CS_M41 in A to CS-M41-Programming-in-Java changed something?\nOr would it make things worse?\nI tried it, and it doesn't make any change.\n\n\nOn Thu, Dec 31, 2009 at 07:38:00PM +0000, Oliver Kullmann wrote:\n> Hello,\n> \n> it seems no reply yet (if I understand that web-email-interface\n> properly); has nobody any idea here, or is it a Git bug,\n> or my fault?\n> \n> To me it seems all pretty normal, so I would be glad to get\n> some reaction.\n> \n> The situation didn't improve: It seems \"subtree\" is completely broken ---\n> it has no idea that the files to be pulled are to be placed in\n> a subtree. (The pull via \"git pull -s subtree CSM41 master\" actually\n> also manages to ignore the ignore-patterns; don't know how this\n> could happen.)\n> \n> So shouldn't one use this option?\n> Or how can I restart?\n> \n> I would also need in other situations the ability of Git to have one independent repository (say,\n> at Github), which is also included in some other bigger repository (where it is\n> not changed, only included) --- how to do so if the \"subtree\"-mechanism doesn't work?\n> \n> Hope for some help.\n> \n> Oliver\n> \n> \n> \n> On Thu, Nov 05, 2009 at 06:09:05PM +0000, Oliver Kullmann wrote:\n> > Hello,\n> > \n> > using\n> > \n> > IntroductionJava> git remote add -f CSM41 /home/kullmann/csoliver/UofT/Java0910/ProgrammingJava/CS-M41_Programs\n> > IntroductionJava> git merge -s ours --no-commit CSM41/master\n> > IntroductionJava> git read-tree --prefix=Artikel/Skripte/IntroductionJava/CS_M41/ -u CSM41/master\n> > IntroductionJava> git commit -m \"Einfuegen des CS-M41-Projektes als Verzeichnis CS_M41\"\n> > \n> > I have imported repository \"CS-M41_Programs\" into another repository. Later then\n> > I replaced in the config-file the old url /home/kullmann/csoliver/UofT/Java0910/ProgrammingJava/CS-M41_Programs\n> > by the new one\n> > \n> > [remote \"CSM41\"]\n> > \turl = git://github.com/OKullmann/CS-M41-Programming-in-Java.git\n> > \tfetch = +refs/heads/*:refs/remotes/CSM41/*\n> > \n> > But now\n> > \n> > IntroductionJava> git pull -s subtree CSM41 master\n> > \n> > doesn't work anymore: In the CSM41 repository just one file index.html was changed,\n> > and apparently the merge strategy recognises that the other files haven't\n> > been changed, while index.html is placed just as if the relative path would\n> > start from the root of the repository.\n> > \n> > IntroductionJava> git pull -s subtree CSM41 master\n> > remote: Counting objects: 7, done.\n> > remote: Compressing objects: 100% (3/3), done.\n> > remote: Total 4 (delta 1), reused 0 (delta 0)\n> > Unpacking objects: 100% (4/4), done.\n> > >From git://github.com/OKullmann/CS-M41-Programming-in-Java\n> >  * branch            master     -> FETCH_HEAD\n> > CONFLICT (delete/modify): Artikel/LaTeX/SystemStile/Html/index.html deleted in HEAD a\n> > nd modified in 38b11a96fa009a5b2c24cfc94c0268ab9ca7ce39. Version 38b11a96fa009a5b2c24\n> > cfc94c0268ab9ca7ce39 of Artikel/LaTeX/SystemStile/Html/index.html left in tree.\n> > Automatic merge failed; fix conflicts and then commit the result.\n> > \n> > IntroductionJava> git status\n> > # On branch master\n> > # Unmerged paths:\n> > #   (use \"git reset HEAD <file>...\" to unstage)\n> > #   (use \"git add <file>...\" to mark resolution)\n> > #\n> > #       deleted by us:      ../../LaTeX/SystemStile/Html/index.html\n> > #\n> > no changes added to commit (use \"git add\" and/or \"git commit -a\")\n> > \n> > The path of index.html is Artikel/Skripte/IntroductionJava/CS_M41/Html/index.html.\n> > Why git thinks that index.html should be placed into another directory Artikel/LaTeX/SystemStile/Html/\n> > I have no clue (this directory doesn't exist).\n> > \n> > Is it possible to tell \"git pull\" where the subtree really is, or is that\n> > not really the cause of the problem?\n> > \n> > Thanks for your consideration!\n> > \n> > Oliver\n> > \n"},{"id":"130642","messageId":"20100101090542.6117@nanako3.lavabit.com","threadId":"21489","inReplyTo":"20091231193800.GB19537@cs-wsok.swansea.ac.uk","subject":"Re: git pull -s subtree doesn't work properly","fromName":"Nanako Shiraishi","fromEmail":"nanako3@lavabit.com","sentAt":"2010-01-01T00:05:42Z","receivedAt":"2010-01-01T00:05:42Z","isPatch":false,"sender":{"key":"nanako3@lavabit.com","avatar":"https://gravatar.com/avatar/3777b9e201c5883a62b1a6fdf7c53f2d712d1d80989146063ea861e33aad72a8?d=mp&s=160"},"body":"Quoting Oliver Kullmann <O.Kullmann@swansea.ac.uk>\n\n> it seems no reply yet (if I understand that web-email-interface\n> properly); has nobody any idea here, or is it a Git bug,\n> or my fault?\n\nBecause you don't specify where in your current directory hierarchy the root level of the tree you are merging goes when you run \"git merge -s subtree\", the merge mechanism has to find the most similar directory by itself, and if you have more than one similar directories, it can't guess correctly.\n\nIt sounds similar to\n\n  http://thread.gmane.org/gmane.comp.version-control.git/135009/focus=135033\n\n-- \nNanako Shiraishi\nhttp://ivory.ap.teacup.com/nanako3/\n"}]}