Re: [PATCH v2 0/8] config.c: use struct for config reading state
- From
- Jonathan Tan <jonathantanmy@google.com>
- Date
- Mar 16, 2023, 22:29 UTC
- Message-ID
- <20230316222923.321352-1-jonathantanmy@google.com>
- In-Reply-To
- <pull.1463.v2.git.git.1678925506.gitgitgadget@gmail.com>
So overall what this series does is to create a struct that contains config parsing state (roughly speaking...it's either parsing state or a "kvi" that contains some of the parsing state that existed when its value was parsed), starts a pattern in config.c in which that struct is passed between functions as much as possible, and establishes a few functions like reader_origin_type() that make it convenient to work on the basis of this struct as opposed to on the config_source and kvi individually. And following this pattern, I think, likely would have enabled us to avoid the bug in patch 7/8 and enable us to avoid similar bugs in the future, so overall I'm happy with this series.
"Glen Choo via GitGitGadget" <gitgitgadget@gmail.com> writes:
> Introduce 8/8 to get rid of the confusing acronym "struct config_source > cf", but I don't mind ejecting it if it's too much churn.
I think patch 8/8 is not worth including, so I didn't leave comments on it, but I'm fine if it ends up merged too.