git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Second round of support for cloning submodules
@ 2007-05-18 19:24 skimo
  2007-05-18 19:24 ` [PATCH 01/16] Add dump-config skimo
                   ` (16 more replies)
  0 siblings, 17 replies; 64+ messages in thread
From: skimo @ 2007-05-18 19:24 UTC (permalink / raw)
  To: git, Junio C Hamano

From: Sven Verdoolaege <skimo@kotnet.org>

This patch series implements a mechanism for cloning submodules.
Each submodule is specified by a 'submodule.<submodule>.url'
configuration option, e.g.,

bash-3.00$ ./git-config --remote=http://www.liacs.nl/~sverdool/isa.git --get-regexp 'submodule\..*\.url' 
submodule.cloog.url /home/sverdool/public_html/cloog.git
submodule.cloog.url http://www.liacs.nl/~sverdool/cloog.git

git-clone will use the first url that works.
E.g., a

git clone --submodules ssh://liacs/~/public_html/isa.git

(which only works for me), will use the first url, while a

git clone --submodules http://www.liacs.nl/~sverdool/isa.git

will use the second.

The cloning of submodules is now handled inside git-fetch.

skimo

^ permalink raw reply	[flat|nested] 64+ messages in thread
* [PATCH] allow commands to be executed in submodules
@ 2007-05-20 15:39 Martin Waitz
  2007-05-20 18:14 ` Alex Riesen
  0 siblings, 1 reply; 64+ messages in thread
From: Martin Waitz @ 2007-05-20 15:39 UTC (permalink / raw)
  To: git

Add an extra "submodule" field to struct child_process to be able to
easily start commands which are to be executed in a submodule
repository.

Signed-off-by: Martin Waitz <tali@admingilde.org>
---

 run-command.c     |   13 ++++++
 run-command.h     |    1 +
 2 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/run-command.c b/run-command.c
index eff523e..c2475e4 100644
--- a/run-command.c
+++ b/run-command.c
@@ -73,6 +73,19 @@ int start_command(struct child_process *cmd)
 			close(cmd->out);
 		}
 
+		if (cmd->submodule) {
+			int err = chdir(cmd->submodule);
+			if (err) {
+				die("cannot exec %s in %s.",
+					cmd->argv[0], cmd->submodule);
+			}
+			/* don't inherit supermodule environment */
+			unsetenv(GIT_DIR_ENVIRONMENT);
+			unsetenv(DB_ENVIRONMENT);
+			unsetenv(INDEX_ENVIRONMENT);
+			unsetenv(GRAFT_ENVIRONMENT);
+		}
+
 		if (cmd->git_cmd) {
 			execv_git_cmd(cmd->argv);
 		} else {
diff --git a/run-command.h b/run-command.h
index 3680ef9..2940186 100644
--- a/run-command.h
+++ b/run-command.h
@@ -16,6 +16,7 @@ struct child_process {
 	pid_t pid;
 	int in;
 	int out;
+	const char *submodule;
 	unsigned close_in:1;
 	unsigned close_out:1;
 	unsigned no_stdin:1;
-- 
1.5.2.2.g081e


-- 
Martin Waitz

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

end of thread, other threads:[~2007-05-25 22:11 UTC | newest]

Thread overview: 64+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-18 19:24 Second round of support for cloning submodules skimo
2007-05-18 19:24 ` [PATCH 01/16] Add dump-config skimo
2007-05-18 19:24 ` [PATCH 02/16] git-config: add --remote option for reading config from remote repo skimo
2007-05-18 19:24 ` [PATCH 03/16] http.h: make fill_active_slots a function pointer skimo
2007-05-18 19:24 ` [PATCH 04/16] git-config: read remote config files over HTTP skimo
2007-05-18 19:24 ` [PATCH 05/16] unpack-trees.c: verify_uptodate: remove dead code skimo
2007-05-18 22:33   ` Junio C Hamano
2007-05-18 19:24 ` [PATCH 06/16] unpack-trees.c: pass cache_entry * to verify_absent rather than just the name skimo
2007-05-18 19:24 ` [PATCH 07/16] git-read-tree: take --submodules option skimo
2007-05-18 21:53   ` Alex Riesen
2007-05-18 22:08     ` Sven Verdoolaege
2007-05-18 22:42       ` Alex Riesen
2007-05-19  3:59         ` Junio C Hamano
2007-05-19  4:27           ` Shawn O. Pearce
2007-05-19  9:19           ` Alex Riesen
2007-05-19 13:05           ` Sven Verdoolaege
2007-05-19 18:20             ` Junio C Hamano
2007-05-20 15:54               ` Jan Hudec
2007-05-20 18:33                 ` Junio C Hamano
2007-05-20 20:22                   ` Sven Verdoolaege
2007-05-21 16:59                   ` Jan Hudec
2007-05-21 18:05                     ` Sven Verdoolaege
2007-05-21 19:01                       ` Junio C Hamano
2007-05-21 20:02                       ` Jan Hudec
2007-05-21 21:11                     ` Martin Waitz
2007-05-22 19:37                       ` Jan Hudec
2007-05-24 15:48                         ` Martin Waitz
2007-05-25 10:06                           ` Jakub Narebski
2007-05-25 20:15                           ` Jan Hudec
2007-05-24 18:26                       ` Junio C Hamano
2007-05-24 18:45                         ` Sven Verdoolaege
2007-05-24 18:58                           ` Junio C Hamano
2007-05-24 19:14                             ` Sven Verdoolaege
2007-05-24 20:32                               ` Junio C Hamano
2007-05-24 20:55                                 ` Petr Baudis
2007-05-24 20:59                                   ` Junio C Hamano
2007-05-24 19:43                         ` Junio C Hamano
2007-05-24 20:57                         ` Petr Baudis
2007-05-25 20:35                         ` Jan Hudec
2007-05-25 21:05                           ` Junio C Hamano
2007-05-25 21:16                             ` Steven Grimm
2007-05-25 22:11                               ` Junio C Hamano
2007-05-19  0:34   ` Petr Baudis
2007-05-18 19:24 ` [PATCH 08/16] unpack-trees.c: assume submodules are clean skimo
2007-05-18 19:24 ` [PATCH 09/16] entry.c: optionally checkout submodules skimo
2007-05-18 21:56   ` Alex Riesen
2007-05-18 22:03     ` Sven Verdoolaege
2007-05-18 22:33       ` Alex Riesen
2007-05-18 22:00   ` Alex Riesen
2007-05-18 22:20     ` [PATCH] Add run_command_v_opt_cd: chdir into a directory before exec Alex Riesen
2007-05-18 22:48       ` [PATCH] Use run_command_v_opt_cd when checking out a submodule Alex Riesen
2007-05-18 19:24 ` [PATCH 10/16] git-checkout: pass --submodules option to git-read-tree skimo
2007-05-19  0:36   ` Petr Baudis
2007-05-18 19:25 ` [PATCH 11/16] git-fetch: skip empty arguments skimo
2007-05-18 22:33   ` Junio C Hamano
2007-05-18 19:25 ` [PATCH 12/16] builtin-fetch--tool: extend "native-store" for use in cloning skimo
2007-05-18 22:52   ` Alex Riesen
2007-05-19 12:17     ` Sven Verdoolaege
2007-05-18 19:25 ` [PATCH 13/16] git-clone: rely on git-fetch for fetching for most protocols skimo
2007-05-18 19:25 ` [PATCH 14/16] git-clone: rely on git-fetch for non-bare fetching over http skimo
2007-05-18 19:25 ` [PATCH 15/16] git-read-tree: treat null commit as empty tree skimo
2007-05-18 19:25 ` [PATCH 16/16] git-clone: add --submodules for cloning submodules skimo
2007-05-18 19:34 ` Second round of support " Sven Verdoolaege
  -- strict thread matches above, loose matches on Subject: below --
2007-05-20 15:39 [PATCH] allow commands to be executed in submodules Martin Waitz
2007-05-20 18:14 ` Alex Riesen
     [not found]   ` <20070521090339.GH942MdfPADPa@greensroom.kotnet.org>
2007-05-21 22:48     ` [PATCH] Add ability to specify environment extension to run_command Alex Riesen
2007-05-21 23:02       ` Junio C Hamano
2007-05-22 21:47         ` Alex Riesen
2007-05-22 21:48           ` [PATCH] Add run_command_v_opt_cd: chdir into a directory before exec Alex Riesen

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