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

Re: [PATCH] git-submodule - allow a relative path as the subproject url

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 25, 2007, 06:42 UTC
Message-ID
<7vy7ev5jrb.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<1190600382-1648-1-git-send-email-mdl123@verizon.net>
Mark Levedahl <mdl123@verizon.net> writes:
Show 10 quoted lines
> This allows a subproject's location to be specified and stored as relative
> to the parent project's location (e.g., ./foo, or ../foo). This url is
> stored in .gitmodules as given. It is resolved into an absolute url by
> appending it to the parent project's url when the information is written
> to .git/config (i.e., during submodule add for the originator, and
> submodule init for a downstream recipient). This allows cloning of the
> project to work "as expected" if the project is hosted on a different
> server than when the subprojects were added.
>
> Signed-off-by: Mark Levedahl <mdl123@verizon.net>

I like the idea here. If you maintain and serve a set related projects you need to give the users a single URL (per where the user is and how to reach the server).

Show 11 quoted lines
> diff --git a/Documentation/git-submodule.txt b/Documentation/git-submodule.txt
> index 2c48936..d421677 100644
> --- a/Documentation/git-submodule.txt
> +++ b/Documentation/git-submodule.txt
> @@ -21,6 +21,9 @@ add::
>  	repository is cloned at the specified path, added to the
>  	changeset and registered in .gitmodules.   If no path is
>  	specified, the path is deduced from the repository specification.
> +        If the repository url begins with ./ or ../, it is stored as
> +        given but resolved as a relative path from the main project's
> +        url when cloning.
Tabs vs spaces?  Will fix up while applying.
Thanks.
Previous: Mark Levedahl
Message 5 of 5 in “git-submodule - allow a relative path as the subproject url”
  1. git-submodule - allow a relative path as the subproject urlMark Levedahl, Sep 22, 2007
  2. Michael SmithSep 24, 2007
  3. Mark LevedahlSep 24, 2007
  4. git-submodule - allow a relative path as the subproject urlMark Levedahl, Sep 24, 2007
  5. Junio C HamanoSep 25, 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.