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

Re: [PATCH 6/6] Teach core object handling functions about gitlinks

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Apr 12, 2007, 00:13 UTC
Message-ID
<Pine.LNX.4.64.0704111659240.6730@woody.linux-foundation.org>
In-Reply-To
<461D73AD.9000205@vilain.net>
On Thu, 12 Apr 2007, Sam Vilain wrote:
Show 6 quoted lines
> 
> Also, in the Perl 5 Perforce conversion there are a number of
> "submodules" (ie, bundled modules with their own history) that move
> around a lot. In some tree representations used during the conversion
> process they might even appear twice in a given tree with differing
> versions.

That should actually be something that is fairly natural to handle with the current git submodule design - there's absolutely no problem with having the same subproject showing up in multiple different places in the tree (and each place obviously will have its own commit).

However, it causes some questions at two points:
 - What do you do in the ".gitmodules" file, where you describe the 
   submodule setup?
   This is not so much a _problem_ as a "how do you want to handle it" 
   issue.
   Would people want such a module to show up as "one module" that is just 
   visible in the tree in multiple places? Or do people prefer to think of 
   of it as completely separate modules that just happen to have the same 
   base repository?
   I don't think it's clear that one or the other is the "right way" to 
   see things, and I don't think git really should care. I suspect it's 
   more likely to be a detail that some importer script just has to 
   resolve one way or the other.
   The core git infrastructure needs to be able to have one module show up 
   in multiple places over time anyway, so I don't think there is any real 
   reason not to allow the same module to show up in multiple places even 
   within one single commit.. (Ie it's really mostly about the .gitmodules 
   file *syntax* - but if we use the config file syntax, it's actually 
   very natural to allow multiple entries for the module directory name)
   At the same time, there are reasons why you might want to consider them 
   separate modules too - maybe you want to *descibe* them separately, and 
   maybe one of the copies is used for "legacy support", and you might be 
   in a situation where you want to check out only one of the copies and 
   not the other (and thus describing them as two *different* modules 
   rather than two versions of the *same* module actually makes sense!).
   So I think this is something where we are technically neutral, but 
   where we may have non-technical issues to choose one representation 
   over another (and those issues may have more to do with the *importer* 
   than with any git issues - if importing from Perforce, it probably 
   makes most sense to make the import behave as much as possible the way 
   Perforce did in that case, and I have *no* idea what that is ;)
 - After a conversion is done, and you're no longer talking about a 
   historical archive, but a "going forward" concern, exactly how 
   automatic is subproject movement going to be, and what are downstream 
   developers that pull these things supposed to do when a subproject that 
   they have checked out is moved?
   This is mostly a UI issue. I suspect that the initial answer is: "you 
   may have to un-check-out a subproject, then pull the superproject, and 
   then re-check-it-out to get it in the new location". Simply because 
   it's going to be a lot easier to do than actually having "git pull" 
   notice when subprojects move.
   IOW, that is more of a "just how nice do we want to be to people", and 
   I _think_ the answer is: "as nice as possible, but some things are more 
   important than others, and some things might take longer before they 
   are really pleasant to do" ;)
Hmm?
		Linus
