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

Re: [PATCH v4] submodule: port subcommand 'set-url' from shell to C

From
Shourya Shukla <shouryashukla.oo@gmail.com>
Date
May 6, 2020, 16:31 UTC
Message-ID
<20200506163128.GA14899@konoha>
In-Reply-To
<CAP8UFD0o7WwibV8+cwYOO949BkBggSphi0zbgPUZsk6nfvYyHQ@mail.gmail.com>
On 06/05 10:09, Christian Couder wrote:
Show 10 quoted lines
> > +       strbuf_addf(&config_name, "submodule.%s.url", path);
> > +
> > +       config_set_in_gitmodules_file_gently(config_name.buf, newurl);
> > +       sync_submodule(path, prefix, quiet ? OPT_QUIET : 0);
> > +
> > +       strbuf_release(&config_name);
> 
> Nit: it might be a bit simpler to define config_name as a "char *",
> and then use xstrfmt() and free() instead of strbuf_addf() and
> strbuf_release().

Apart from the simplicity purposes, does doing this aid in performance in any way?

> > +       return 0;
> > +}
Previous: Christian CouderNext: Junio C Hamano
Message 3 of 22 in “submodule: port subcommand 'set-url' from shell to C”
  1. submodule: port subcommand 'set-url' from shell to CShourya Shukla, May 6, 2020
  2. Christian CouderMay 6, 2020
  3. Shourya ShuklaMay 6, 2020
  4. Junio C HamanoMay 6, 2020
  5. Junio C HamanoMay 6, 2020
  6. Shourya ShuklaMay 6, 2020
  7. Junio C HamanoMay 6, 2020
  8. Shourya ShuklaMay 7, 2020
  9. Junio C HamanoMay 7, 2020
  10. Shourya ShuklaMay 8, 2020
  11. Christian CouderMay 8, 2020
  12. Re* [PATCH v4] submodule: port subcommand 'set-url' from shell to CJunio C Hamano, May 8, 2020
  13. Eric SunshineMay 8, 2020
  14. Junio C HamanoMay 8, 2020
  15. Eric SunshineMay 8, 2020
  16. Junio C HamanoMay 8, 2020
  17. Eric SunshineMay 8, 2020
  18. submodule: port subcommand 'set-url' from shell to CShourya Shukla, May 8, 2020
  19. Denton LiuMay 8, 2020
  20. Junio C HamanoMay 8, 2020
  21. Junio C HamanoMay 8, 2020
  22. submodule: port subcommand 'set-url' from shell to CJunio C Hamano, May 8, 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.