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

Re: [PATCH 02/13] submodule--helper: get remote names from any repository

From
Atharva Raykar <raykar.ath@gmail.com>
Date
Sep 7, 2021, 13:33 UTC
Message-ID
<m2czpklcnh.fsf@gmail.com>
In-Reply-To
<871r60muge.fsf@evledraar.gmail.com>
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
Show 19 quoted lines
> On Tue, Sep 07 2021, Atharva Raykar wrote:
>
>> `get_default_remote()` retrieves the name of a remote by resolving the
>> refs from of the current repository's ref store.
>>
>> Thus in order to use it for retrieving the remote name of a submodule,
>> we have to start a new subprocess which runs from the submodule
>> directory.
>>
>> Let's instead introduce a function called `repo_get_default_remote()`
>> which takes any repository object and retrieves the remote accordingly.
>>
>> `get_default_remote()` is then defined as a call to
>> `repo_get_default_remote()` with 'the_repository' passed to it.
>
> I'd find this easier to follow if this were just squashed into the next
> commit. Both are rather small, but following the context of first adding
> a function, then using it, instead of just adding it, changing the old
> users etc. is harder than just having it in one commit.

I am in two minds about this. I initially had both these changes in one commit, but Christian suggested I split the changes into a part that refactors existing code (this commit), and one that introduces a new helper (the next commit).

I guess I will squash it for now and see how it is received. Maybe bringing down the "/13" might help get more reviews ;-)

