summaryrefslogtreecommitdiff
path: root/git.c
diff options
context:
space:
mode:
authorStefan Beller <sbeller@google.com>2015-09-02 14:42:24 -0700
committerJunio C Hamano <gitster@pobox.com>2015-09-03 14:12:40 -0700
commit74703a1e4dfc5affcb8944e78b53f0817b492246 (patch)
treea3f41ccf0a838804fd763bb44fba08d85f91c1ca /git.c
parent5a1ba6b48a62bf55f9c8305d9850c3a8d22365c5 (diff)
downloadgit-74703a1e4dfc5affcb8944e78b53f0817b492246.tar.gz
submodule: rewrite `module_list` shell function in C
Most of the submodule operations work on a set of submodules. Calculating and using this set is usually done via: module_list "$@" | { while read mode sha1 stage sm_path do # the actual operation done } Currently the function `module_list` is implemented in the git-submodule.sh as a shell script wrapping a perl script. The rewrite is in C, such that it is faster and can later be easily adapted when other functions are rewritten in C. git-submodule.sh, similar to the builtin commands, will navigate to the top-most directory of the repository and keep the subdirectory as a variable. As the helper is called from within the git-submodule.sh script, we are already navigated to the root level, but the path arguments are still relative to the subdirectory we were in when calling git-submodule.sh. That's why there is a `--prefix` option pointing to an alternative path which to anchor relative path arguments. Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git.c')
-rw-r--r--git.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/git.c b/git.c
index 55c327c7b3..deecba032f 100644
--- a/git.c
+++ b/git.c
@@ -469,6 +469,7 @@ static struct cmd_struct commands[] = {
{ "stage", cmd_add, RUN_SETUP | NEED_WORK_TREE },
{ "status", cmd_status, RUN_SETUP | NEED_WORK_TREE },
{ "stripspace", cmd_stripspace },
+ { "submodule--helper", cmd_submodule__helper, RUN_SETUP },
{ "symbolic-ref", cmd_symbolic_ref, RUN_SETUP },
{ "tag", cmd_tag, RUN_SETUP },
{ "unpack-file", cmd_unpack_file, RUN_SETUP },