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

Re: [PATCHv3 5/5] submodule--helper clone: lose the extra prefix option

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 25, 2016, 19:41 UTC
Message-ID
<xmqqfuve2vln.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<1458931156-29125-6-git-send-email-sbeller@google.com>
Stefan Beller <sbeller@google.com> writes:
Show 7 quoted lines
> In the rewrite from shell to C (ee8838d157761, 2015-09-08, submodule:
> rewrite `module_clone` shell function in C), we never made use of the
> prefix. Probably it sneaked in as module_list which was converted in the
> same series had the prefix as well.
>
> Signed-off-by: Stefan Beller <sbeller@google.com>
> ---
Hmph.

This helper is called from the root level of the superproject's working tree (after cd_to_toplevel is done), and has options like --url. If the user named --url with a relative pathname to a local repository directory (or a bundle file), shouldn't it be adjusted, and wouldn't prefix the only clue what that given path is relative to? Same for --reference repository's path.

I am not sure removing "--prefix=$wt_prefix" without doing "git -C $wt_prefix" on the calling side is the right thing to do. Even though the options list used by this function does not seem to use OPTION_FILENAME, parse-options API takes prefix exactly because relative pathnames need to be adjusted, and it smells like that the breakage brought in by this change is merely hidden by existing bugs in the code that does not use prefix to adjust relative paths.

Previous: Stefan BellerNext: Junio C Hamano
Message 8 of 15 in “[PATCHv3 0/5] submodule helper: cleanup prefix passing”
  1. Stefan BellerMar 25, 2016
  2. 1/5 submodule: prepare recursive path from non root directoryStefan Beller, Mar 25, 2016
  3. Junio C HamanoMar 25, 2016
  4. 2/5 submodule--helper list: lose the extra prefix optionStefan Beller, Mar 25, 2016
  5. 3/5 submodule update: add test for recursive from non root dirStefan Beller, Mar 25, 2016
  6. 4/5 submodule sync: test syncing one submoduleStefan Beller, Mar 25, 2016
  7. 5/5 submodule--helper clone: lose the extra prefix optionStefan Beller, Mar 25, 2016
  8. Junio C HamanoMar 25, 2016
  9. Junio C HamanoMar 25, 2016
  10. Stefan BellerMar 25, 2016
  11. Junio C HamanoMar 25, 2016
  12. Stefan BellerMar 25, 2016
  13. Junio C HamanoMar 25, 2016
  14. Stefan BellerMar 25, 2016
  15. Junio C HamanoMar 28, 2016

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.