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

Re: [PATCH] GSoC2014 microprojects #6 Change bundle.c:add_to_ref_list() to use ALLOC_GROW()

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 27, 2014, 19:44 UTC
Message-ID
<xmqqzjlcxrva.fsf@gitster.dls.corp.google.com>
In-Reply-To
<1393517894-670-1-git-send-email-sunheehnus@gmail.com>
Sun He <sunheehnus@gmail.com> writes:
> Signed-off-by: Sun He <sunheehnus@gmail.com>
> ---
The subject reads:
>> Subject: [PATCH] GSoC2014 microprojects #6 Change bundle.c:add_to_ref_list() to use ALLOC_GROW()

I do not think we want to see the leading part of it in our "git shortlog" output.

	Subject: [PATCH] bundle.c:add_to_ref_list(): use ALLOC_GROW()
or something, perhaps.
Show 20 quoted lines
>  bundle.c |    6 +-----
>  1 files changed, 1 insertions(+), 5 deletions(-)
>
> diff --git a/bundle.c b/bundle.c
> index 7809fbb..1a7b7eb 100644
> --- a/bundle.c
> +++ b/bundle.c
> @@ -14,11 +14,7 @@ static const char bundle_signature[] = "# v2 git bundle\n";
>  static void add_to_ref_list(const unsigned char *sha1, const char *name,
>  		struct ref_list *list)
>  {
> -	if (list->nr + 1 >= list->alloc) {
> -		list->alloc = alloc_nr(list->nr + 1);
> -		list->list = xrealloc(list->list,
> -				list->alloc * sizeof(list->list[0]));
> -	}
> +    ALLOC_GROW(list->list,list->nr,list->alloc);
>  	hashcpy(list->list[list->nr].sha1, sha1);
>  	list->list[list->nr].name = xstrdup(name);
>  	list->nr++;
Previous: Philip OakleyNext: Michael Haggerty
Message 3 of 4 in “GSoC2014 microprojects #6 Change bundle.c:add_to_ref_list() to use ALLOC_GROW()”
  1. GSoC2014 microprojects #6 Change bundle.c:add_to_ref_list() to use ALLOC_GROW()Sun He, Feb 27, 2014
  2. Philip OakleyFeb 27, 2014
  3. Junio C HamanoFeb 27, 2014
  4. Michael HaggertyFeb 27, 2014

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.