Re: [PATCH v2 7/8] refs: fix recursing `get_main_ref_store()` with "onbranch" config
- From
Justin Tobler <jltobler@gmail.com>
- Date
- Jun 18, 2026, 15:53 UTC
- Message-ID
- <ajQK4vrkc1HVujFh@denethor>
- In-Reply-To
- <ajQF1yyCUOdzC4Jq@pks.im>
On 26/06/18 04:51PM, Patrick Steinhardt wrote:
Show 8 quoted lines
> On Thu, Jun 18, 2026 at 09:15:00AM -0500, Justin Tobler wrote: > > Could we embed an `initialized` boolean in `struct ref_store` that gets > > set when the ref store is properly initialized and use that as a signal > > instead? I'm not sure how complex introducing this would be though. > > We could, but I'm not sure what that would really buy us. It would > basically be one more bit of state that we have to track going forward, > and thus one more source of inconsistencies.
My naive thought here is that if the ref store knows when it is initialized, this could be used as a more reliable signal by `include_by_branch()`. I guess the problem though would be that, at that point in time, we are still inside `ref_store_init()` and thus the ref store is not fully initialized anyways.
I was hoping we could avoid the hack of temporarily setting the ref format here, but introducing state specific to tracking whether its ok to parse onbranch conditions in the config is probably not worth it I guess.
-Justin