Re: [PATCH 0/8] fetch: refactor code that prints reference updates
From: Patrick Steinhardt <hidden>
Date: 2023-03-20 12:26:49
Attachments
- signature.asc [application/pgp-signature] 833 bytes
From: Patrick Steinhardt <hidden>
Date: 2023-03-20 12:26:49
On Fri, Mar 17, 2023 at 01:24:49PM -0700, Jonathan Tan wrote:
Patrick Steinhardt [off-list ref] writes:
[snip]
quoted
fetch: deduplicate logic to print remote URLMakes sense, although I would need to consider only storing the raw URL in the struct display_state and processing it when it needs to be emitted (haven't checked if this is feasible, though).
We likely could, but right now the benefit isn't all that high. If the URL was only used in `display_ref_update()` then this would be easy enough to do. But we also access the sanitized URL when the connectivity check fails or when printing to FETCH_HEAD. If we provided an accessor function thet returns the URL it would be trivial to do, but what do we really gain here? In the best case we save an allocation for the URL and two loops ranging over it. That doesn't quite feel worth it to me. Patrick