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

Re: [PATCH] Teach remote machinery about remotes.default config variable

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 12, 2008, 20:26 UTC
Message-ID
<7vbq7qssd7.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<47891658.3090604@gmail.com>
Mark Levedahl <mlevedahl@gmail.com> writes:
Show 11 quoted lines
> Junio C Hamano wrote:
>> Ahh.
>>
>> Does that suggest the new configuration thing is only about the
>> "submodule update" command, not "remotes.default" that affects
>> how the non-submodule merge and fetch works?
>>
>>
> Yes - this patch set was inspired by the single question of "how do I
> avoid needing to define origin as opposed to a server-specific
> nickname now that I am using sub-modules?"

If it is truly only about "submodule update" then the change seems too intrusive, especially "remotes.default" variable that affects the way how fetch and merge works in situations that do not involve submodules.

If it is not limited to "submodule update" but equally valid fix to non-submodule situations, the changes to the other parts may very well be justifiable, but that would mean your "Yes" is a lie and instead should be "No, but these situations are helped by these changes because...".

In any case, let's step back a bit.

Earlier you said in a response to Dscho that your servers are named consistently across repositories. servername.foo.bar has nickname servername everywhere.

If your top-level repository needs to access a specific server "frotz.foo.bar" for updates, then you would have bootstrapped the whole thing with:

	$ git clone git://frotz.foo.bar/toplevel.git

and in that particular instance of the repository, the source repository on frotz.foo.bar would have been known as 'origin', right? I would not object if you also gave another nickname 'frotz' to the same repository for consistency across developers.

If that is the case, I am wondering why your subprojects are not pointing at the corresponding repository on that same 'frotz.foo.bar' machine as 'origin'. I suspect the reason is that .gitmodules do not say 'frotz.foo.bar' but name some other machine.

And in-tree .gitmodules can name only one URL, as it is project global and shared by everybody. There is no escaping it.

