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

Re: [PATCH] fix "git-submodule add a/b/c/repository"

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 6, 2008, 06:27 UTC
Message-ID
<7vd4lro7ct.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<20080701150025.GD5852@joyeux>
Sylvain Joyeux <sylvain.joyeux@dfki.de> writes:
Show 16 quoted lines
> The 'master' version of git-submodule.sh fails to see that
> a/b/c/repository is an already existing repository and messes up the
> whole thing. The following patch fixes that.
> -- 
> Sylvain
>
>>From 2bca2e17a01cd81ce30f81750583ab943ab57ff0 Mon Sep 17 00:00:00 2001
> From: Sylvain Joyeux <sylvain.joyeux@dfki.de>
> Date: Tue, 1 Jul 2008 16:45:04 +0200
> Subject: [PATCH] fix submodule add for non-toplevel in-project directories
>
> This patch fixes git-submodule add for submodules that
> already exist in the current package tree, in a folder
> which is not at toplevel, i.e.:
>
>   git submodule add a/b/c/repository
Which one is the commit log message ;-)?
Perhaps Documentation/SubmittingPatches needs a review?
Show 8 quoted lines
> +test_expect_success 'adding an already-existing repository deep in the directory hierarchy' '
> +
> +        mkdir dir0 &&
> +        mkdir dir0/dir1 &&
> +        git clone init dir0/dir1/init &&
> +        git-submodule add dir0/dir1/init &&
> +        git-submodule status | grep "dir0/dir1/init"
> +'

I am not sure if this is fixing a sane use case. "submodule add" is documented to take:

    'git submodule' [--quiet] add [-b branch] [--] <repository> [<path>]

and you are adding at dir0/dir1/init a submodule that will interact with "init" repository, so shouldn't that command line be something like:

	git submodule add init dir0/dir1/init
???
Confused..
Previous: Sylvain JoyeuxNext: Sylvain Joyeux
Message 2 of 15 in “fix "git-submodule add a/b/c/repository"”
  1. fix "git-submodule add a/b/c/repository"Sylvain Joyeux, Jul 1, 2008
  2. Junio C HamanoJul 6, 2008
  3. Sylvain JoyeuxJul 6, 2008
  4. Mark LevedahlJul 6, 2008
  5. Sylvain JoyeuxJul 7, 2008
  6. Mark LevedahlJul 8, 2008
  7. Junio C HamanoJul 8, 2008
  8. Mark LevedahlJul 8, 2008
  9. Junio C HamanoJul 8, 2008
  10. Mark LevedahlJul 8, 2008
  11. git-submodule - make "submodule add" more strict, and document itMark Levedahl, Jul 9, 2008
  12. Junio C HamanoJul 9, 2008
  13. git-submodule - make "submodule add" more strict, and document itMark Levedahl, Jul 10, 2008
  14. git-submodule - register submodule URL if adding in placeMark Levedahl, Jul 10, 2008
  15. Sylvain JoyeuxJul 8, 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.