From: Stefan Beller <sbeller@google.com>
To: git@vger.kernel.org
Cc: Stefan Beller <sbeller@google.com>
Subject: [PATCH 07/12] submodule config: keep update strategy around
Date: Thu, 15 Oct 2015 18:52:08 -0700 [thread overview]
Message-ID: <1444960333-16003-8-git-send-email-sbeller@google.com> (raw)
In-Reply-To: <1444960333-16003-1-git-send-email-sbeller@google.com>
We need the submodule update strategies in a later patch.
Signed-off-by: Stefan Beller <sbeller@google.com>
---
submodule-config.c | 11 +++++++++++
submodule-config.h | 1 +
2 files changed, 12 insertions(+)
diff --git a/submodule-config.c b/submodule-config.c
index 393de53..175bcbb 100644
--- a/submodule-config.c
+++ b/submodule-config.c
@@ -194,6 +194,7 @@ static struct submodule *lookup_or_create_by_name(struct submodule_cache *cache,
submodule->path = NULL;
submodule->url = NULL;
+ submodule->update = NULL;
submodule->fetch_recurse = RECURSE_SUBMODULES_NONE;
submodule->ignore = NULL;
@@ -326,6 +327,16 @@ static int parse_config(const char *var, const char *value, void *data)
free((void *) submodule->url);
strbuf_addstr(&url, value);
submodule->url = strbuf_detach(&url, NULL);
+ } else if (!strcmp(item.buf, "update")) {
+ if (!value)
+ ret = config_error_nonbool(var);
+ else if (!me->overwrite && submodule->update != NULL)
+ warn_multiple_config(me->commit_sha1, submodule->name,
+ "update");
+ else {
+ free((void *)submodule->update);
+ submodule->update = xstrdup(value);
+ }
}
release_return:
diff --git a/submodule-config.h b/submodule-config.h
index 9061e4e..f9e2a29 100644
--- a/submodule-config.h
+++ b/submodule-config.h
@@ -14,6 +14,7 @@ struct submodule {
const char *url;
int fetch_recurse;
const char *ignore;
+ const char *update;
/* the sha1 blob id of the responsible .gitmodules file */
unsigned char gitmodules_sha1[20];
};
--
2.5.0.277.gfdc362b.dirty
next prev parent reply other threads:[~2015-10-16 1:52 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-16 1:52 [RFC PATCHv1 00/12] git submodule update in C with parallel cloning Stefan Beller
2015-10-16 1:52 ` [PATCH 01/12] git submodule update: Announce skipping submodules on stderr Stefan Beller
2015-10-16 20:37 ` Junio C Hamano
2015-10-16 20:47 ` Stefan Beller
2015-10-16 1:52 ` [PATCH 02/12] git submodule update: Announce uninitialized modules " Stefan Beller
2015-10-16 20:54 ` Junio C Hamano
2015-10-16 1:52 ` [PATCH 03/12] git submodule update: Move branch calculation to where it's needed Stefan Beller
2015-10-16 20:54 ` Junio C Hamano
2015-10-16 1:52 ` [PATCH 04/12] git submodule update: Announce outcome of submodule operation to stderr Stefan Beller
2015-10-16 1:52 ` [PATCH 05/12] git submodule update: Use its own list implementation Stefan Beller
2015-10-16 21:02 ` Junio C Hamano
2015-10-16 21:08 ` Stefan Beller
2015-10-16 1:52 ` [PATCH 06/12] git submodule update: Handle unmerged submodules in C Stefan Beller
2015-10-20 21:11 ` Junio C Hamano
2015-10-20 21:21 ` Stefan Beller
2015-10-16 1:52 ` Stefan Beller [this message]
2015-10-16 1:52 ` [PATCH 08/12] git submodule update: check for "none" " Stefan Beller
2015-10-16 1:52 ` [PATCH 09/12] git submodule update: Check url " Stefan Beller
2015-10-16 1:52 ` [PATCH 10/12] git submodule update: Clone projects from within C Stefan Beller
2015-10-16 1:52 ` [PATCH 11/12] submodule--helper: Do not emit submodules to process directly Stefan Beller
2015-10-16 1:52 ` [PATCH 12/12] WIP/broken Clone all outstanding submodules in parallel 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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1444960333-16003-8-git-send-email-sbeller@google.com \
--to=sbeller@google.com \
--cc=git@vger.kernel.org \
/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).