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

[PATCHv13 0/7] Expose submodule parallelism to the user

From
Stefan Beller <sbeller@google.com>
Date
Feb 18, 2016, 23:33 UTC
Message-ID
<1455838398-12379-1-git-send-email-sbeller@google.com>

Thanks Junio, for the discussion about the last issue! I changed to check for '!' in the code as well as addressing the cleanup afterwards.

Thanks, Stefan

Interdiff to v11(! not v12)
diff --git a/submodule-config.c b/submodule-config.c
index 02bcaa7..9fa2269 100644
--- a/submodule-config.c
+++ b/submodule-config.c
@@ -59,6 +59,7 @@ static void free_one_config(struct submodule_entry *entry)
 {
        free((void *) entry->config->path);
        free((void *) entry->config->name);
+       free((void *) entry->config->update_strategy.command);
        free(entry->config);
 }
 
diff --git a/submodule.c b/submodule.c
index 263cb2a..c1211d7 100644
--- a/submodule.c
+++ b/submodule.c
@@ -219,6 +219,7 @@ void gitmodules_config(void)
 int parse_submodule_update_strategy(const char *value,
                struct submodule_update_strategy *dst)
 {
+       free((void*)dst->command);
        dst->command = NULL;
        if (!strcmp(value, "none"))
                dst->type = SM_UPDATE_NONE;
@@ -228,9 +229,10 @@ 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 (skip_prefix(value, "!", &dst->command))
+       else if (value[0] == '!') {
                dst->type = SM_UPDATE_COMMAND;
-       else
+               dst->command = xstrdup(value + 1);
+       } 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     | 239 ++++++++++++++++++++++++++++++++++++++++
 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, 405 insertions(+), 49 deletions(-)
-- 
2.7.0.rc0.34.g65aed89
Next: Stefan Beller
Message 1 of 13 in “[PATCHv13 0/7] Expose submodule parallelism to the user”
  1. Stefan BellerFeb 18, 2016
  2. 1/7 submodule-config: keep update strategy aroundStefan Beller, Feb 18, 2016
  3. 2/7 submodule-config: drop check against NULLStefan Beller, Feb 18, 2016
  4. 3/7 fetching submodules: respect `submodule.fetchJobs` config optionStefan Beller, Feb 18, 2016
  5. 4/7 submodule update: direct error message to stderrStefan Beller, Feb 18, 2016
  6. 5/7 git submodule update: have a dedicated helper for cloningStefan Beller, Feb 18, 2016
  7. Jeff KingFeb 19, 2016
  8. Stefan BellerFeb 19, 2016
  9. Eric SunshineFeb 19, 2016
  10. Jeff KingFeb 19, 2016
  11. Stefan BellerFeb 19, 2016
  12. 6/7 submodule update: expose parallelism to the userStefan Beller, Feb 18, 2016
  13. 7/7 clone: allow an explicit argument for parallel submodule clonesStefan Beller, Feb 18, 2016

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.