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

Re: [PATCH 2/2] fetch-pack: refactor writing promisor file

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 12, 2021, 20:59 UTC
Message-ID
<xmqqwnwh3m8u.fsf@gitster.c.googlers.com>
In-Reply-To
<20210112082159.2277214-2-chriscool@tuxfamily.org>
Christian Couder <christian.couder@gmail.com> writes:
Show 10 quoted lines
> +void write_promisor_file(const char *promisor_name, struct ref **sought, int nr_sought)
> +{
> +	int i;
> +	FILE *output = xfopen(promisor_name, "w");
> +
> +	for (i = 0; i < nr_sought; i++)
> +		fprintf(output, "%s %s\n", oid_to_hex(&sought[i]->old_oid),
> +			sought[i]->name);
> +	fclose(output);
> +}

Ah, nevermind. This has its output format baked into the code and it wants to show object name and which ref it is on, so as long as we are happy with the format (do we read the contents and use it in any way, by the way?), it is reasonable to expect any new caller to have "struct ref" or an array of it.

Thanks.
Previous: Taylor BlauNext: Junio C Hamano
Message 4 of 7 in “fetch-pack: rename helper to create_promisor_file()”
  1. 1/2 fetch-pack: rename helper to create_promisor_file()Christian Couder, Jan 12, 2021
  2. 2/2 fetch-pack: refactor writing promisor fileChristian Couder, Jan 12, 2021
  3. Taylor BlauJan 12, 2021
  4. Junio C HamanoJan 12, 2021
  5. Junio C HamanoJan 12, 2021
  6. Jeff KingJan 13, 2021
  7. Taylor BlauJan 13, 2021

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.