git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCHv14 0/7] Expose submodule parallelism to the user
@ 2016-02-19 18:17 Stefan Beller
  2016-02-19 18:17 ` [PATCHv14 1/7] submodule-config: keep update strategy around Stefan Beller
                   ` (7 more replies)
  0 siblings, 8 replies; 15+ messages in thread
From: Stefan Beller @ 2016-02-19 18:17 UTC (permalink / raw)
  To: gitster; +Cc: git, jrnieder, Jens.Lehmann, peff, sunshine, Stefan Beller

Thanks Junio, Jeff and Eric for reviewing once again!

* fixes as proposed by Junio for readability in parse_submodule_update_strategy
* Do not leak the `url`, as found by Jeff.
  (I dug into the code of argv_array_pushl and you're obviously correct)

Thanks,
Stefan

Interdiff to v13:

diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c
index 65bdc14..c435c53 100644
--- a/builtin/submodule--helper.c
+++ b/builtin/submodule--helper.c
@@ -356,13 +356,11 @@ static int update_clone_inspect_next_task(struct child_process *cp,
 
                argv_array_pushl(&cp->args, "--path", sub->path, NULL);
                argv_array_pushl(&cp->args, "--name", sub->name, NULL);
-               argv_array_pushl(&cp->args, "--url", strdup(url), NULL);
+               argv_array_pushl(&cp->args, "--url", url, NULL);
                if (pp->reference)
                        argv_array_push(&cp->args, pp->reference);
                if (pp->depth)
                        argv_array_push(&cp->args, pp->depth);
-
-
        }
 
 cleanup:
diff --git a/submodule.c b/submodule.c
index b54d92d..051f722 100644
--- a/submodule.c
+++ b/submodule.c
@@ -219,7 +219,7 @@ void gitmodules_config(void)
 int parse_submodule_update_strategy(const char *value,
                struct submodule_update_strategy *dst)
 {
-       free((void*)dst->command);
+       free((void *)dst->command);
        dst->command = NULL;
        if (!strcmp(value, "none"))
                dst->type = SM_UPDATE_NONE;
@@ -229,9 +229,9 @@ int parse_submodule_update_strategy(const char *value,
                dst->type = SM_UPDATE_REBASE;
        else if (!strcmp(value, "merge"))
                dst->type = SM_UPDATE_MERGE;
-       else if (value[0] == '!') {
+       else if (skip_prefix(value, "!", &value)) {
                dst->type = SM_UPDATE_COMMAND;
-               dst->command = xstrdup(value + 1);
+               dst->command = xstrdup(value);
        } else
                return -1;
        return 0;

Stefan Beller (7):
  submodule-config: keep update strategy around
  submodule-config: drop check against NULL
  fetching submodules: respect `submodule.fetchJobs` config option
  submodule update: direct error message to stderr
  git submodule update: have a dedicated helper for cloning
  submodule update: expose parallelism to the user
  clone: allow an explicit argument for parallel submodule clones

 Documentation/config.txt        |   6 +
 Documentation/git-clone.txt     |   6 +-
 Documentation/git-submodule.txt |   7 +-
 builtin/clone.c                 |  19 +++-
 builtin/fetch.c                 |   2 +-
 builtin/submodule--helper.c     | 237 ++++++++++++++++++++++++++++++++++++++++
 git-submodule.sh                |  54 ++++-----
 submodule-config.c              |  19 +++-
 submodule-config.h              |   2 +
 submodule.c                     |  37 ++++++-
 submodule.h                     |  18 +++
 t/t5526-fetch-submodules.sh     |  14 +++
 t/t7400-submodule-basic.sh      |   4 +-
 t/t7406-submodule-update.sh     |  27 +++++
 14 files changed, 403 insertions(+), 49 deletions(-)

-- 
2.7.0.rc0.34.ga06e0b3.dirty

^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2016-02-23 23:44 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-19 18:17 [PATCHv14 0/7] Expose submodule parallelism to the user Stefan Beller
2016-02-19 18:17 ` [PATCHv14 1/7] submodule-config: keep update strategy around Stefan Beller
2016-02-19 18:17 ` [PATCHv14 2/7] submodule-config: drop check against NULL Stefan Beller
2016-02-19 18:17 ` [PATCHv14 3/7] fetching submodules: respect `submodule.fetchJobs` config option Stefan Beller
2016-02-19 18:17 ` [PATCHv14 4/7] submodule update: direct error message to stderr Stefan Beller
2016-02-19 18:17 ` [PATCHv14 5/7] git submodule update: have a dedicated helper for cloning Stefan Beller
2016-02-19 23:07   ` Jonathan Nieder
2016-02-19 23:49     ` Stefan Beller
2016-02-20  0:32       ` Jonathan Nieder
2016-02-19 18:17 ` [PATCHv14 6/7] submodule update: expose parallelism to the user Stefan Beller
2016-02-19 18:17 ` [PATCHv14 7/7] clone: allow an explicit argument for parallel submodule clones Stefan Beller
2016-02-19 21:04 ` [PATCHv14 0/7] Expose submodule parallelism to the user Junio C Hamano
2016-02-23 23:33   ` Junio C Hamano
2016-02-23 23:42     ` Stefan Beller
2016-02-23 23:44       ` Junio C Hamano

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).