From: Jens Lehmann <Jens.Lehmann@web.de>
To: Git Mailing List <git@vger.kernel.org>
Cc: Junio C Hamano <gitster@pobox.com>,
Jonathan Nieder <jrnieder@gmail.com>,
Heiko Voigt <hvoigt@hvoigt.net>,
"W. Trevor King" <wking@tremily.us>
Subject: [WIP/PATCH 4/9] Teach merge the --[no-]recurse-submodules option
Date: Mon, 03 Feb 2014 20:50:41 +0100 [thread overview]
Message-ID: <52EFF311.1090202@web.de> (raw)
In-Reply-To: <52EFF25E.6080306@web.de>
This new option will allow the user to not only update the work tree of
the superproject according to the merge result but to also update the
work tree of all initialized submodules (so they match the SHA-1 recorded
in the superproject). But this commit only adds the option without any
functionality, that will be added to unpack_trees() in subsequent commits.
Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
---
Documentation/git-merge.txt | 2 ++
builtin/merge.c | 14 ++++++++++++++
2 files changed, 16 insertions(+)
diff --git a/Documentation/git-merge.txt b/Documentation/git-merge.txt
index 4395459..9ed1655 100644
--- a/Documentation/git-merge.txt
+++ b/Documentation/git-merge.txt
@@ -96,6 +96,8 @@ commit or stash your changes before running 'git merge'.
'git merge --abort' is equivalent to 'git reset --merge' when
`MERGE_HEAD` is present.
+include::recurse-submodules-update.txt[]
+
<commit>...::
Commits, usually other branch heads, to merge into our branch.
Specifying more than one commit will create a merge with
diff --git a/builtin/merge.c b/builtin/merge.c
index 4941a6c..a0eb665 100644
--- a/builtin/merge.c
+++ b/builtin/merge.c
@@ -28,6 +28,7 @@
#include "remote.h"
#include "fmt-merge-msg.h"
#include "gpg-interface.h"
+#include "submodule.h"
#define DEFAULT_TWOHEAD (1<<0)
#define DEFAULT_OCTOPUS (1<<1)
@@ -65,6 +66,8 @@ static int abort_current_merge;
static int show_progress = -1;
static int default_to_upstream;
static const char *sign_commit;
+static const char *recurse_submodules_default = "off";
+static int recurse_submodules = RECURSE_SUBMODULES_DEFAULT;
static struct strategy all_strategy[] = {
{ "recursive", DEFAULT_TWOHEAD | NO_TRIVIAL },
@@ -223,6 +226,12 @@ static struct option builtin_merge_options[] = {
{ OPTION_STRING, 'S', "gpg-sign", &sign_commit, N_("key id"),
N_("GPG sign commit"), PARSE_OPT_OPTARG, NULL, (intptr_t) "" },
OPT_BOOL(0, "overwrite-ignore", &overwrite_ignore, N_("update ignored files (default)")),
+ { OPTION_CALLBACK, 0, "recurse-submodules", &recurse_submodules,
+ "checkout", "control recursive updating of submodules",
+ PARSE_OPT_OPTARG, option_parse_update_submodules },
+ { OPTION_STRING, 0, "recurse-submodules-default",
+ &recurse_submodules_default, NULL,
+ "default mode for recursion", PARSE_OPT_HIDDEN },
OPT_END()
};
@@ -1113,6 +1122,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
else
head_commit = lookup_commit_or_die(head_sha1, "HEAD");
+ gitmodules_config();
git_config(git_merge_config, NULL);
if (branch_mergeoptions)
@@ -1121,6 +1131,10 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
builtin_merge_usage, 0);
if (shortlog_len < 0)
shortlog_len = (merge_log_config > 0) ? merge_log_config : 0;
+ set_config_update_recurse_submodules(
+ parse_update_recurse_submodules_arg("--recurse-submodules-default",
+ recurse_submodules_default),
+ recurse_submodules);
if (verbosity < 0 && show_progress == -1)
show_progress = 0;
--
1.9.rc0.28.ge3363ff
next prev parent reply other threads:[~2014-02-03 19:50 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-06 22:36 What's cooking in git.git (Jan 2014, #01; Mon, 6) Junio C Hamano
2014-01-06 23:16 ` Francesco Pretto
2014-01-06 23:32 ` Junio C Hamano
2014-01-06 23:45 ` Francesco Pretto
2014-01-07 17:49 ` Jens Lehmann
[not found] ` <xmqqvbxvekwv.fsf@gitster.dls.corp.google.com>
2014-02-03 19:47 ` [WIP/PATCH 0/9] v2 submodule recursive checkout] Jens Lehmann
2014-02-03 19:48 ` [WIP/PATCH 1/9] submodule: prepare for recursive checkout of submodules Jens Lehmann
2014-02-03 22:23 ` Junio C Hamano
2014-02-07 21:06 ` Jens Lehmann
2014-02-04 0:01 ` Jonathan Nieder
2014-02-07 21:01 ` Jens Lehmann
2014-02-03 19:49 ` [WIP/PATCH 2/9] Teach reset the --[no-]recurse-submodules option Jens Lehmann
2014-02-03 22:40 ` Junio C Hamano
2014-02-07 21:09 ` Jens Lehmann
2014-02-03 19:50 ` [WIP/PATCH 3/9] Teach checkout " Jens Lehmann
2014-02-03 22:56 ` Junio C Hamano
2014-02-07 21:12 ` Jens Lehmann
2014-02-03 19:50 ` Jens Lehmann [this message]
2014-02-03 23:01 ` [WIP/PATCH 4/9] Teach merge " Junio C Hamano
2014-02-07 21:23 ` Jens Lehmann
2014-02-07 22:00 ` Junio C Hamano
2014-02-07 22:08 ` W. Trevor King
2014-02-03 19:51 ` [WIP/PATCH 5/9] Teach bisect--helper " Jens Lehmann
2014-02-03 19:51 ` [WIP/PATCH 6/9] Teach bisect " Jens Lehmann
2014-02-03 20:04 ` W. Trevor King
2014-02-03 20:22 ` Jens Lehmann
2014-02-03 19:52 ` [WIP/PATCH 7/9] submodule: teach unpack_trees() to remove submodule contents Jens Lehmann
2014-02-03 20:10 ` W. Trevor King
2014-02-07 21:24 ` Jens Lehmann
2014-02-03 19:53 ` [WIP/PATCH 8/9] submodule: teach unpack_trees() to repopulate submodules Jens Lehmann
2014-02-03 19:54 ` [WIP/PATCH 9/9] submodule: teach unpack_trees() to update submodules Jens Lehmann
2014-02-03 20:19 ` W. Trevor King
2014-02-07 21:25 ` Jens Lehmann
2014-02-04 0:11 ` Duy Nguyen
2014-02-07 21:32 ` Jens Lehmann
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=52EFF311.1090202@web.de \
--to=jens.lehmann@web.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=hvoigt@hvoigt.net \
--cc=jrnieder@gmail.com \
--cc=wking@tremily.us \
/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).