Re: [PATCH v6 07/11] add-patch: split out `struct interactive_options`
- From
Elijah Newren <newren@gmail.com>
- Date
- Nov 20, 2025, 07:03 UTC
- Message-ID
- <CABPp-BFLEFvQ_ZpFtEB0twtx6J5VcrerCa6aGsUjrctBQVyDiQ@mail.gmail.com>
- In-Reply-To
- <20251027-b4-pks-history-builtin-v6-7-407dd3f57ad3@pks.im>
On Mon, Oct 27, 2025 at 4:34 AM Patrick Steinhardt <ps@pks.im> wrote:
Show 14 quoted lines
> > The `struct add_p_opt` is reused both by our infra for "git add -p" and > "git add -i". Users of `run_add_i()` for example are expected to pass > `struct add_p_opt`. This is somewhat confusing and raises the question > of which options apply to what part of the stack. > > But things are even more confusing than that: while callers are expected > to pass in `struct add_p_opt`, these options ultimately get used to > initialize a `struct add_i_state` that is used by both subsystems. So we > are basically going full circle here. > > Refactor the code and split out a new `struct interactive_options` that > hosts common options used by both. These options are then applied to a > `struct interactive_config` that hosts common configuration.
Makes sense.
--color-moved helped me view part of the patch, and --color-words=. in some places showed just repeated additions of ".cfg". Still a pretty long patch; I'm almost curious if it could be split up into more steps to make the review easier (I admit to skimming), but scanning over it looks reasonable.