Re: [PATCH 2/8] built-in add -i: prepare for multi-selection commands
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Nov 21, 2019, 08:12 UTC
- Message-ID
- <xmqqa78p8x6c.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <c324b47592dca2cd4967d62d2520a35bfcf04bae.1573821382.git.gitgitgadget@gmail.com>
"Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 5 quoted lines
> From: Johannes Schindelin <johannes.schindelin@gmx.de> > > The `upgrade`, `revert` and `add-untracked` commands allow selecting > multiple entries. Let's extend the `list_and_choose()` function to > accommodate those use cases.
upgrade???
Show 17 quoted lines
>
> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> ---
> add-interactive.c | 114 ++++++++++++++++++++++++++++++++++++----------
> 1 file changed, 89 insertions(+), 25 deletions(-)
>
> diff --git a/add-interactive.c b/add-interactive.c
> index 8ec930ac15..33a751150a 100644
> --- a/add-interactive.c
> +++ b/add-interactive.c
> @@ -72,15 +72,17 @@ static void init_add_i_state(struct add_i_state *s, struct repository *r)
> struct prefix_item_list {
> struct string_list items;
> struct string_list sorted;
> + int *selected; /* for multi-selections */
> size_t min_length, max_length;
> };OK. The shape of the data is enough to tell us what you did in this patch and I think it makes sense ;-)