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

Re: [PATCH] builtin/show-ref.c: avoid over-iterating with --heads, --tags

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 6, 2022, 17:07 UTC
Message-ID
<xmqq35ghaffn.fsf@gitster.g>
In-Reply-To
<af32aefc-8184-94ff-fd80-76221dc313b4@github.com>
Derrick Stolee <derrickstolee@github.com> writes:
Show 13 quoted lines
>> -	for_each_ref(show_ref, NULL);
>> +	if (heads_only || tags_only) {
>> +		if (heads_only)
>> +			for_each_fullref_in("refs/heads/", show_ref, NULL);
>> +		if (tags_only)
>> +			for_each_fullref_in("refs/tags/", show_ref, NULL);
>
> This looks a little silly if these were truly "only" (they
> could not both be true), but indeed they could both be true
> and the names are just slightly misleading.
>
> Indeed, t1403-show-ref.sh tests all combinations of these
> options.
Hmph, that is right. show-heads and show-tags, perhaps.
Thanks, both.  Queued.
Previous: Derrick Stolee
Message 3 of 3 in “builtin/show-ref.c: avoid over-iterating with --heads, --tags”
  1. builtin/show-ref.c: avoid over-iterating with --heads, --tagsTaylor Blau, Jun 3, 2022
  2. Derrick StoleeJun 4, 2022
  3. Junio C HamanoJun 6, 2022

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.