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

Re: [PATCH v6 0/8] port branch.c to use the filtering part of ref-filter.

From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Date
Sep 23, 2015, 19:00 UTC
Message-ID
<vpqsi65t0yi.fsf@grenoble-inp.fr>
In-Reply-To
<1443031873-25280-1-git-send-email-Karthik.188@gmail.com>
Karthik Nayak <karthik.188@gmail.com> writes:
Show 8 quoted lines
> --- a/builtin/branch.c
> +++ b/builtin/branch.c
> @@ -479,8 +479,6 @@ static void print_ref_list(struct ref_filter *filter, struct ref_sorting *sortin
>  	struct ref_array array;
>  	int maxwidth = 0;
>  	const char *remote_prefix = "";
> -	struct ref_sorting def_sorting;
> -	const char *sort_type = "refname";
This was allocated on stack ...
> @@ -498,12 +496,15 @@ static void print_ref_list(struct ref_filter *filter, struct ref_sorting *sortin
> +	if (!sorting)
> +		sorting = ref_default_sorting();

and it's now allocated by xcalloc within ref_default_sorting(). In theory, you need a free(). But the sensible place to add this free would be after the call to print_ref_list(), and this is right before the process terminates. So it's probably overkill to add a free().

The series looks good to me. I did a minor remark on PATCH 5/8 but this should not block inclusion.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Previous: Karthik NayakNext: Junio C Hamano
Message 20 of 27 in “port branch.c to use the filtering part of ref-filter.”
  1. 0/8 port branch.c to use the filtering part of ref-filter.Karthik Nayak, Sep 23, 2015
  2. 1/8 branch: refactor width computationKarthik Nayak, Sep 23, 2015
  3. 2/8 branch: bump get_head_description() to the topKarthik Nayak, Sep 23, 2015
  4. 3/8 branch: roll show_detached HEAD into regular ref_listKarthik Nayak, Sep 23, 2015
  5. 4/8 branch: move 'current' check down to the presentation layerKarthik Nayak, Sep 23, 2015
  6. 5/8 branch: drop non-commit error reportingKarthik Nayak, Sep 23, 2015
  7. Matthieu MoySep 23, 2015
  8. Karthik NayakSep 24, 2015
  9. Junio C HamanoSep 23, 2015
  10. Matthieu MoySep 23, 2015
  11. Junio C HamanoSep 23, 2015
  12. Junio C HamanoSep 23, 2015
  13. Junio C HamanoSep 23, 2015
  14. Matthieu MoySep 24, 2015
  15. Junio C HamanoSep 23, 2015
  16. Karthik NayakSep 24, 2015
  17. 6/8 branch.c: use 'ref-filter' data structuresKarthik Nayak, Sep 23, 2015
  18. 7/8 branch.c: use 'ref-filter' APIsKarthik Nayak, Sep 23, 2015
  19. 8/8 branch: add '--points-at' optionKarthik Nayak, Sep 23, 2015
  20. Matthieu MoySep 23, 2015
  21. Junio C HamanoSep 23, 2015
  22. Karthik NayakSep 24, 2015
  23. 5/8 branch: drop non-commit error reportingKarthik Nayak, Sep 24, 2015
  24. Matthieu MoySep 25, 2015
  25. Junio C HamanoSep 25, 2015
  26. Matthieu MoySep 25, 2015
  27. Karthik NayakSep 25, 2015

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.