From: Junio C Hamano Date: Fri, 17 Feb 2023 21:27:40 GMT Subject: Re: [PATCH v3 1/2] diff: consolidate diff algorithm option parsing Message-ID: In-Reply-To: <816c47aa414586e99aa762604396bd8be4fb11f4.1676665285.git.gitgitgadget@gmail.com> "John Cai via GitGitGadget" writes: > From: John Cai > > A subsequent commit will need the ability to tell if the diff algorithm > was set through the command line through setting a new member of > diff_options. While this logic can be added to the > diff_opt_diff_algorithm() callback, the `--minimal` and `--histogram` > options are handled via OPT_BIT without a callback. > > Remedy this by consolidating the options parsing logic for --minimal and > --histogram into one callback. This way we can modify `diff_options` in > that function. > > As an additional refactor, the logic that sets the diff algorithm in > diff_opt_diff_algorithm() can be refactored into a helper that will > allow multiple callsites to set the diff algorithm. > > Signed-off-by: John Cai > --- > diff.c | 57 +++++++++++++++++++++++++++++++++++++++++++-------------- > 1 file changed, 43 insertions(+), 14 deletions(-) Nicely done. Much easier to follow. Will queue. Thanks.