Previous: Sam VilainNext: Torgil Svensson
Message 58 of 98 in “Initial subproject support (RFC?)”
  1. 0/6 Initial subproject support (RFC?)Linus Torvalds, Apr 10, 2007
  2. 1/6 diff-lib: use ce_mode_from_stat() rather than messing with modes manuallyLinus Torvalds, Apr 10, 2007
  3. 2/6 Avoid overflowing name buffer in deep directory structuresLinus Torvalds, Apr 10, 2007
  4. 3/6 Add 'resolve_gitlink_ref()' helper functionLinus Torvalds, Apr 10, 2007
  5. Alex RiesenApr 10, 2007
  6. Linus TorvaldsApr 10, 2007
  7. Alex RiesenApr 10, 2007
  8. Linus TorvaldsApr 10, 2007
  9. Alex RiesenApr 10, 2007
  10. Linus TorvaldsApr 10, 2007
  11. Josef WeidendorferApr 10, 2007
  12. 4/6 Add "S_IFDIRLNK" file mode infrastructure for git linksLinus Torvalds, Apr 10, 2007
  13. 5/6 Teach "fsck" not to follow subproject linksLinus Torvalds, Apr 10, 2007
  14. Sam VilainApr 11, 2007
  15. Linus TorvaldsApr 11, 2007
  16. Sam VilainApr 11, 2007
  17. Linus TorvaldsApr 11, 2007
  18. David LangApr 11, 2007
  19. Linus TorvaldsApr 11, 2007
  20. David LangApr 11, 2007
  21. Linus TorvaldsApr 12, 2007
  22. Junio C HamanoApr 12, 2007
  23. David LangApr 12, 2007
  24. Dana HowApr 12, 2007
  25. Linus TorvaldsApr 12, 2007
  26. Rogan DawesApr 13, 2007
  27. Linus TorvaldsApr 13, 2007
  28. Dana HowApr 15, 2007
  29. Dana HowApr 12, 2007
  30. Sam VilainApr 12, 2007
  31. Junio C HamanoApr 12, 2007
  32. Linus TorvaldsApr 12, 2007
  33. Junio C HamanoApr 12, 2007
  34. Junio C HamanoApr 12, 2007
  35. Linus TorvaldsApr 12, 2007
  36. Dana HowApr 11, 2007
  37. 6/6 Teach core object handling functions about gitlinksLinus Torvalds, Apr 10, 2007
  38. Frank LichtenheldApr 10, 2007
  39. Alex RiesenApr 10, 2007
  40. Linus TorvaldsApr 10, 2007
  41. Josef WeidendorferApr 10, 2007
  42. Alex RiesenApr 10, 2007
  43. Josef WeidendorferApr 10, 2007
  44. Linus TorvaldsApr 10, 2007
  45. Andy ParkinsApr 10, 2007
  46. Linus TorvaldsApr 10, 2007
  47. Junio C HamanoApr 10, 2007
  48. Linus TorvaldsApr 10, 2007
  49. Sam VilainApr 12, 2007
  50. Martin WaitzApr 12, 2007
  51. Linus TorvaldsApr 12, 2007
  52. Sam VilainApr 12, 2007
  53. David LangApr 10, 2007
  54. Junio C HamanoApr 10, 2007
  55. Josef WeidendorferApr 10, 2007
  56. Linus TorvaldsApr 10, 2007
  57. Sam VilainApr 11, 2007
  58. Linus TorvaldsApr 12, 2007
  59. Torgil SvenssonApr 12, 2007
  60. Martin WaitzApr 12, 2007
  61. Torgil SvenssonApr 12, 2007
  62. Sam VilainApr 11, 2007
  63. Martin WaitzApr 11, 2007
  64. Alex RiesenApr 11, 2007
  65. Martin WaitzApr 11, 2007
  66. Alex RiesenApr 11, 2007
  67. Martin WaitzApr 11, 2007
  68. Junio C HamanoApr 11, 2007
  69. Martin WaitzApr 11, 2007
  70. Junio C HamanoApr 11, 2007
  71. Martin WaitzApr 11, 2007
  72. Linus TorvaldsApr 11, 2007
  73. Andy ParkinsApr 11, 2007
  74. Martin WaitzApr 11, 2007
  75. Linus TorvaldsApr 11, 2007
  76. Sam VilainApr 11, 2007
  77. Martin WaitzApr 11, 2007
  78. Brian GernhardtApr 12, 2007
  79. Josef WeidendorferApr 12, 2007
  80. Linus TorvaldsApr 10, 2007
  81. Alex RiesenApr 10, 2007
  82. Linus TorvaldsApr 10, 2007
  83. Alex RiesenApr 10, 2007
  84. Linus TorvaldsApr 10, 2007
  85. Alex RiesenApr 10, 2007
  86. Junio C HamanoApr 10, 2007
  87. Linus TorvaldsApr 10, 2007
  88. Junio C HamanoApr 10, 2007
  89. Sam RavnborgApr 10, 2007
  90. Junio C HamanoApr 10, 2007
  91. Nicolas PitreApr 10, 2007
  92. J. Bruce FieldsApr 15, 2007
  93. David KågedalApr 11, 2007
  94. Junio C HamanoApr 11, 2007
  95. J. Bruce FieldsApr 15, 2007
  96. Martin WaitzApr 11, 2007
  97. Alex RiesenApr 11, 2007
  98. Martin WaitzApr 11, 2007

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.