Re: Silly 'git am' UI issue
- From
Linus Torvalds <torvalds@linux-foundation.org>
- Date
- Mar 4, 2022, 18:50 UTC
- Message-ID
- <CAHk-=whaqdakNBwVZ-AZ0Ei2WLA+=3oqofhKfdQ618dWrYySfQ@mail.gmail.com>
- In-Reply-To
- <220304.86r17ifahr.gmgdl@evledraar.gmail.com>
On Thu, Mar 3, 2022 at 11:22 PM Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:
> > A more general solution would be some continuation of this, i.e. we can > use the "defval" in "struct option" as a pointer to a validation > function for any arguments.
I wasn't familiar enough with the option parsing code to do this, but yes, I think your approach is nicer and makes it easier to add checking to the other passthrough cases
So Ack from me on that approach instead.
I do suspect that you'll notice when trying to code up a proper patch that it's probably complicated by the fact that the "validation" function wants a different argument (in this case a 'struct apply_state') than the "passthrough" function does (it wants that "struct strvec").
Again, I'm not familiar with the argument parsing code, it all post-dates my work, so what do I know..
Linus