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

Re: [GSoC][PATCH 08/13] submodule: port submodule subcommand 'summary' from shell to C

From
Christian Couder <christian.couder@gmail.com>
Date
Aug 5, 2017, 16:55 UTC
Message-ID
<CAP8UFD2oqdaQqVwuGqqj9OOnm5Pyufpck=rod0UFQEWrROJsXQ@mail.gmail.com>
In-Reply-To
<CAME+mvUAspzuzbB4pFiQeOtT7NGRTO25M-k8o8hoysMFLGy_0w@mail.gmail.com>
On Sat, Aug 5, 2017 at 12:28 PM, Prathamesh Chavan <pc44800@gmail.com> wrote:
Show 10 quoted lines
> On Tue, Aug 1, 2017 at 4:57 AM, Christian Couder
> <christian.couder@gmail.com> wrote:
>> On Mon, Jul 31, 2017 at 10:56 PM, Prathamesh Chavan <pc44800@gmail.com> wrote:
>>
> We can avoid it to behave same for "" and NULL, by checking if diff_cmd
> is "cmd_diff_files", since its value is set NULL by this case.
>
> ret = compute_summary_module_list(strcmp(diff_cmd, "diff-files") ?
> NULL: sb.buf, &info);
> strbuf_release(&sb);
It looks error prone, more fagile and less efficient to me.
> instead of:
> ret = compute_summary_module_list(sb.len ? sb.buf : NULL, &info);
> if (sb.len)
> strbuf_release(&sb);

I think it is ok to call strbuf_release(&sb) many times, so the "if (sb.len)" check above is not needed.

Previous: Prathamesh ChavanNext: Prathamesh Chavan
Message 18 of 25 in “Update: Week-11”
  1. Prathamesh ChavanJul 31, 2017
  2. [GSoC][PATCH 01/13] submodule--helper: introduce get_submodule_displaypath()Prathamesh Chavan, Jul 31, 2017
  3. [GSoC][PATCH 02/13] submodule--helper: introduce for_each_submodule_list()Prathamesh Chavan, Jul 31, 2017
  4. [GSoC][PATCH 03/13] submodule: port set_name_rev() from shell to CPrathamesh Chavan, Jul 31, 2017
  5. [GSoC][PATCH 04/13] submodule: port submodule subcommand 'status' from shell to CPrathamesh Chavan, Jul 31, 2017
  6. Stefan BellerJul 31, 2017
  7. Prathamesh ChavanAug 1, 2017
  8. [GSoC][PATCH 05/13] submodule: port submodule subcommand 'sync' from shell to CPrathamesh Chavan, Jul 31, 2017
  9. Stefan BellerJul 31, 2017
  10. [GSoC][PATCH 06/13] submodule: port submodule subcommand 'deinit' from shell to CPrathamesh Chavan, Jul 31, 2017
  11. Stefan BellerJul 31, 2017
  12. Prathamesh ChavanAug 1, 2017
  13. [GSoC][PATCH 07/13] diff: change scope of the function count_lines()Prathamesh Chavan, Jul 31, 2017
  14. [GSoC][PATCH 08/13] submodule: port submodule subcommand 'summary' from shell to CPrathamesh Chavan, Jul 31, 2017
  15. Stefan BellerJul 31, 2017
  16. Christian CouderJul 31, 2017
  17. Prathamesh ChavanAug 5, 2017
  18. Christian CouderAug 5, 2017
  19. Prathamesh ChavanAug 5, 2017
  20. [GSoC][PATCH 09/13] submodule foreach: correct '$path' in nested submodules from a subdirectoryPrathamesh Chavan, Jul 31, 2017
  21. [GSoC][PATCH 10/13] submodule foreach: document '$sm_path' instead of '$path'Prathamesh Chavan, Jul 31, 2017
  22. [GSoC][PATCH 11/13] submodule foreach: clarify the '$toplevel' variable documentationPrathamesh Chavan, Jul 31, 2017
  23. [GSoC][PATCH 12/13] submodule foreach: document variable '$displaypath'Prathamesh Chavan, Jul 31, 2017
  24. [GSoC][PATCH 13/13] submodule: port submodule subcommand 'foreach' from shell to CPrathamesh Chavan, Jul 31, 2017
  25. Stefan BellerJul 31, 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.