From: Johannes Sixt <j6t@kdbg.org>
To: Stefan Beller <sbeller@google.com>
Cc: philipoakley@iee.org, git@vger.kernel.org, gitster@pobox.com,
sop@google.com
Subject: Re: [PATCH] submodule init: warn about falling back to a local path
Date: Fri, 24 Feb 2017 09:51:09 +0100 [thread overview]
Message-ID: <ae377bda-0776-f98b-5b6f-afa198647400@kdbg.org> (raw)
In-Reply-To: <20170224001704.23854-1-sbeller@google.com>
Am 24.02.2017 um 01:17 schrieb Stefan Beller:
> --- a/Documentation/git-submodule.txt
> +++ b/Documentation/git-submodule.txt
> @@ -73,13 +73,17 @@ configuration entries unless `--name` is used to specify a logical name.
> ...
> +The default remote is the remote of the remote tracking branch
> +of the current branch. If no such remote tracking branch exists or
> +the in detached HEAD mode, "origin" is assumed to be the default remote.
The part after "or" does not quite parse.
> +If the superproject doesn't have a default remote configured
> the superproject is its own authoritative upstream and the current
> working directory is used instead.
> +
> @@ -118,18 +122,22 @@ too (and can also report changes to a submodule's work tree).
>
> init [--] [<path>...]::
> Initialize the submodules recorded in the index (which were
> - added and committed elsewhere) by copying submodule
> - names and urls from .gitmodules to .git/config.
> + added and committed elsewhere) by copying `submodule.$name.url`
> + from .gitmodules to .git/config, resolving relative urls to be
> + relative to the default remote.
> ++
> Optional <path> arguments limit which submodules will be initialized.
> - It will also copy the value of `submodule.$name.update` into
> - .git/config.
> - The key used in .git/config is `submodule.$name.url`.
> + If no path is specified all submodules are initialized.
> ++
> + When present, it will also copy the value of `submodule.$name.update`.
> This command does not alter existing information in .git/config.
> You can then customize the submodule clone URLs in .git/config
> for your local setup and proceed to `git submodule update`;
> you can also just use `git submodule update --init` without
> the explicit 'init' step if you do not intend to customize
> any submodule locations.
> ++
> + See the add subcommand for the defintion of default remote.
To be rendered correctly, I think you must remove the indentation from
continuation paragraphs.
>
> deinit [-f|--force] (--all|[--] <path>...)::
> Unregister the given submodules, i.e. remove the whole
> diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c
> index 899dc334e3..44c11dd91e 100644
> --- a/builtin/submodule--helper.c
> +++ b/builtin/submodule--helper.c
> @@ -356,12 +356,10 @@ static void init_submodule(const char *path, const char *prefix, int quiet)
> strbuf_addf(&remotesb, "remote.%s.url", remote);
> free(remote);
>
> - if (git_config_get_string(remotesb.buf, &remoteurl))
> - /*
> - * The repository is its own
> - * authoritative upstream
> - */
> + if (git_config_get_string(remotesb.buf, &remoteurl)) {
> remoteurl = xgetcwd();
> + warning(_("could not lookup configuration '%s'. Assuming this repository is its own authoritative upstream."), remotesb.buf);
> + }
If you re-roll this patch, please place the warning before xgetcwd,
which can potentially fail.
-- Hannes
next prev parent reply other threads:[~2017-02-24 8:53 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-21 23:18 [PATCH] submodule init: warn about falling back to a local path Stefan Beller
2017-02-22 15:01 ` Philip Oakley
2017-02-23 0:24 ` Stefan Beller
2017-02-24 0:17 ` Stefan Beller
2017-02-24 8:51 ` Johannes Sixt [this message]
2017-02-24 18:22 ` Stefan Beller
2017-02-24 20:19 ` Junio C Hamano
2017-02-24 20:27 ` Stefan Beller
2017-02-25 1:31 ` Stefan Beller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ae377bda-0776-f98b-5b6f-afa198647400@kdbg.org \
--to=j6t@kdbg.org \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=philipoakley@iee.org \
--cc=sbeller@google.com \
--cc=sop@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).