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

Re: [PATCH v3 2/2] Move git-dir for submodules

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 16, 2011, 17:34 UTC
Message-ID
<7vhb5hi7lg.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1313178913-25617-3-git-send-email-iveqy@iveqy.com>
Fredrik Gustafsson <iveqy@iveqy.com> writes:
Show 15 quoted lines
> diff --git a/git-submodule.sh b/git-submodule.sh
> index bc1d3fa..ace6c1d 100755
> --- a/git-submodule.sh
> +++ b/git-submodule.sh
> @@ -122,14 +122,53 @@ module_clone()
>  	path=$1
>  	url=$2
>  	reference="$3"
> +	gitdir=
> +	gitdir_base=
> +	name=$(module_name "$path")
> +	if test -z "$name"
> +	then
> +		name="$path"
> +	fi

This conditional is not needed; module_name dies when it cannot find the name for the path, as it should.

If the defaulting to the path itself were a good idea (which I do not think it is), that should be done in module_name so that other callers that tried to find the name for a given path that does not have a named module would get a consistent result.

Previous: Fredrik Gustafsson
Message 10 of 10 in “submodule: move gitdir into superproject”
  1. 0/2 submodule: move gitdir into superprojectFredrik Gustafsson, Aug 12, 2011
  2. 1/2 rev-parse: add option --is-well-formed-git-dir [path]Fredrik Gustafsson, Aug 12, 2011
  3. Junio C HamanoAug 12, 2011
  4. Nguyen Thai Ngoc DuyAug 13, 2011
  5. Heiko VoigtAug 13, 2011
  6. Junio C HamanoAug 14, 2011
  7. 2/2 Move git-dir for submodulesFredrik Gustafsson, Aug 12, 2011
  8. Marc BranchaudAug 15, 2011
  9. Fredrik GustafssonAug 15, 2011
  10. Junio C HamanoAug 16, 2011

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.