At least as things were designed, "git submodule init" takes URL recorded in .gitmodules as a hint, but this is for the user to override in .git/config in the top-level. Maybe the UI to allow this overriding is not easy enough to use, and your submodules ended up pointing at wrong (from the machine's point of view) URL as 'origin'. And perhaps that is the root cause of this issue?

I am looking at the discussion on the list archive when we discussed the initial design of .gitmodules:

    http://thread.gmane.org/gmane.comp.version-control.git/47466/focus=47502
    http://thread.gmane.org/gmane.comp.version-control.git/47466/focus=47548
    http://thread.gmane.org/gmane.comp.version-control.git/47466/focus=47621

I do not think we are there yet, and suspect that the current "git submodule init" does not give the user a chance to say "the URL recorded in the in-tree .gitmodules corresponds to this URL in this repository for administrative or network connectivity or whatever reasons".

Maybe that is the real issue that we should be tackling. I dunno.

Although I _think_ being able to use nickname other than hardcoded 'origin' for fetch/merge is a good change, if my above suspicion is correct, that change alone would not make the life easier to people who _use_ submodules, as the need for them to set up extra nicknames (like 'frotz') and configure the submodule repositories to use that specific nickname instead of 'origin' would not change.

For communication purposes, I would agree with Dscho that the name 'origin' that names different things for different people is wrong and using specific name 'frotz' would solve communication issues. But when using the repository and doing actual work, wouldn't it be _much_ better if you can consistently go to a repository on a random machine and always can say 'origin' to mean the other repository this repository usually gets new objects from (and sends its new objects to)?

Previous: Johannes SchindelinNext: Mark Levedahl
Message 27 of 134 in “Allowing override of the default "origin" nickname”
  1. Mark LevedahlJan 11, 2008
  2. Teach remote machinery about remotes.default config variableMark Levedahl, Jan 11, 2008
  3. git-remote - Unset remotes.default when deleting the default remoteMark Levedahl, Jan 11, 2008
  4. git-clone - Set remotes.default config variableMark Levedahl, Jan 11, 2008
  5. git-submodule - Possibly inherit parent's default remote on init/cloneMark Levedahl, Jan 11, 2008
  6. Junio C HamanoJan 11, 2008
  7. Mark LevedahlJan 11, 2008
  8. Junio C HamanoJan 12, 2008
  9. Mark LevedahlJan 12, 2008
  10. Junio C HamanoJan 12, 2008
  11. Mark LevedahlJan 12, 2008
  12. Junio C HamanoJan 12, 2008
  13. Mark LevedahlJan 12, 2008
  14. Junio C HamanoJan 12, 2008
  15. Mark LevedahlJan 12, 2008
  16. Johannes SchindelinJan 12, 2008
  17. Mark LevedahlJan 12, 2008
  18. Johannes SchindelinJan 13, 2008
  19. Mark LevedahlJan 14, 2008
  20. Junio C HamanoJan 14, 2008
  21. Mark LevedahlJan 15, 2008
  22. Junio C HamanoJan 15, 2008
  23. Mark LevedahlJan 15, 2008
  24. Johannes SchindelinJan 16, 2008
  25. Mark LevedahlJan 16, 2008
  26. Johannes SchindelinJan 16, 2008
  27. Junio C HamanoJan 12, 2008
  28. Mark LevedahlJan 12, 2008
  29. Junio C HamanoJan 12, 2008
  30. Mark LevedahlJan 13, 2008
  31. Teach remote machinery about core.origin config variableMark Levedahl, Jan 13, 2008
  32. git-remote - Unset core.origin when deleting the default remoteMark Levedahl, Jan 13, 2008
  33. git-clone - Set remotes.origin config variableMark Levedahl, Jan 13, 2008
  34. git-submodule - Possibly inherit parent's default remote on init/cloneMark Levedahl, Jan 13, 2008
  35. Teach git-submodule to use master's remote when updating subprojectsMark Levedahl, Jan 13, 2008
  36. Jeff KingJan 14, 2008
  37. Mark LevedahlJan 15, 2008
  38. Jeff KingJan 15, 2008
  39. Johannes SchindelinJan 13, 2008
  40. Junio C HamanoJan 14, 2008
  41. safecrlf not in 1.5.4 (was Re: [PATCH] Teach remote machinery about remotes.default config variable)Steffen Prohaska, Jan 14, 2008
  42. Johannes SchindelinJan 14, 2008
  43. valgrind test scripts (was Re: [PATCH] Teach remote...)Jeff King, Jan 14, 2008
  44. What's not in 'master' but should beJunio C Hamano, Jan 18, 2008
  45. Lars HjemliJan 18, 2008
  46. Junio C HamanoJan 18, 2008
  47. Lars HjemliJan 18, 2008
  48. Junio C HamanoJan 18, 2008
  49. Lars HjemliJan 18, 2008
  50. Johannes SchindelinJan 18, 2008
  51. Lars HjemliJan 18, 2008
  52. Junio C HamanoJan 18, 2008
  53. What's not in 'master', and likely not to be until 1.5.4Junio C Hamano, Jan 18, 2008
  54. Johannes SixtJan 18, 2008
  55. Junio C HamanoJan 18, 2008
  56. Steffen ProhaskaJan 18, 2008
  57. Johannes SchindelinJan 18, 2008
  58. Johannes SchindelinJan 18, 2008
  59. Johannes SchindelinJan 18, 2008
  60. Shawn O. PearceJan 21, 2008
  61. Johannes SchindelinJan 21, 2008
  62. Shawn O. PearceJan 23, 2008
  63. Johannes SchindelinJan 23, 2008
  64. Johannes SixtJan 18, 2008
  65. Johannes SchindelinJan 18, 2008
  66. Jakub NarebskiJan 18, 2008
  67. Junio C HamanoJan 18, 2008
  68. Imran M YousufJan 21, 2008
  69. Junio C HamanoJan 21, 2008
  70. Steffen ProhaskaJan 21, 2008
  71. submodule: Document the details of the command line syntaxSteffen Prohaska, Jan 21, 2008
  72. Junio C HamanoJan 21, 2008
  73. Marco CostalbaJan 18, 2008
  74. Marco CostalbaJan 18, 2008
  75. Steffen ProhaskaJan 18, 2008
  76. Johannes SchindelinJan 18, 2008
  77. Steffen ProhaskaJan 18, 2008
  78. What's not in 'master', and likely not to be in, until 1.5.4Junio C Hamano, Jan 21, 2008
  79. Linus TorvaldsJan 21, 2008
  80. Junio C HamanoJan 21, 2008
  81. Junio C HamanoJan 21, 2008
  82. Junio C HamanoJan 21, 2008
  83. Junio C HamanoJan 21, 2008
  84. Junio C HamanoJan 21, 2008
  85. Junio C HamanoJan 21, 2008
  86. 1/2 read-cache.c: introduce is_racy_timestamp() helperJunio C Hamano, Jan 21, 2008
  87. 2/2 read-cache.c: fix timestamp comparisonJunio C Hamano, Jan 21, 2008
  88. Linus TorvaldsJan 21, 2008
  89. Johannes SchindelinJan 21, 2008
  90. Linus TorvaldsJan 21, 2008
  91. Linus TorvaldsJan 21, 2008
  92. Johannes SchindelinJan 21, 2008
  93. Linus TorvaldsJan 21, 2008
  94. Junio C HamanoJan 21, 2008
  95. Linus TorvaldsJan 21, 2008
  96. Junio C HamanoJan 21, 2008
  97. Junio C HamanoJan 22, 2008
  98. Linus TorvaldsJan 22, 2008
  99. Linus TorvaldsJan 22, 2008
  100. Junio C HamanoJan 23, 2008
  101. Linus TorvaldsJan 23, 2008
  102. Johannes SixtJan 21, 2008
  103. Daniel BarkalowJan 21, 2008
  104. Marco CostalbaJan 21, 2008
  105. Johannes SchindelinJan 18, 2008
  106. Johannes SchindelinJan 18, 2008
  107. Johannes SchindelinFeb 18, 2008
  108. Mike HommeyJan 19, 2008
  109. Grégoire BarbierJan 19, 2008
  110. Johannes SchindelinJan 19, 2008
  111. Johannes SchindelinJan 12, 2008
  112. Mark LevedahlJan 12, 2008
  113. Johannes SchindelinJan 12, 2008
  114. Teach remote machinery about core.origin config variableMark Levedahl, Jan 12, 2008
  115. git-remote - Unset core.origin when deleting the default remoteMark Levedahl, Jan 12, 2008
  116. git-clone - Set remotes.origin config variableMark Levedahl, Jan 12, 2008
  117. git-submodule - Possibly inherit parent's default remote on init/cloneMark Levedahl, Jan 12, 2008
  118. Johannes SchindelinJan 11, 2008
  119. Mark LevedahlJan 11, 2008
  120. Johannes SchindelinJan 11, 2008
  121. Mark LevedahlJan 11, 2008
  122. Johannes SchindelinJan 11, 2008
  123. Mark LevedahlJan 11, 2008
  124. Björn SteinbrinkJan 11, 2008
  125. Jakub NarebskiJan 11, 2008
  126. Jakub NarebskiJan 11, 2008
  127. Mark LevedahlJan 11, 2008
  128. Johannes SchindelinJan 11, 2008
  129. Daniel BarkalowJan 11, 2008
  130. Junio C HamanoJan 14, 2008
  131. Steffen ProhaskaJan 14, 2008
  132. Junio C HamanoJan 14, 2008
  133. Dmitry PotapovJan 14, 2008
  134. Pierre HabouzitJan 14, 2008

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.