Re: [PATCH v2 01/10] refs: allow "HEAD" as decoration filter
- From
Derrick Stolee <derrickstolee@github.com>
- Date
- Aug 4, 2022, 13:22 UTC
- Message-ID
- <d5cc4280-3f17-ceec-ac96-97e896898a91@github.com>
- In-Reply-To
- <xmqqedxxeued.fsf@gitster.g>
On 8/3/2022 2:03 AM, Junio C Hamano wrote:
Show 11 quoted lines
> "Derrick Stolee via GitGitGadget" <gitgitgadget@gmail.com> writes:
>
>> if (prefix) {
>> strbuf_addstr(&normalized_pattern, prefix);
>> - }
>> - else if (!starts_with(pattern, "refs/"))
>> + } else if (!starts_with(pattern, "refs/") &&
>> + strcmp(pattern, "HEAD"))
>
> Perhaps leave a needswork comment to remind us to later consider
> covering all the pseudorefs like MERGE_HEAD, CHERRY_PICK_HEAD etc.?A comment is a good idea. We should leave it for later because it would make a visible change from the user's perspective.
Show 7 quoted lines
>> strbuf_addstr(&normalized_pattern, "refs/");
>
> Style:
>
> If you plan to add more code to the bodies of this if/elseif, then
> have {} around all arms. Otherwise, let's lose the {} around the
> body of "if (prefix)".Yes, thanks for the close eyes.
Thanks, -Stolee