git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [GSoC][PATCH 4/5 v4] submodule: port submodule subcommand 'status' from shell to C

From
Stefan Beller <sbeller@google.com>
Date
Jul 13, 2017, 22:44 UTC
Message-ID
<CAGZ79kb18z5zc9iu3Vv5aVZWJmoZzmwbMVpy89VC-t-ei2M+bw@mail.gmail.com>
In-Reply-To
<20170713200538.25806-4-pc44800@gmail.com>
On Thu, Jul 13, 2017 at 1:05 PM, Prathamesh Chavan <pc44800@gmail.com> wrote:
Show 26 quoted lines
> 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
> three functions: module_status(), 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_submodule_list() looping through the
> list obtained.
>
> Then for_each_submodule_list() calls submodule_status() for each of the
> submodule in its list. The 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.
>
> Mentored-by: Christian Couder <christian.couder@gmail.com>
> Mentored-by: Stefan Beller <sbeller@google.com>
> Signed-off-by: Prathamesh Chavan <pc44800@gmail.com>
> ---
> In this new version of patch:
>
> Instead of using cmd_diff_files(), the process is optimized
> by using ce_match_stat().

Apart from this I have reviewed the patch and found it a faithful conversion.

I am not an expert in the diff area and wonder how the cmd_diff_files functionality is achieved with just a stat call and then comparing it to ce_match_stat. 'Using "dirty" ignores all changes to the work tree of submodules, only changes to the commits stored in the superproject are shown.' So I'd have expected ce->oid to be compared (is there an index entry differing, i.e. more than one stage?)

> Also, the child_process running the command 'rev-parse --verify HEAD'
> is removed for optimization reasons, and instead head_ref_submodule()
> is used with callback function handle_submodule_head_ref().
Cool.
Previous: Prathamesh ChavanNext: Prathamesh Chavan
Message 27 of 28 in “[GSoC] Update: Week 6”
  1. Prathamesh ChavanJun 26, 2017
  2. [GSoC][PATCH 1/6 v2] submodule--helper: introduce for_each_submodule_listPrathamesh Chavan, Jun 26, 2017
  3. [GSoC][PATCH 2/6 v2] submodule: port subcommand foreach from shell to CPrathamesh Chavan, Jun 26, 2017
  4. Christian CouderJun 27, 2017
  5. [GSoC][PATCH 3/6 v2] submodule: port set_name_rev from shell to CPrathamesh Chavan, Jun 26, 2017
  6. [GSoC][PATCH 6/6 v2] submodule: port submodule subcommand 'deinit' from shell to CPrathamesh Chavan, Jun 26, 2017
  7. Christian CouderJun 27, 2017
  8. [GSoC][PATCH 4/6 v2] submodule: port submodule subcommand statusPrathamesh Chavan, Jun 26, 2017
  9. [GSoC][PATCH 5/6 v2] submodule: port submodule subcommand sync from shell to CPrathamesh Chavan, Jun 26, 2017
  10. Christian CouderJun 27, 2017
  11. Junio C HamanoJun 28, 2017
  12. Prathamesh ChavanJun 29, 2017
  13. [GSoC][PATCH 1/5 v3] submodule--helper: introduce get_submodule_displaypath()Prathamesh Chavan, Jun 30, 2017
  14. [GSoC][PATCH 5/5 v3] submodule: port submodule subcommand 'sync' from shell to CPrathamesh Chavan, Jun 30, 2017
  15. Stefan BellerJun 30, 2017
  16. Junio C HamanoJun 30, 2017
  17. [GSoC][PATCH 2/5 v3] submodule--helper: introduce for_each_submodule_list()Prathamesh Chavan, Jun 30, 2017
  18. [GSoC][PATCH 4/5 v3] submodule: port submodule subcommand 'status' from shell to CPrathamesh Chavan, Jun 30, 2017
  19. Junio C HamanoJun 30, 2017
  20. [GSoC][PATCH 3/5 v3] submodule: port set_name_rev() from shell to CPrathamesh Chavan, Jun 30, 2017
  21. Junio C HamanoJun 30, 2017
  22. Junio C HamanoJun 30, 2017
  23. [GSoC][PATCH 1/5 v4] submodule--helper: introduce get_submodule_displaypath()Prathamesh Chavan, Jul 13, 2017
  24. [GSoC][PATCH 2/5 v4] submodule--helper: introduce for_each_submodule_list()Prathamesh Chavan, Jul 13, 2017
  25. [GSoC][PATCH 3/5 v4] submodule: port set_name_rev() from shell to CPrathamesh Chavan, Jul 13, 2017
  26. [GSoC][PATCH 4/5 v4] submodule: port submodule subcommand 'status' from shell to CPrathamesh Chavan, Jul 13, 2017
  27. Stefan BellerJul 13, 2017
  28. [GSoC][PATCH 5/5 v4] submodule: port submodule subcommand 'sync' from shell to CPrathamesh Chavan, Jul 13, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.