From: Prathamesh Chavan Date: Fri, 6 Oct 2017 13:24:15 +0000 (+0530) Subject: submodule: port submodule subcommand 'status' from shell to C X-Git-Tag: v2.16.0-rc0~167^2 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/a9f8a37584a6d3e4702ce115476bebda20d871d3?hp=a9f8a37584a6d3e4702ce115476bebda20d871d3 submodule: port submodule subcommand 'status' from shell to C This aims to make git-submodule 'status' a built-in. Hence, the function cmd_status() is ported from shell to C. This is done by introducing four functions: module_status(), submodule_status_cb(), submodule_status() and print_status(). The function module_status() acts as the front-end of the subcommand. It parses subcommand's options and then calls the function module_list_compute() for computing the list of submodules. Then this functions calls for_each_listed_submodule() looping through the list obtained. Then for_each_listed_submodule() calls submodule_status_cb() for each of the submodule in its list. The function submodule_status_cb() calls submodule_status() after passing appropriate arguments to the funciton. Function submodule_status() is responsible for generating the status each submodule it is called for, and then calls print_status(). Finally, the function print_status() handles the printing of submodule's status. Function set_name_rev() is also ported from git-submodule to the submodule--helper builtin function compute_rev_name(), which now generates the value of the revision name as required. Mentored-by: Christian Couder Mentored-by: Stefan Beller Signed-off-by: Prathamesh Chavan Signed-off-by: Junio C Hamano ---