git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Beller <sbeller@google.com>
To: Duy Nguyen <pclouds@gmail.com>
Cc: Git Mailing List <git@vger.kernel.org>,
	Jens Lehmann <Jens.Lehmann@web.de>,
	Junio C Hamano <gitster@pobox.com>, Jeff King <peff@peff.net>,
	Eric Sunshine <sunshine@sunshineco.com>,
	Jonathan Nieder <jrnieder@gmail.com>
Subject: Re: [PATCHv19 09/11] git submodule update: have a dedicated helper for cloning
Date: Mon, 29 Feb 2016 11:03:10 -0800	[thread overview]
Message-ID: <CAGZ79kZYqXWAqjmYJtHM5rPUPbCS_NxOsrbspkOS1WAVV44wzg@mail.gmail.com> (raw)
In-Reply-To: <CACsJy8DmhJrUkp=d4kSst=0yGWn+Hk=MqxCmhH3WqfPzhTt+Uw@mail.gmail.com>

On Sat, Feb 27, 2016 at 12:40 AM, Duy Nguyen <pclouds@gmail.com> wrote:
> On Fri, Feb 26, 2016 at 6:48 AM, Stefan Beller <sbeller@google.com> wrote:
>> +static int prepare_to_clone_next_submodule(const struct cache_entry *ce,
>> +                                          struct child_process *child,
>> +                                          struct submodule_update_clone *suc,
>> +                                          struct strbuf *out)
>> +{
>> +       const struct submodule *sub = NULL;
>> +       struct strbuf displaypath_sb = STRBUF_INIT;
>> +       struct strbuf sb = STRBUF_INIT;
>> +       const char *displaypath = NULL;
>> +       char *url = NULL;
>> +       int needs_cloning = 0;
>> +
>> +       if (ce_stage(ce)) {
>> +               if (suc->recursive_prefix) {
>> +                       strbuf_addf(out, "Skipping unmerged submodule %s/%s\n",
>> +                                   suc->recursive_prefix, ce->name);
>
> I'm pretty sure this string is for human consumption (because it's
> _()'d elsehwere in this function), please _() this string.
>
>> +               } else {
>> +                       strbuf_addf(out, "Skipping unmerged submodule %s\n",
>> +                                   ce->name);
>
> and this one
>
>> +               }
>> +               goto cleanup;
>> +       }
>> +
>> +       sub = submodule_from_path(null_sha1, ce->name);
>> +
>> +       if (suc->recursive_prefix)
>> +               displaypath = relative_path(suc->recursive_prefix,
>> +                                           ce->name, &displaypath_sb);
>> +       else
>> +               displaypath = ce->name;
>> +
>> +       if (suc->update.type == SM_UPDATE_NONE
>> +           || (suc->update.type == SM_UPDATE_UNSPECIFIED
>> +               && sub->update_strategy.type == SM_UPDATE_NONE)) {
>> +               strbuf_addf(out, "Skipping submodule '%s'\n",
>> +                           displaypath);
>
> and this one
>
>> +               goto cleanup;
>> +       }
>> +
>> +       /*
>> +        * Looking up the url in .git/config.
>> +        * We must not fall back to .gitmodules as we only want
>> +        * to process configured submodules.
>> +        */
>> +       strbuf_reset(&sb);
>> +       strbuf_addf(&sb, "submodule.%s.url", sub->name);
>> +       git_config_get_string(sb.buf, &url);
>> +       if (!url) {
>> +               /*
>> +                * Only mention uninitialized submodules when their
>> +                * path have been specified
>> +                */
>> +               if (suc->warn_if_uninitialized)
>> +                       strbuf_addf(out, _("Submodule path '%s' not initialized\n"
>> +                                   "Maybe you want to use 'update --init'?\n"),
>> +                                   displaypath);
>
> oh it's already marked :)
>
> BTW, while you're editing this file, perhaps do this too (maybe in a
> separate patch)? Because die() already prepends "fatal:"

Makes sense. As builtin/submodule--helper.c was introduced in 2.7.0
and translation has already started fr 2.8.0, I'll just pick it up as
part of this series
instead of sending a bugfix patch alone.

Thanks for review!

>
> diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c
> index a6e54fa..6cf47de 100644
> --- a/builtin/submodule--helper.c
> +++ b/builtin/submodule--helper.c
> @@ -731,13 +731,13 @@ int cmd_submodule__helper(int argc, const char
> **argv, const char *prefix)
>  {
>         int i;
>         if (argc < 2)
> -               die(_("fatal: submodule--helper subcommand must be "
> +               die(_("submodule--helper subcommand must be "
>                       "called with a subcommand"));
>
>         for (i = 0; i < ARRAY_SIZE(commands); i++)
>                 if (!strcmp(argv[1], commands[i].cmd))
>                         return commands[i].fn(argc - 1, argv + 1, prefix);
>
> -       die(_("fatal: '%s' is not a valid submodule--helper "
> +       die(_("'%s' is not a valid submodule--helper "
>               "subcommand"), argv[1]);
>  }
> --
> Duy

  reply	other threads:[~2016-02-29 19:03 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-25  3:06 [PATCHv17 00/11] Expose submodule parallelism to the user Stefan Beller
2016-02-25  3:06 ` [PATCHv17 01/11] submodule-config: keep update strategy around Stefan Beller
2016-02-25 18:06   ` Junio C Hamano
2016-02-25 18:21     ` Stefan Beller
2016-02-25  3:06 ` [PATCHv17 02/11] submodule-config: drop check against NULL Stefan Beller
2016-02-25  3:06 ` [PATCHv17 03/11] fetching submodules: respect `submodule.fetchJobs` config option Stefan Beller
2016-02-25  3:06 ` [PATCHv17 04/11] submodule update: direct error message to stderr Stefan Beller
2016-02-25  3:06 ` [PATCHv17 05/11] run_processes_parallel: treat output of children as byte array Stefan Beller
2016-02-25 18:16   ` Junio C Hamano
2016-02-25 20:35     ` Stefan Beller
2016-02-25  3:06 ` [PATCHv17 06/11] run-command: expose default_{start_failure, task_finished} Stefan Beller
2016-02-25  3:06 ` [PATCHv17 07/11] run_processes_parallel: rename parameters for the callbacks Stefan Beller
2016-02-25  3:06 ` [PATCHv17 08/11] run_processes_parallel: correctly terminate callbacks with an LF Stefan Beller
2016-02-25  3:06 ` [PATCHv17 09/11] git submodule update: have a dedicated helper for cloning Stefan Beller
2016-02-25  3:06 ` [PATCHv17 10/11] submodule update: expose parallelism to the user Stefan Beller
2016-02-25  3:06 ` [PATCHv17 11/11] clone: allow an explicit argument for parallel submodule clones Stefan Beller
2016-02-25 22:26 ` [PATCHv17 00/11] Expose submodule parallelism to the user Junio C Hamano
2016-02-25 23:08   ` [PATCHv18 00/11] Expose Stefan Beller
2016-02-25 23:08     ` [PATCHv18 01/11] submodule-config: keep update strategy around Stefan Beller
2016-02-25 23:08     ` [PATCHv18 02/11] submodule-config: drop check against NULL Stefan Beller
2016-02-25 23:08     ` [PATCHv18 03/11] fetching submodules: respect `submodule.fetchJobs` config option Stefan Beller
2016-02-25 23:08     ` [PATCHv18 04/11] submodule update: direct error message to stderr Stefan Beller
2016-02-25 23:08     ` [PATCHv18 05/11] run_processes_parallel: treat output of children as byte array Stefan Beller
2016-02-25 23:08     ` [PATCHv18 06/11] run-command: expose default_{start_failure, task_finished} Stefan Beller
2016-02-25 23:08     ` [PATCHv18 07/11] run_processes_parallel: rename parameters for the callbacks Stefan Beller
2016-02-25 23:08     ` [PATCHv18 08/11] run_processes_parallel: correctly terminate callbacks with an LF Stefan Beller
2016-02-25 23:08     ` [PATCHv18 09/11] git submodule update: have a dedicated helper for cloning Stefan Beller
2016-02-25 23:08     ` [PATCHv18 10/11] submodule update: expose parallelism to the user Stefan Beller
2016-02-25 23:08     ` [PATCHv18 11/11] clone: allow an explicit argument for parallel submodule clones Stefan Beller
2016-02-25 23:11     ` [PATCHv18 00/11] Expose Stefan Beller
2016-02-25 23:19     ` Jonathan Nieder
2016-02-25 23:25       ` Stefan Beller
2016-02-25 23:35         ` Jonathan Nieder
2016-02-25 23:39           ` Junio C Hamano
2016-02-25 23:48             ` [PATCHv19 00/11] Expose submodule parallelism to the user Stefan Beller
2016-02-25 23:48               ` [PATCHv19 01/11] submodule-config: keep update strategy around Stefan Beller
2016-02-25 23:48               ` [PATCHv19 02/11] submodule-config: drop check against NULL Stefan Beller
2016-02-25 23:48               ` [PATCHv19 03/11] fetching submodules: respect `submodule.fetchJobs` config option Stefan Beller
2016-02-25 23:48               ` [PATCHv19 04/11] submodule update: direct error message to stderr Stefan Beller
2016-02-25 23:48               ` [PATCHv19 05/11] run_processes_parallel: treat output of children as byte array Stefan Beller
2016-02-25 23:48               ` [PATCHv19 06/11] run-command: expose default_{start_failure, task_finished} Stefan Beller
2016-02-25 23:48               ` [PATCHv19 07/11] run_processes_parallel: rename parameters for the callbacks Stefan Beller
2016-02-25 23:48               ` [PATCHv19 08/11] run_processes_parallel: correctly terminate callbacks with an LF Stefan Beller
2016-02-25 23:48               ` [PATCHv19 09/11] git submodule update: have a dedicated helper for cloning Stefan Beller
2016-02-27  8:40                 ` Duy Nguyen
2016-02-29 19:03                   ` Stefan Beller [this message]
2016-02-25 23:48               ` [PATCHv19 10/11] submodule update: expose parallelism to the user Stefan Beller
2016-02-25 23:48               ` [PATCHv19 11/11] clone: allow an explicit argument for parallel submodule clones Stefan Beller
2016-02-25 23:50               ` [PATCHv19 00/11] Expose submodule parallelism to the user Jonathan Nieder
2016-02-29 20:48               ` Johannes Sixt
2016-02-29 20:59                 ` Stefan Beller
2016-02-29 21:01                 ` Junio C Hamano
2016-02-29 21:06                   ` Stefan Beller
2016-02-29 21:19                     ` Junio C Hamano
2016-02-29 21:22                       ` Stefan Beller
2016-02-29 21:28                       ` Johannes Sixt
2016-02-29 21:51                         ` Junio C Hamano
2016-02-29 21:55                           ` Stefan Beller
2016-02-25 23:25     ` [PATCHv18 00/11] Expose Jonathan Nieder

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAGZ79kZYqXWAqjmYJtHM5rPUPbCS_NxOsrbspkOS1WAVV44wzg@mail.gmail.com \
    --to=sbeller@google.com \
    --cc=Jens.Lehmann@web.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jrnieder@gmail.com \
    --cc=pclouds@gmail.com \
    --cc=peff@peff.net \
    --cc=sunshine@sunshineco.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.
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 NNTP newsgroup(s).