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

Re: [GSoC][PATCH v5] submodule: port subcommand 'set-branch' from shell to C

From
Shourya Shukla <shouryashukla.oo@gmail.com>
Date
Jun 4, 2020, 07:17 UTC
Message-ID
<20200604071719.GC8686@konoha>
In-Reply-To
<xmqqtuzrrk8r.fsf@gitster.c.googlers.com>
On 03/06 01:02, Junio C Hamano wrote:
Show 16 quoted lines
> I'd expect that when that day with no scripted parts of "git
> submodule" remains comes, the main entry point functions in
> builtin/submodule--helper.c (like module_list(), update_clone(),
> module_set_branch(), etc.) will become helper functions that live in
> submodule-lib.c and would be called from builtin/submodule.c.  And
> the conversion would rip out calls to parse_options() in each of
> these functions that would migrate to submodule-lib.c
> 
>     Side note: instead of adding submodule-lib.c, you could add them
>     directly to submodule.c if they are small enough.  I am however
>     modeling after how the "diff" family was converted to C; the
>     diff-lib.c layer is "library-ish helpers that get pre-parsed
>     command line arguments and performs a single unit of work" that
>     utilizes service routines at the lower layer that are in diff.c
>     and submodule-lib.c and submodule.c will be in a similar kind of
>     relationship.

There does exist a `submodule.c` outside of `builtin/` which has various helper functions. Will that require renaming to `submodule-lib.c`? BTW `set-branch` is a subcommand of `git submodule` so do we have to put it into `submodule-lib.c` if there were to be one? What is the motivation behind modelling it on the diff-family?

Previous: Junio C HamanoNext: Christian Couder
Message 22 of 29 in “submodule: port subcommand 'set-branch' from shell to C”
  1. submodule: port subcommand 'set-branch' from shell to CShourya Shukla, May 21, 2020
  2. Junio C HamanoMay 21, 2020
  3. Denton LiuMay 21, 2020
  4. Junio C HamanoMay 21, 2020
  5. Shourya ShuklaMay 22, 2020
  6. Junio C HamanoMay 24, 2020
  7. Đoàn Trần Công DanhMay 21, 2020
  8. Johannes SchindelinMay 22, 2020
  9. Junio C HamanoMay 24, 2020
  10. Junio C HamanoMay 24, 2020
  11. submodule: port subcommand 'set-branch' from shell to CShourya Shukla, May 23, 2020
  12. Kaartic SivaraamMay 23, 2020
  13. Đoàn Trần Công DanhMay 23, 2020
  14. Shourya ShuklaMay 27, 2020
  15. Đoàn Trần Công DanhMay 28, 2020
  16. Đoàn Trần Công DanhMay 28, 2020
  17. Đoàn Trần Công DanhMay 28, 2020
  18. [GSoC][PATCH v5] submodule: port subcommand 'set-branch' from shell to CShourya Shukla, Jun 2, 2020
  19. Junio C HamanoJun 2, 2020
  20. Đoàn Trần Công DanhJun 3, 2020
  21. Junio C HamanoJun 3, 2020
  22. Shourya ShuklaJun 4, 2020
  23. Christian CouderJun 4, 2020
  24. Junio C HamanoJun 4, 2020
  25. Kaartic SivaraamJun 2, 2020
  26. Kaartic SivaraamJun 2, 2020
  27. Christian CouderJun 2, 2020
  28. Shourya ShuklaJun 4, 2020
  29. Kaartic SivaraamJun 4, 2020

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.