Subject: Re: [PATCH v3 5/7] refs: add pseudorefs array and iteration functions

From: Junio C Hamano <[email-masked]>
Date: Wed, 07 Feb 2024 14:02:56 -0800

Kousik Sanagavarapu <[email-masked]> writes:

> Andy Koppe <[email-masked]> wrote:
> ...
>> +static const char *const pseudorefs[] = {
>> +	"FETCH_HEAD",
>> +	"ORIG_HEAD",
>> +	"MERGE_HEAD",
>> +	"REBASE_HEAD",
>> +	"CHERRY_PICK_HEAD",
>> +	"REVERT_HEAD",
>> +	"BISECT_HEAD",
>> +	"AUTO_MERGE",
>> +};
>> +
>>  struct ref_namespace_info ref_namespace[] = {
>>  	[NAMESPACE_HEAD] = {
>>  		.ref = "HEAD",
>> @@ -1549,6 +1564,33 @@ int head_ref(each_ref_fn fn, void *cb_data)
>>  	return refs_head_ref(get_main_ref_store(the_repository), fn, cb_data);
>>  }
>
> The first thing that popped up in my head was "Should we somehow use
> is_pseudoref_syntax() instead of manually listing these?" (although I
> read in this thread later that Junio was okay with the listing) but then ...
>
> I thought I saw something similar in some other thread (which entered
> the mailing list much after this patch series was submitted) ...
>
> 	https://lore.kernel.org/git/[email-masked]/T/

We are halting Karthik's topic to rethink its UI for now, but your
point stands.  We should use a unified definition of what pseudorefs
there are across the codebase for consistency, and Karthik's topic
would be a better place to do so.

Andy, let me drop this topic for now from my tree, and let's wait
until Karthik's "iterate over all refs" topic solidifies, at which
time an updated iteration (v4?)  of this topic hopefully can build
on top of it.

Thanks.