git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH/RFC] Documentation: Say that submodule clones use a separate gitdirs.

From
Henri GEIST <geist.henri@laposte.net>
Date
Mar 10, 2014, 07:52 UTC
Message-ID
<1394437946.7891.44.camel@Naugrim>
In-Reply-To
<B2A4F350-1F20-4ABA-80A6-CF244DD7FAFD@kellerfarm.com>
Le dimanche 09 mars 2014 à 19:24 -0400, Andrew Keller a écrit :
Show 61 quoted lines
> On Mar 7, 2014, at 7:50 PM, Henri GEIST wrote:
> > Le vendredi 07 mars 2014 à 15:37 -0800, Junio C Hamano a écrit :
> >> Henri GEIST <geist.henri@laposte.net> writes:
> >> 
> >>> This information is technical in nature but has some importance for general users.
> >>> As this kind of clone have a separate gitdir, you will have a surprise if you
> >>> copy past the worktree as the gitdir will not come together.
> >> 
> >> I am not sure if I understand exactly what you are trying to say.
> >> Are you saying that you had a submodule at "sub/dir" in your working
> >> tree, and then "mkdir ../another && cp -R sub/dir ../another" did
> >> not result in a usable Git working tree in ../another directory?
> >> 
> >> It is almost like complaining that "mkdir ../newone && cp -R * ../newone/"
> >> did not result in a usable git repository in ../newone directory and
> >> honestly speaking, that sounds borderline insane, I'd have to say.
> >> 
> >> Yes, if a user knows what she is doing, she should be able to make
> >> something like that work, without running "git clone" (which is
> >> probably the way most users would do it).  And yes, it would be good
> >> to let the user learn from the documentation enough so that she
> >> "knows what she is doing".  But no, I do not think end-user facing
> >> documentation for "git-submodule" subcommand is the way to do that.
> >> 
> >> That is why I suggested repository-layout as potentially a better
> >> alternative location.
> >> 
> >> But perhaps I am mis-reading your rationale.
> >> 
> >> 
> > 
> > Let me rephrase my example :
> > 
> > To give one of my project to someone else I have copied it on a USB key.
> > By a simple drag and drop with the mouse.
> > And I am quite sure I am not alone doing this way.
> > 
> > I have done those kind of things lot of time without any problem.
> > But that day 'the_project' happened to be a submodule cloned by
> > 'git submodule update' then on the USB key the $GIT_DIR of 'the_project'
> > was missing.
> > 
> > If 'man git-submodule' have made me aware of the particularities of submodules
> > clone I had write in a terminal:
> > 
> > git clone the_project /media/usb/the_project
> > 
> > Or at least I had understand what happened quicker.
> > 
> > I have nothing against also adding something in repository-layout but I am
> > pretty sure normal users never read repository-layout as it is not a command
> > they use. And it is not mentioned in most tutorials.
> 
> How about something like this:
> 
> "The git directory of a submodule lives inside the git directory of the parent repository instead of within the working directory."
> 
> I'm not sure where to put it, though.
> 
>  - Andrew Keller
> 
'git directory' seems ambiguous to me. Maybe we could use 'git metadata'.
Previous: Andrew KellerNext: Junio C Hamano
Message 8 of 11 in “Documentation: Say that submodule clones use a separate gitdirs.”
  1. Documentation: Say that submodule clones use a separate gitdirs.Henri GEIST, Mar 7, 2014
  2. Andrew KellerMar 7, 2014
  3. Junio C HamanoMar 7, 2014
  4. Henri GEISTMar 7, 2014
  5. Junio C HamanoMar 7, 2014
  6. Henri GEISTMar 8, 2014
  7. Andrew KellerMar 9, 2014
  8. Henri GEISTMar 10, 2014
  9. Junio C HamanoMar 10, 2014
  10. Henri GEISTMar 10, 2014
  11. Junio C HamanoMar 10, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.