{"thread":{"id":"42225","subject":"Submodule's .git file contains absolute path when created using 'git clone --recursive'","startedAt":"2016-05-05T12:51:22Z","lastAt":"2016-07-12T16:46:36Z","messageCount":7,"participants":["Loet Avramson","Junio C Hamano","Stefan Beller","Ricardo Sánchez-Sáez"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"285569","messageId":"loom.20160505T140253-275@post.gmane.org","threadId":"42225","inReplyTo":null,"subject":"Submodule's .git file contains absolute path when created using 'git clone --recursive'","fromName":"Loet Avramson","fromEmail":"loet@forter.com","sentAt":"2016-05-05T12:51:22Z","receivedAt":"2016-05-05T12:51:22Z","isPatch":false,"sender":{"key":"loet@forter.com","avatar":null},"body":"Hi,\n\nAccording to git-clone man page - running 'git clone --recursive' \"...is \nequivalent to running 'git submodule update --init --recursive' immediately \nafter the clone is finished...\", though I found a little difference between \nthe two regarding the submodule's .git file:\n\n1. Running 'git clone' and 'git submodule update --init --recursive' \nseparately will create the .git file in each submodule containing a relative \npath to the superproject's .git directory as expected.\n\n2. Running 'git clone --recursive' will create the .git file containing an \n*absolute* path to the superproject's .git directory. (as it was expected \nusing git versions 1.7.8 - 1.7.10 as far as I understand)\n\nNot sure if that's a bug but it got stuff behaving really weird in a specific \nusecase on one of our environments. It would be highly appreciated to update \nthe docs at least.\n\nThanks.\n\n -Loet\n"},{"id":"285575","messageId":"xmqq1t5gctiv.fsf@gitster.mtv.corp.google.com","threadId":"42225","inReplyTo":"loom.20160505T140253-275@post.gmane.org","subject":"Re: Submodule's .git file contains absolute path when created using 'git clone --recursive'","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-05-05T17:19:04Z","receivedAt":"2016-05-05T17:19:04Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Loet Avramson <loet@forter.com> writes:\n\n> According to git-clone man page - running 'git clone --recursive' \"...is \n> equivalent to running 'git submodule update --init --recursive' immediately \n> after the clone is finished...\", though I found a little difference between \n> the two regarding the submodule's .git file:\n>\n> 1. Running 'git clone' and 'git submodule update --init --recursive' \n> separately will create the .git file in each submodule containing a relative \n> path to the superproject's .git directory as expected.\n>\n> 2. Running 'git clone --recursive' will create the .git file containing an \n> *absolute* path to the superproject's .git directory. (as it was expected \n> using git versions 1.7.8 - 1.7.10 as far as I understand)\n>\n> Not sure if that's a bug but it got stuff behaving really weird in a specific \n> usecase on one of our environments. It would be highly appreciated to update \n> the docs at least.\n\nIf the documentation already says \"equivalent\" and does not say\n\"identical\", I am not sure if there is anything to update.\n\nIn any case, I thought some people are already working to make the\nresult consistently use relative paths (or was it absolute?), so\nthis may soon become a non-issue.\n"},{"id":"285576","messageId":"CAGZ79kYmh9wtzXdThzPTdEZ5SsKznYxze6EvmbaZdGog4yydNA@mail.gmail.com","threadId":"42225","inReplyTo":"loom.20160505T140253-275@post.gmane.org","subject":"Re: Submodule's .git file contains absolute path when created using 'git clone --recursive'","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2016-05-05T17:22:09Z","receivedAt":"2016-05-05T17:22:09Z","isPatch":false,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"On Thu, May 5, 2016 at 5:51 AM, Loet Avramson <loet@forter.com> wrote:\n> Hi,\n>\n> According to git-clone man page - running 'git clone --recursive' \"...is\n> equivalent to running 'git submodule update --init --recursive' immediately\n> after the clone is finished...\", though I found a little difference between\n> the two regarding the submodule's .git file:\n>\n> 1. Running 'git clone' and 'git submodule update --init --recursive'\n> separately will create the .git file in each submodule containing a relative\n> path to the superproject's .git directory as expected.\n>\n> 2. Running 'git clone --recursive' will create the .git file containing an\n> *absolute* path to the superproject's .git directory. (as it was expected\n> using git versions 1.7.8 - 1.7.10 as far as I understand)\n>\n> Not sure if that's a bug but it got stuff behaving really weird in a specific\n> usecase on one of our environments. It would be highly appreciated to update\n> the docs at least.\n\nWhich version of Git are you using?\n\nSee[1] for how clone handles submodules. (It's a call to submodule\nupdate --init --recursive)\n\nThere was a bug with recursive submodules in the 2.7 time frame and\nthat got fixed in [2].\n\nSo could you make sure your version of Git contains these fixes?\n\n\n\n[1] https://kernel.googlesource.com/pub/scm/git/git/+/master/builtin/clone.c#734\n[2] https://kernel.googlesource.com/pub/scm/git/git/+/7307dd898988c79fc687051e783b3cac8488a559\nspecially https://kernel.googlesource.com/pub/scm/git/git/+/f8eaa0ba98b3bd9cb9035eba184a2d9806d30b27\n\n\n\n>\n> Thanks.\n>\n>  -Loet\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":"285586","messageId":"CAK1enhO-2Ne4XVqRNXz+6Jd7uEEHde8-_xzwWzXh=b01bZhj0g@mail.gmail.com","threadId":"42225","inReplyTo":"CAGZ79kYmh9wtzXdThzPTdEZ5SsKznYxze6EvmbaZdGog4yydNA@mail.gmail.com","subject":"Re: Submodule's .git file contains absolute path when created using 'git clone --recursive'","fromName":"Loet Avramson","fromEmail":"loet@forter.com","sentAt":"2016-05-05T19:20:46Z","receivedAt":"2016-05-05T19:20:46Z","isPatch":false,"sender":{"key":"loet@forter.com","avatar":null},"body":"It happened on 2.8.1, also reproducible on 2.8.2.\nHaven't had the time to dive deeper into the code but my guess is that\nrelative_path() returns different results in those 2 cases or maybe\nthe way git-submodule.sh handles it.\n\nOn Thu, May 5, 2016 at 8:22 PM, Stefan Beller <sbeller@google.com> wrote:\n> On Thu, May 5, 2016 at 5:51 AM, Loet Avramson <loet@forter.com> wrote:\n>> Hi,\n>>\n>> According to git-clone man page - running 'git clone --recursive' \"...is\n>> equivalent to running 'git submodule update --init --recursive' immediately\n>> after the clone is finished...\", though I found a little difference between\n>> the two regarding the submodule's .git file:\n>>\n>> 1. Running 'git clone' and 'git submodule update --init --recursive'\n>> separately will create the .git file in each submodule containing a relative\n>> path to the superproject's .git directory as expected.\n>>\n>> 2. Running 'git clone --recursive' will create the .git file containing an\n>> *absolute* path to the superproject's .git directory. (as it was expected\n>> using git versions 1.7.8 - 1.7.10 as far as I understand)\n>>\n>> Not sure if that's a bug but it got stuff behaving really weird in a specific\n>> usecase on one of our environments. It would be highly appreciated to update\n>> the docs at least.\n>\n> Which version of Git are you using?\n>\n> See[1] for how clone handles submodules. (It's a call to submodule\n> update --init --recursive)\n>\n> There was a bug with recursive submodules in the 2.7 time frame and\n> that got fixed in [2].\n>\n> So could you make sure your version of Git contains these fixes?\n>\n>\n>\n> [1] https://kernel.googlesource.com/pub/scm/git/git/+/master/builtin/clone.c#734\n> [2] https://kernel.googlesource.com/pub/scm/git/git/+/7307dd898988c79fc687051e783b3cac8488a559\n> specially https://kernel.googlesource.com/pub/scm/git/git/+/f8eaa0ba98b3bd9cb9035eba184a2d9806d30b27\n>\n>\n>\n>>\n>> Thanks.\n>>\n>>  -Loet\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":"285589","messageId":"CAGZ79kYjw6vzf7rf_-bOiMmm0VtAwO03vpk67QP4u2m_N_Mm4g@mail.gmail.com","threadId":"42225","inReplyTo":"CAK1enhO-2Ne4XVqRNXz+6Jd7uEEHde8-_xzwWzXh=b01bZhj0g@mail.gmail.com","subject":"Re: Submodule's .git file contains absolute path when created using 'git clone --recursive'","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2016-05-05T19:32:28Z","receivedAt":"2016-05-05T19:32:28Z","isPatch":false,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"On Thu, May 5, 2016 at 12:20 PM, Loet Avramson <loet@forter.com> wrote:\n> It happened on 2.8.1, also reproducible on 2.8.2.\n> Haven't had the time to dive deeper into the code but my guess is that\n> relative_path() returns different results in those 2 cases or maybe\n> the way git-submodule.sh handles it.\n>\n\nThen you found a new bug, congratulations. ;)\nThanks for reporting.\n\nThe shell script uses relative_path() only for displaying paths,\nnot for writing them to the .git file.\n\nit really boils down to different environments\n\"git submodule update --init --recursive\" is called from\n(either manually or from `git clone`).\n\nApart from that there are no immediate bells ringing,\nare you doing any weird stuff with the file system (soft/hard\nlinks) ?\n\nThanks,\nStefan\n"},{"id":"291247","messageId":"loom.20160712T131832-33@post.gmane.org","threadId":"42225","inReplyTo":"CAGZ79kYjw6vzf7rf_-bOiMmm0VtAwO03vpk67QP4u2m_N_Mm4g@mail.gmail.com","subject":"Re: Submodule's .git file contains absolute path when created using 'git clone --recursive'","fromName":"Ricardo Sánchez-Sáez","fromEmail":"rsanchez.saez@gmail.com","sentAt":"2016-07-12T11:22:07Z","receivedAt":"2016-07-12T11:25:14Z","isPatch":false,"sender":{"key":"rsanchez.saez@gmail.com","avatar":null},"body":"Stefan Beller <sbeller <at> google.com> writes:\n\n> \n> On Thu, May 5, 2016 at 12:20 PM, Loet Avramson <loet <at> forter.com> wrote:\n> > It happened on 2.8.1, also reproducible on 2.8.2.\n> > Haven't had the time to dive deeper into the code but my guess is that\n> > relative_path() returns different results in those 2 cases or maybe\n> > the way git-submodule.sh handles it.\n> >\n> \n> Then you found a new bug, congratulations. ;)\n> Thanks for reporting.\n> \n> The shell script uses relative_path() only for displaying paths,\n> not for writing them to the .git file.\n> \n> it really boils down to different environments\n> \"git submodule update --init --recursive\" is called from\n> (either manually or from `git clone`).\n> \n> Apart from that there are no immediate bells ringing,\n> are you doing any weird stuff with the file system (soft/hard\n> links) ?\n> \n> Thanks,\n> Stefan\n> \n\nHi,\n\nsorry to awake an old thread. Has this been fixed? In which git version?\nIt's hitting me on git version  2.7.4 (Apple Git-66) (default git client on\n OS X 10.11.5 (15F34)).\n\nI think all submodule .git files should contain relative paths. Otherwise,\n duplicating or moving the cloned  repository folder breaks the submodules.\n\nBest,\nRicardo\n\n"},{"id":"291279","messageId":"CAGZ79ka7wRk3ksf52fHDLccvYJR3DHjnH=CB+8uobe8aKiexvg@mail.gmail.com","threadId":"42225","inReplyTo":"loom.20160712T131832-33@post.gmane.org","subject":"Re: Submodule's .git file contains absolute path when created using 'git clone --recursive'","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2016-07-12T16:46:28Z","receivedAt":"2016-07-12T16:46:36Z","isPatch":false,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"On Tue, Jul 12, 2016 at 4:22 AM, Ricardo Sánchez-Sáez\n<rsanchez.saez@gmail.com> wrote:\n> Stefan Beller <sbeller <at> google.com> writes:\n>\n> Hi,\n>\n> sorry to awake an old thread. Has this been fixed? In which git version?\n> It's hitting me on git version  2.7.4 (Apple Git-66) (default git client on\n>  OS X 10.11.5 (15F34)).\n>\n> I think all submodule .git files should contain relative paths. Otherwise,\n>  duplicating or moving the cloned  repository folder breaks the submodules.\n>\n> Best,\n> Ricardo\n>\n\nThe commit I referenced earlier:\n\n$ git tag --contains f8eaa0ba98b3bd9cb9035eba184a2d9806d30b27\nv2.8.3\nv2.8.4\nv2.9.0\nv2.9.0-rc0\nv2.9.0-rc1\nv2.9.0-rc2\nv2.9.1\n"}]}