Previous: Ævar Arnfjörð BjarmasonNext: Atharva Raykar
Message 5 of 142 in “submodule: convert the rest of 'update' to C”
  1. 00/13 submodule: convert the rest of 'update' to CAtharva Raykar, Sep 7, 2021
  2. 01/13 submodule--helper: split up ensure_core_worktree()Atharva Raykar, Sep 7, 2021
  3. 02/13 submodule--helper: get remote names from any repositoryAtharva Raykar, Sep 7, 2021
  4. Ævar Arnfjörð BjarmasonSep 7, 2021
  5. Atharva RaykarSep 7, 2021
  6. 03/13 submodule--helper: introduce get_default_remote_submodule()Atharva Raykar, Sep 7, 2021
  7. 04/13 submodule--helper: rename helpers for update-cloneAtharva Raykar, Sep 7, 2021
  8. 05/13 submodule--helper: refactor get_submodule_displaypath()Atharva Raykar, Sep 7, 2021
  9. 06/13 submodule: move core cmd_update() logic to CAtharva Raykar, Sep 7, 2021
  10. Ævar Arnfjörð BjarmasonSep 7, 2021
  11. 07/13 submodule: remove fetch_in_submodule shell functionAtharva Raykar, Sep 7, 2021
  12. Ævar Arnfjörð BjarmasonSep 7, 2021
  13. 08/13 submodule--helper: remove update-clone subcommandAtharva Raykar, Sep 7, 2021
  14. Ævar Arnfjörð BjarmasonSep 7, 2021
  15. 09/13 submodule--helper: remove update-module-mode subcommandAtharva Raykar, Sep 7, 2021
  16. Ævar Arnfjörð BjarmasonSep 7, 2021
  17. Atharva RaykarSep 7, 2021
  18. 10/13 submodule--helper: remove shell interface to ensure_core_worktree()Atharva Raykar, Sep 7, 2021
  19. 11/13 submodule--helper: remove print-default-remote subcommandAtharva Raykar, Sep 7, 2021
  20. 12/13 submodule--helper: remove relative-path subcommandAtharva Raykar, Sep 7, 2021
  21. 13/13 submodule--helper: remove run-update-procedure subcommandAtharva Raykar, Sep 7, 2021
  22. Ævar Arnfjörð BjarmasonSep 7, 2021
  23. Atharva RaykarSep 7, 2021
  24. 0/8 submodule: convert the rest of 'update' to CAtharva Raykar, Sep 16, 2021
  25. 1/8 submodule--helper: split up ensure_core_worktree()Atharva Raykar, Sep 16, 2021
  26. 2/8 submodule--helper: get remote names from any repositoryAtharva Raykar, Sep 16, 2021
  27. Junio C HamanoSep 20, 2021
  28. Atharva RaykarOct 3, 2021
  29. Junio C HamanoSep 20, 2021
  30. Jonathan TanSep 21, 2021
  31. 3/8 submodule--helper: rename helpers for update-cloneAtharva Raykar, Sep 16, 2021
  32. 4/8 submodule--helper: refactor get_submodule_displaypath()Atharva Raykar, Sep 16, 2021
  33. 5/8 submodule: move core cmd_update() logic to CAtharva Raykar, Sep 16, 2021
  34. Junio C HamanoSep 20, 2021
  35. Atharva RaykarOct 3, 2021
  36. Junio C HamanoSep 20, 2021
  37. Junio C HamanoSep 20, 2021
  38. 6/8 submodule--helper: remove update-clone subcommandAtharva Raykar, Sep 16, 2021
  39. 7/8 submodule--helper: remove unused helpersAtharva Raykar, Sep 16, 2021
  40. Junio C HamanoSep 20, 2021
  41. 8/8 submodule--helper: rename helper functionsAtharva Raykar, Sep 16, 2021
  42. Junio C HamanoSep 20, 2021
  43. 0/9 submodule: convert the rest of 'update' to CAtharva Raykar, Oct 13, 2021
  44. 1/9 submodule--helper: split up ensure_core_worktree()Atharva Raykar, Oct 13, 2021
  45. 2/9 submodule--helper: get remote names from any repositoryAtharva Raykar, Oct 13, 2021
  46. 3/9 submodule--helper: rename helpers for update-cloneAtharva Raykar, Oct 13, 2021
  47. 4/9 submodule--helper: refactor get_submodule_displaypath()Atharva Raykar, Oct 13, 2021
  48. 8/9 submodule--helper: remove unused helpersAtharva Raykar, Oct 13, 2021
  49. 6/9 submodule--helper: run update using child process structAtharva Raykar, Oct 13, 2021
  50. 7/9 submodule: move core cmd_update() logic to CAtharva Raykar, Oct 13, 2021
  51. 5/9 submodule--helper: allow setting superprefix for init_submodule()Atharva Raykar, Oct 13, 2021
  52. 9/9 submodule--helper: rename helper functionsAtharva Raykar, Oct 13, 2021
  53. Junio C HamanoOct 14, 2021
  54. Emily ShafferOct 14, 2021
  55. Junio C HamanoDec 3, 2021
  56. Ævar Arnfjörð BjarmasonDec 3, 2021
  57. Atharva RaykarDec 4, 2021
  58. 0/7 submodule: convert the rest of 'update' to CÆvar Arnfjörð Bjarmason, Jan 27, 2022
  59. 1/7 submodule--helper: get remote names from any repositoryÆvar Arnfjörð Bjarmason, Jan 27, 2022
  60. Glen ChooJan 27, 2022
  61. 2/7 submodule--helper: refactor get_submodule_displaypath()Ævar Arnfjörð Bjarmason, Jan 27, 2022
  62. 3/7 submodule--helper: allow setting superprefix for init_submodule()Ævar Arnfjörð Bjarmason, Jan 27, 2022
  63. 4/7 submodule--helper: run update using child process structÆvar Arnfjörð Bjarmason, Jan 27, 2022
  64. 5/7 builtin/submodule--helper.c: reformat designated initializersÆvar Arnfjörð Bjarmason, Jan 27, 2022
  65. 6/7 builtin/submodule--helper.c: rename "suc" variable to "opt"Ævar Arnfjörð Bjarmason, Jan 27, 2022
  66. 7/7 submodule: move core cmd_update() logic to CÆvar Arnfjörð Bjarmason, Jan 27, 2022
  67. Glen ChooJan 27, 2022
  68. 0/9 submodule: convert the rest of 'update' to CÆvar Arnfjörð Bjarmason, Jan 28, 2022
  69. 1/9 submodule--helper: get remote names from any repositoryÆvar Arnfjörð Bjarmason, Jan 28, 2022
  70. 2/9 submodule--helper: refactor get_submodule_displaypath()Ævar Arnfjörð Bjarmason, Jan 28, 2022
  71. 3/9 submodule--helper: allow setting superprefix for init_submodule()Ævar Arnfjörð Bjarmason, Jan 28, 2022
  72. 4/9 submodule--helper: run update using child process structÆvar Arnfjörð Bjarmason, Jan 28, 2022
  73. 5/9 builtin/submodule--helper.c: reformat designated initializersÆvar Arnfjörð Bjarmason, Jan 28, 2022
  74. 6/9 builtin/submodule--helper.c: rename option variables to "opt"Ævar Arnfjörð Bjarmason, Jan 28, 2022
  75. 7/9 submodule--helper: don't use bitfield indirection for parse_options()Ævar Arnfjörð Bjarmason, Jan 28, 2022
  76. 8/9 submodule tests: test for init and update failure outputÆvar Arnfjörð Bjarmason, Jan 28, 2022
  77. 9/9 submodule: move core cmd_update() logic to CÆvar Arnfjörð Bjarmason, Jan 28, 2022
  78. Glen ChooFeb 3, 2022
  79. Ævar Arnfjörð BjarmasonFeb 3, 2022
  80. Ævar Arnfjörð BjarmasonFeb 3, 2022
  81. Glen ChooFeb 3, 2022
  82. 00/16 submodule: convert the rest of 'update' to CGlen Choo, Feb 8, 2022
  83. 01/16 submodule--helper: get remote names from any repositoryGlen Choo, Feb 8, 2022
  84. 02/16 submodule--helper: refactor get_submodule_displaypath()Glen Choo, Feb 8, 2022
  85. 04/16 submodule--helper: run update using child process structGlen Choo, Feb 8, 2022
  86. 03/16 submodule--helper: allow setting superprefix for init_submodule()Glen Choo, Feb 8, 2022
  87. 05/16 builtin/submodule--helper.c: reformat designated initializersGlen Choo, Feb 8, 2022
  88. 07/16 submodule--helper: don't use bitfield indirection for parse_options()Glen Choo, Feb 8, 2022
  89. 08/16 submodule tests: test for init and update failure outputGlen Choo, Feb 8, 2022
  90. 09/16 submodule--helper: remove update-module-modeGlen Choo, Feb 8, 2022
  91. 06/16 builtin/submodule--helper.c: rename option variables to "opt"Glen Choo, Feb 8, 2022
  92. 10/16 submodule--helper: reorganize code for sh to C conversionGlen Choo, Feb 8, 2022
  93. 12/16 submodule--helper run-update-procedure: learn --remoteGlen Choo, Feb 8, 2022
  94. 13/16 submodule--helper: remove ensure-core-worktreeGlen Choo, Feb 8, 2022
  95. 11/16 submodule--helper run-update-procedure: remove --suboidGlen Choo, Feb 8, 2022
  96. 14/16 submodule--helper update-clone: learn --initGlen Choo, Feb 8, 2022
  97. 15/16 submodule--helper: move functions aroundGlen Choo, Feb 8, 2022
  98. 16/16 submodule: move core cmd_update() logic to CGlen Choo, Feb 8, 2022
  99. 00/20 submodule: convert the rest of 'update' to CGlen Choo, Feb 10, 2022
  100. 01/20 submodule--helper: get remote names from any repositoryGlen Choo, Feb 10, 2022
  101. 02/20 submodule--helper: refactor get_submodule_displaypath()Glen Choo, Feb 10, 2022
  102. Ævar Arnfjörð BjarmasonFeb 12, 2022
  103. 03/20 submodule--helper: allow setting superprefix for init_submodule()Glen Choo, Feb 10, 2022
  104. Ævar Arnfjörð BjarmasonFeb 12, 2022
  105. 04/20 submodule--helper: run update using child process structGlen Choo, Feb 10, 2022
  106. Ævar Arnfjörð BjarmasonFeb 12, 2022
  107. 05/20 builtin/submodule--helper.c: reformat designated initializersGlen Choo, Feb 10, 2022
  108. 06/20 builtin/submodule--helper.c: rename option variables to "opt"Glen Choo, Feb 10, 2022
  109. 07/20 submodule--helper: don't use bitfield indirection for parse_options()Glen Choo, Feb 10, 2022
  110. 08/20 submodule tests: test for init and update failure outputGlen Choo, Feb 10, 2022
  111. 09/20 submodule--helper: remove update-module-modeGlen Choo, Feb 10, 2022
  112. Ævar Arnfjörð BjarmasonFeb 12, 2022
  113. 11/20 submodule--helper run-update-procedure: remove --suboidGlen Choo, Feb 10, 2022
  114. 10/20 submodule--helper: reorganize code for sh to C conversionGlen Choo, Feb 10, 2022
  115. 12/20 submodule--helper run-update-procedure: learn --remoteGlen Choo, Feb 10, 2022
  116. Ævar Arnfjörð BjarmasonFeb 12, 2022
  117. 13/20 submodule--helper: remove ensure-core-worktreeGlen Choo, Feb 10, 2022
  118. 14/20 submodule--helper update-clone: learn --initGlen Choo, Feb 10, 2022
  119. 15/20 submodule--helper: move functions aroundGlen Choo, Feb 10, 2022
  120. Ævar Arnfjörð BjarmasonFeb 12, 2022
  121. 16/20 submodule--helper: reduce logic in run_update_procedure()Glen Choo, Feb 10, 2022
  122. 17/20 submodule: move core cmd_update() logic to CGlen Choo, Feb 10, 2022
  123. Glen ChooFeb 10, 2022
  124. 18/20 fixup! submodule--helper run-update-procedure: remove --suboidGlen Choo, Feb 10, 2022
  125. Ævar Arnfjörð BjarmasonFeb 12, 2022
  126. 19/20 fixup! submodule--helper run-update-procedure: learn --remoteGlen Choo, Feb 10, 2022
  127. Ævar Arnfjörð BjarmasonFeb 12, 2022
  128. 20/20 fixup! submodule: move core cmd_update() logic to CGlen Choo, Feb 10, 2022
  129. Ævar Arnfjörð BjarmasonFeb 12, 2022
  130. Glen ChooFeb 17, 2022
  131. Ævar Arnfjörð BjarmasonFeb 17, 2022
  132. Glen ChooFeb 17, 2022
  133. Junio C HamanoFeb 13, 2022
  134. Junio C HamanoFeb 13, 2022
  135. Glen ChooFeb 14, 2022
  136. Ævar Arnfjörð BjarmasonFeb 14, 2022
  137. Glen ChooFeb 15, 2022
  138. Junio C HamanoFeb 14, 2022
  139. Glen ChooFeb 15, 2022
  140. Glen ChooFeb 15, 2022
  141. Glen ChooOct 14, 2021
  142. Atharva RaykarOct 15, 2021

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.