{"thread":{"id":"36096","subject":"[PATCH/RFC] Documentation: Say that submodule clones use a separate gitdirs.","startedAt":"2014-03-07T07:53:54Z","lastAt":"2014-03-10T19:36:47Z","messageCount":11,"participants":["Henri GEIST","Andrew Keller","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"236252","messageId":"1394178834.7891.38.camel@Naugrim","threadId":"36096","inReplyTo":null,"subject":"[PATCH/RFC] Documentation: Say that submodule clones use a separate gitdirs.","fromName":"Henri GEIST","fromEmail":"geist.henri@laposte.net","sentAt":"2014-03-07T07:53:54Z","receivedAt":"2014-03-07T07:53:54Z","isPatch":true,"sender":{"key":"geist.henri@laposte.net","avatar":"https://avatars.githubusercontent.com/u/42912271?v=4"},"body":"Adding a note in the submodule documentation signaling that the\nautomatically cloned missing submodules are cloned with a separate\ngitdir. And where it is put.\n\nSigned-off-by: Henri GEIST <geist.henri@laposte.net>\n---\n Documentation/git-submodule.txt |    5 +++++\n 1 file changed, 5 insertions(+)\n\ndiff --git a/Documentation/git-submodule.txt b/Documentation/git-submodule.txt\nindex 21cb59a..ea837fd 100644\n--- a/Documentation/git-submodule.txt\n+++ b/Documentation/git-submodule.txt\n@@ -64,6 +64,11 @@ using the 'status' subcommand and get a detailed overview of the\n difference between the index and checkouts using the 'summary'\n subcommand.\n \n+*NOTE*: when submodule add or submodule update commands clone a missing\n+submodule, the option --separate-git-dir is passed to the clone command\n+and the gitdir of the submodule is placed outside of its working\n+directory in the .git/module of the current repository.\n+\n \n COMMANDS\n --------\n-- \n1.7.9.3.369.gd715.dirty\n"},{"id":"236276","messageId":"BEB30FB8-204C-4272-8F94-6210D96FB2CB@kellerfarm.com","threadId":"36096","inReplyTo":"1394178834.7891.38.camel@Naugrim","subject":"Re: [PATCH/RFC] Documentation: Say that submodule clones use a separate gitdirs.","fromName":"Andrew Keller","fromEmail":"andrew@kellerfarm.com","sentAt":"2014-03-07T21:42:44Z","receivedAt":"2014-03-07T21:42:44Z","isPatch":true,"sender":{"key":"andrew@kellerfarm.com","avatar":"https://avatars.githubusercontent.com/u/304204?v=4"},"body":"On Mar 7, 2014, at 2:53 AM, Henri GEIST <geist.henri@laposte.net> wrote:\n\n> Adding a note in the submodule documentation signaling that the\n> automatically cloned missing submodules are cloned with a separate\n> gitdir. And where it is put.\n> \n> Signed-off-by: Henri GEIST <geist.henri@laposte.net>\n> ---\n> Documentation/git-submodule.txt |    5 +++++\n> 1 file changed, 5 insertions(+)\n> \n> diff --git a/Documentation/git-submodule.txt b/Documentation/git-submodule.txt\n> index 21cb59a..ea837fd 100644\n> --- a/Documentation/git-submodule.txt\n> +++ b/Documentation/git-submodule.txt\n> @@ -64,6 +64,11 @@ using the 'status' subcommand and get a detailed overview of the\n> difference between the index and checkouts using the 'summary'\n> subcommand.\n> \n> +*NOTE*: when submodule add or submodule update commands clone a missing\n> +submodule, the option --separate-git-dir is passed to the clone command\n> +and the gitdir of the submodule is placed outside of its working\n> +directory in the .git/module of the current repository.\n> +\n\nThe modules directory is 'modules'.  And, the '.git' folder is not always called '.git' -- in a submodule, for example, the directory name is the name of the module.\n\nAlso, this file contains mostly high-level documentation, and this addition feels technical in nature.  Is there a location for more technical documentation?  Or, perhaps it can be reworded to sound less technical?\n\n> \n> COMMANDS\n> --------\n> -- \n> 1.7.9.3.369.gd715.dirty\n> \n> \n> --\n\n - Andrew Keller\n"},{"id":"236280","messageId":"xmqqzjl1slcv.fsf@gitster.dls.corp.google.com","threadId":"36096","inReplyTo":"BEB30FB8-204C-4272-8F94-6210D96FB2CB@kellerfarm.com","subject":"Re: [PATCH/RFC] Documentation: Say that submodule clones use a separate gitdirs.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-03-07T22:19:12Z","receivedAt":"2014-03-07T22:19:12Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Andrew Keller <andrew@kellerfarm.com> writes:\n\n>> diff --git a/Documentation/git-submodule.txt b/Documentation/git-submodule.txt\n>> index 21cb59a..ea837fd 100644\n>> --- a/Documentation/git-submodule.txt\n>> +++ b/Documentation/git-submodule.txt\n> ...\n> Also, this file contains mostly high-level documentation, and this\n> addition feels technical in nature.  Is there a location for more\n> technical documentation?  Or, perhaps it can be reworded to sound\n> less technical?\n\nI tend to agree that the new paragraph looked somewhat out of place\nand goes into a too low-level detail of the implementation.\n\nThe repository-layout documentation may be a better place for\nreaders to learn what lives where inside $GIT_DIR.\n"},{"id":"236281","messageId":"1394231714.7891.39.camel@Naugrim","threadId":"36096","inReplyTo":"BEB30FB8-204C-4272-8F94-6210D96FB2CB@kellerfarm.com","subject":"Re: [PATCH/RFC] Documentation: Say that submodule clones use a separate gitdirs.","fromName":"Henri GEIST","fromEmail":"geist.henri@laposte.net","sentAt":"2014-03-07T22:35:14Z","receivedAt":"2014-03-07T22:35:14Z","isPatch":true,"sender":{"key":"geist.henri@laposte.net","avatar":"https://avatars.githubusercontent.com/u/42912271?v=4"},"body":"Le vendredi 07 mars 2014 à 16:42 -0500, Andrew Keller a écrit :\n> On Mar 7, 2014, at 2:53 AM, Henri GEIST <geist.henri@laposte.net> wrote:\n> \n> > Adding a note in the submodule documentation signaling that the\n> > automatically cloned missing submodules are cloned with a separate\n> > gitdir. And where it is put.\n> > \n> > Signed-off-by: Henri GEIST <geist.henri@laposte.net>\n> > ---\n> > Documentation/git-submodule.txt |    5 +++++\n> > 1 file changed, 5 insertions(+)\n> > \n> > diff --git a/Documentation/git-submodule.txt b/Documentation/git-submodule.txt\n> > index 21cb59a..ea837fd 100644\n> > --- a/Documentation/git-submodule.txt\n> > +++ b/Documentation/git-submodule.txt\n> > @@ -64,6 +64,11 @@ using the 'status' subcommand and get a detailed overview of the\n> > difference between the index and checkouts using the 'summary'\n> > subcommand.\n> > \n> > +*NOTE*: when submodule add or submodule update commands clone a missing\n> > +submodule, the option --separate-git-dir is passed to the clone command\n> > +and the gitdir of the submodule is placed outside of its working\n> > +directory in the .git/module of the current repository.\n> > +\n> \n> The modules directory is 'modules'.  And, the '.git' folder is not always called '.git' -- in a submodule, for example, the directory name is the name of the module.\n> \n> Also, this file contains mostly high-level documentation, and this addition feels technical in nature.  Is there a location for more technical documentation?  Or, perhaps it can be reworded to sound less technical?\n\nThis information is technical in nature but has some importance for general users.\nAs this kind of clone have a separate gitdir, you will have a surprise if you\ncopy past the worktree as the gitdir will not come together.\nI have done it and as the doc say nothing about that it take me some time to\nunderstand what happened. And why this repository behave differently than others.\n\nMay be I can rephrase like this :\n\n*NOTE*: when 'submodule add' or 'submodule update' commands clone a missing\nsubmodule, the $GIT_DIR of the submodule containing the metadata is placed\noutside of its working directory in the $GIT_DIR/modules of the current\nrepository. Those submodule can not directly be copied or move.\nYou need to use 'git clone'.\n\n\n> \n> > \n> > COMMANDS\n> > --------\n> > -- \n> > 1.7.9.3.369.gd715.dirty\n> > \n> > \n> > --\n> \n>  - Andrew Keller\n> \n\n\n"},{"id":"236283","messageId":"xmqqvbvpshqn.fsf@gitster.dls.corp.google.com","threadId":"36096","inReplyTo":"1394231714.7891.39.camel@Naugrim","subject":"Re: [PATCH/RFC] Documentation: Say that submodule clones use a separate gitdirs.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-03-07T23:37:20Z","receivedAt":"2014-03-07T23:37:20Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Henri GEIST <geist.henri@laposte.net> writes:\n\n> This information is technical in nature but has some importance for general users.\n> As this kind of clone have a separate gitdir, you will have a surprise if you\n> copy past the worktree as the gitdir will not come together.\n\nI am not sure if I understand exactly what you are trying to say.\nAre you saying that you had a submodule at \"sub/dir\" in your working\ntree, and then \"mkdir ../another && cp -R sub/dir ../another\" did\nnot result in a usable Git working tree in ../another directory?\n\nIt is almost like complaining that \"mkdir ../newone && cp -R * ../newone/\"\ndid not result in a usable git repository in ../newone directory and\nhonestly speaking, that sounds borderline insane, I'd have to say.\n\nYes, if a user knows what she is doing, she should be able to make\nsomething like that work, without running \"git clone\" (which is\nprobably the way most users would do it).  And yes, it would be good\nto let the user learn from the documentation enough so that she\n\"knows what she is doing\".  But no, I do not think end-user facing\ndocumentation for \"git-submodule\" subcommand is the way to do that.\n\nThat is why I suggested repository-layout as potentially a better\nalternative location.\n\nBut perhaps I am mis-reading your rationale.\n"},{"id":"236285","messageId":"1394239852.7891.40.camel@Naugrim","threadId":"36096","inReplyTo":"xmqqvbvpshqn.fsf@gitster.dls.corp.google.com","subject":"Re: [PATCH/RFC] Documentation: Say that submodule clones use a separate gitdirs.","fromName":"Henri GEIST","fromEmail":"geist.henri@laposte.net","sentAt":"2014-03-08T00:50:52Z","receivedAt":"2014-03-08T00:50:52Z","isPatch":true,"sender":{"key":"geist.henri@laposte.net","avatar":"https://avatars.githubusercontent.com/u/42912271?v=4"},"body":"Le vendredi 07 mars 2014 à 15:37 -0800, Junio C Hamano a écrit :\n> Henri GEIST <geist.henri@laposte.net> writes:\n> \n> > This information is technical in nature but has some importance for general users.\n> > As this kind of clone have a separate gitdir, you will have a surprise if you\n> > copy past the worktree as the gitdir will not come together.\n> \n> I am not sure if I understand exactly what you are trying to say.\n> Are you saying that you had a submodule at \"sub/dir\" in your working\n> tree, and then \"mkdir ../another && cp -R sub/dir ../another\" did\n> not result in a usable Git working tree in ../another directory?\n> \n> It is almost like complaining that \"mkdir ../newone && cp -R * ../newone/\"\n> did not result in a usable git repository in ../newone directory and\n> honestly speaking, that sounds borderline insane, I'd have to say.\n> \n> Yes, if a user knows what she is doing, she should be able to make\n> something like that work, without running \"git clone\" (which is\n> probably the way most users would do it).  And yes, it would be good\n> to let the user learn from the documentation enough so that she\n> \"knows what she is doing\".  But no, I do not think end-user facing\n> documentation for \"git-submodule\" subcommand is the way to do that.\n> \n> That is why I suggested repository-layout as potentially a better\n> alternative location.\n> \n> But perhaps I am mis-reading your rationale.\n> \n> \n\nLet me rephrase my example :\n\nTo give one of my project to someone else I have copied it on a USB key.\nBy a simple drag and drop with the mouse.\nAnd I am quite sure I am not alone doing this way.\n\nI have done those kind of things lot of time without any problem.\nBut that day 'the_project' happened to be a submodule cloned by\n'git submodule update' then on the USB key the $GIT_DIR of 'the_project'\nwas missing.\n\nIf 'man git-submodule' have made me aware of the particularities of submodules\nclone I had write in a terminal:\n\ngit clone the_project /media/usb/the_project\n\nOr at least I had understand what happened quicker.\n\nI have nothing against also adding something in repository-layout but I am\npretty sure normal users never read repository-layout as it is not a command\nthey use. And it is not mentioned in most tutorials.\n\n\n"},{"id":"236346","messageId":"B2A4F350-1F20-4ABA-80A6-CF244DD7FAFD@kellerfarm.com","threadId":"36096","inReplyTo":"1394239852.7891.40.camel@Naugrim","subject":"Re: [PATCH/RFC] Documentation: Say that submodule clones use a separate gitdirs.","fromName":"Andrew Keller","fromEmail":"andrew@kellerfarm.com","sentAt":"2014-03-09T23:24:04Z","receivedAt":"2014-03-09T23:24:04Z","isPatch":true,"sender":{"key":"andrew@kellerfarm.com","avatar":"https://avatars.githubusercontent.com/u/304204?v=4"},"body":"On Mar 7, 2014, at 7:50 PM, Henri GEIST wrote:\n> Le vendredi 07 mars 2014 à 15:37 -0800, Junio C Hamano a écrit :\n>> Henri GEIST <geist.henri@laposte.net> writes:\n>> \n>>> This information is technical in nature but has some importance for general users.\n>>> As this kind of clone have a separate gitdir, you will have a surprise if you\n>>> copy past the worktree as the gitdir will not come together.\n>> \n>> I am not sure if I understand exactly what you are trying to say.\n>> Are you saying that you had a submodule at \"sub/dir\" in your working\n>> tree, and then \"mkdir ../another && cp -R sub/dir ../another\" did\n>> not result in a usable Git working tree in ../another directory?\n>> \n>> It is almost like complaining that \"mkdir ../newone && cp -R * ../newone/\"\n>> did not result in a usable git repository in ../newone directory and\n>> honestly speaking, that sounds borderline insane, I'd have to say.\n>> \n>> Yes, if a user knows what she is doing, she should be able to make\n>> something like that work, without running \"git clone\" (which is\n>> probably the way most users would do it).  And yes, it would be good\n>> to let the user learn from the documentation enough so that she\n>> \"knows what she is doing\".  But no, I do not think end-user facing\n>> documentation for \"git-submodule\" subcommand is the way to do that.\n>> \n>> That is why I suggested repository-layout as potentially a better\n>> alternative location.\n>> \n>> But perhaps I am mis-reading your rationale.\n>> \n>> \n> \n> Let me rephrase my example :\n> \n> To give one of my project to someone else I have copied it on a USB key.\n> By a simple drag and drop with the mouse.\n> And I am quite sure I am not alone doing this way.\n> \n> I have done those kind of things lot of time without any problem.\n> But that day 'the_project' happened to be a submodule cloned by\n> 'git submodule update' then on the USB key the $GIT_DIR of 'the_project'\n> was missing.\n> \n> If 'man git-submodule' have made me aware of the particularities of submodules\n> clone I had write in a terminal:\n> \n> git clone the_project /media/usb/the_project\n> \n> Or at least I had understand what happened quicker.\n> \n> I have nothing against also adding something in repository-layout but I am\n> pretty sure normal users never read repository-layout as it is not a command\n> they use. And it is not mentioned in most tutorials.\n\nHow about something like this:\n\n\"The git directory of a submodule lives inside the git directory of the parent repository instead of within the working directory.\"\n\nI'm not sure where to put it, though.\n\n - Andrew Keller\n"},{"id":"236352","messageId":"1394437946.7891.44.camel@Naugrim","threadId":"36096","inReplyTo":"B2A4F350-1F20-4ABA-80A6-CF244DD7FAFD@kellerfarm.com","subject":"Re: [PATCH/RFC] Documentation: Say that submodule clones use a separate gitdirs.","fromName":"Henri GEIST","fromEmail":"geist.henri@laposte.net","sentAt":"2014-03-10T07:52:26Z","receivedAt":"2014-03-10T07:52:26Z","isPatch":true,"sender":{"key":"geist.henri@laposte.net","avatar":"https://avatars.githubusercontent.com/u/42912271?v=4"},"body":"Le dimanche 09 mars 2014 à 19:24 -0400, Andrew Keller a écrit :\n> On Mar 7, 2014, at 7:50 PM, Henri GEIST wrote:\n> > Le vendredi 07 mars 2014 à 15:37 -0800, Junio C Hamano a écrit :\n> >> Henri GEIST <geist.henri@laposte.net> writes:\n> >> \n> >>> This information is technical in nature but has some importance for general users.\n> >>> As this kind of clone have a separate gitdir, you will have a surprise if you\n> >>> copy past the worktree as the gitdir will not come together.\n> >> \n> >> I am not sure if I understand exactly what you are trying to say.\n> >> Are you saying that you had a submodule at \"sub/dir\" in your working\n> >> tree, and then \"mkdir ../another && cp -R sub/dir ../another\" did\n> >> not result in a usable Git working tree in ../another directory?\n> >> \n> >> It is almost like complaining that \"mkdir ../newone && cp -R * ../newone/\"\n> >> did not result in a usable git repository in ../newone directory and\n> >> honestly speaking, that sounds borderline insane, I'd have to say.\n> >> \n> >> Yes, if a user knows what she is doing, she should be able to make\n> >> something like that work, without running \"git clone\" (which is\n> >> probably the way most users would do it).  And yes, it would be good\n> >> to let the user learn from the documentation enough so that she\n> >> \"knows what she is doing\".  But no, I do not think end-user facing\n> >> documentation for \"git-submodule\" subcommand is the way to do that.\n> >> \n> >> That is why I suggested repository-layout as potentially a better\n> >> alternative location.\n> >> \n> >> But perhaps I am mis-reading your rationale.\n> >> \n> >> \n> > \n> > Let me rephrase my example :\n> > \n> > To give one of my project to someone else I have copied it on a USB key.\n> > By a simple drag and drop with the mouse.\n> > And I am quite sure I am not alone doing this way.\n> > \n> > I have done those kind of things lot of time without any problem.\n> > But that day 'the_project' happened to be a submodule cloned by\n> > 'git submodule update' then on the USB key the $GIT_DIR of 'the_project'\n> > was missing.\n> > \n> > If 'man git-submodule' have made me aware of the particularities of submodules\n> > clone I had write in a terminal:\n> > \n> > git clone the_project /media/usb/the_project\n> > \n> > Or at least I had understand what happened quicker.\n> > \n> > I have nothing against also adding something in repository-layout but I am\n> > pretty sure normal users never read repository-layout as it is not a command\n> > they use. And it is not mentioned in most tutorials.\n> \n> How about something like this:\n> \n> \"The git directory of a submodule lives inside the git directory of the parent repository instead of within the working directory.\"\n> \n> I'm not sure where to put it, though.\n> \n>  - Andrew Keller\n> \n\n'git directory' seems ambiguous to me. Maybe we could use 'git metadata'.\n\n\n"},{"id":"236411","messageId":"xmqq61nmrrxe.fsf@gitster.dls.corp.google.com","threadId":"36096","inReplyTo":"B2A4F350-1F20-4ABA-80A6-CF244DD7FAFD@kellerfarm.com","subject":"Re: [PATCH/RFC] Documentation: Say that submodule clones use a separate gitdirs.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-03-10T15:31:41Z","receivedAt":"2014-03-10T15:31:41Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Andrew Keller <andrew@kellerfarm.com> writes:\n\n> On Mar 7, 2014, at 7:50 PM, Henri GEIST wrote:\n> ...\n>> To give one of my project to someone else I have copied it on a USB key.\n>> By a simple drag and drop with the mouse.\n>> And I am quite sure I am not alone doing this way.\n>> \n>> I have done those kind of things lot of time without any problem.\n>> But that day 'the_project' happened to be a submodule cloned by\n>> 'git submodule update' then on the USB key the $GIT_DIR of 'the_project'\n>> was missing.\n>> \n>> If 'man git-submodule' have made me aware of the particularities of submodules\n>> clone I had write in a terminal:\n>> \n>> git clone the_project /media/usb/the_project\n>> \n>> Or at least I had understand what happened quicker.\n>> \n>> I have nothing against also adding something in repository-layout but I am\n>> pretty sure normal users never read repository-layout as it is not a command\n>> they use. And it is not mentioned in most tutorials.\n>\n> How about something like this:\n>\n> \"The git directory of a submodule lives inside the git directory of the parent repository instead of within the working directory.\"\n>\n> I'm not sure where to put it, though.\n\nThis is not limited to submodules.  There are multiple lower-level\nmechanisms for a $path/.git to borrow the repository data from\nelsewhere outside of $path and a cloned submodule uses only one of\nthem.  For any such $path, \"cp -R $path $otherplace\" will result in\nan \"$otherplace\" that does not work as a Git repository in exactly\nthe same way, whether it happens to be a submodule checkout or not.\n\nThat is why I suggested to enhance description on a more general\npart of the documentation that covers what a Git repository is.\n"},{"id":"236428","messageId":"1394475733.7891.53.camel@Naugrim","threadId":"36096","inReplyTo":"xmqq61nmrrxe.fsf@gitster.dls.corp.google.com","subject":"Re: [PATCH/RFC] Documentation: Say that submodule clones use a separate gitdirs.","fromName":"Henri GEIST","fromEmail":"geist.henri@laposte.net","sentAt":"2014-03-10T18:22:13Z","receivedAt":"2014-03-10T18:22:13Z","isPatch":true,"sender":{"key":"geist.henri@laposte.net","avatar":"https://avatars.githubusercontent.com/u/42912271?v=4"},"body":"Le lundi 10 mars 2014 à 08:31 -0700, Junio C Hamano a écrit :\n> Andrew Keller <andrew@kellerfarm.com> writes:\n> \n> > On Mar 7, 2014, at 7:50 PM, Henri GEIST wrote:\n> > ...\n> >> To give one of my project to someone else I have copied it on a USB key.\n> >> By a simple drag and drop with the mouse.\n> >> And I am quite sure I am not alone doing this way.\n> >> \n> >> I have done those kind of things lot of time without any problem.\n> >> But that day 'the_project' happened to be a submodule cloned by\n> >> 'git submodule update' then on the USB key the $GIT_DIR of 'the_project'\n> >> was missing.\n> >> \n> >> If 'man git-submodule' have made me aware of the particularities of submodules\n> >> clone I had write in a terminal:\n> >> \n> >> git clone the_project /media/usb/the_project\n> >> \n> >> Or at least I had understand what happened quicker.\n> >> \n> >> I have nothing against also adding something in repository-layout but I am\n> >> pretty sure normal users never read repository-layout as it is not a command\n> >> they use. And it is not mentioned in most tutorials.\n> >\n> > How about something like this:\n> >\n> > \"The git directory of a submodule lives inside the git directory of the parent repository instead of within the working directory.\"\n> >\n> > I'm not sure where to put it, though.\n> \n> This is not limited to submodules.  There are multiple lower-level\n> mechanisms for a $path/.git to borrow the repository data from\n> elsewhere outside of $path and a cloned submodule uses only one of\n> them.  For any such $path, \"cp -R $path $otherplace\" will result in\n> an \"$otherplace\" that does not work as a Git repository in exactly\n> the same way, whether it happens to be a submodule checkout or not.\n> \n> That is why I suggested to enhance description on a more general\n> part of the documentation that covers what a Git repository is.\n\nYou are entirely right.\nMy view of the situation was biased by the fact that submodule cloning\nis the only case I am aware of except when the user manually type\n'--separate-git-dir' where this problem could occur.\n\nIf there is some other situation where this can occur as a side effect\nof a git command it can be good to have the user aware of the list or\nat least inform them in general case a git repository cannot be copied\nin a place every body will see.\nOr place a note in the manpage of every git command which can have this\nside effect.\n\n\n"},{"id":"236442","messageId":"xmqqsiqprgkw.fsf@gitster.dls.corp.google.com","threadId":"36096","inReplyTo":"1394475733.7891.53.camel@Naugrim","subject":"Re: [PATCH/RFC] Documentation: Say that submodule clones use a separate gitdirs.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-03-10T19:36:47Z","receivedAt":"2014-03-10T19:36:47Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Henri GEIST <geist.henri@laposte.net> writes:\n\n> Le lundi 10 mars 2014 à 08:31 -0700, Junio C Hamano a écrit :\n> ...\n>> This is not limited to submodules.  There are multiple lower-level\n>> mechanisms for a $path/.git to borrow the repository data from\n>> elsewhere outside of $path and a cloned submodule uses only one of\n>> them.  For any such $path, \"cp -R $path $otherplace\" will result in\n>> an \"$otherplace\" that does not work as a Git repository in exactly\n>> the same way, whether it happens to be a submodule checkout or not.\n>> \n>> That is why I suggested to enhance description on a more general\n>> part of the documentation that covers what a Git repository is.\n> ...\n> If there is some other situation where this can occur as a side effect\n> of a git command it can be good to have the user aware of the list or\n> at least inform them in general case a git repository cannot be copied\n> in a place every body will see.\n> Or place a note in the manpage of every git command which can have this\n> side effect.\n\nI think we should do two things:\n\n - In the repository format document, state that there are two\n   lower-level mechanisms and a half that lets a repository borrow\n   from somewhere else, and \"cp -R\" of the former will not result in\n   a complete, usable repository, and who employs these mechanisms.\n\n   * Redirecting the entire .git via the textual gitfile mechanism,\n     which is used by \"clone --separate-git-dir\" and \"submodule\";\n\n   * Borrowing .git/objects read-only from elsewhere, overlaying our\n     own, via .git/objects/info/alternates, which is used by \"clone\n     --reference\";\n\n   * Redirecting some paths in .git to another, via \"git workdir\";\n     soon to be replaced with .git/commondir mechansim.\n\n - In each of the documentation page on an end-user facing command\n   that will be mentioned above, add \"See also\" reference to the\n   above description in the repository format document.\n\n   We could elaborate the \"See also\" as something like \"If you use\n   this feature, do not think you can \"cp -R\" the repository to\n   elsewhere and expect the copy to function; see also ...\", if we\n   wanted to.\n"}]}