Re: [PATCH v10 09/14] git-clean: use a git-add-interactive compatible UI

2013-05-16 Thread Junio C Hamano
Junio C Hamano writes: > Also please fix this one: > >> +for_each_string_list_item(item, (struct string_list >> *)stuff->stuff) { >> +if ((*chosen)[i] < 0) >> +(*chosen)[i] = 0; >> +strbuf_addf(&menu, "%s%2d: %s", (*

Re: [PATCH v10 09/14] git-clean: use a git-add-interactive compatible UI

2013-05-16 Thread Junio C Hamano
Jiang Xin writes: > +static void print_highlight_menu_stuff(struct menu_stuff *stuff, int > **chosen) > +{ > + struct string_list menu_list = STRING_LIST_INIT_DUP; > + struct strbuf menu = STRBUF_INIT; > + int i; > + > + if (MENU_STUFF_TYPE_MENU_ITEM == stuff->type) { > + ...

[PATCH v10 09/14] git-clean: use a git-add-interactive compatible UI

2013-05-16 Thread Jiang Xin
Rewrite menu using a new method `list_and_choose`, which is borrowed from `git-add--interactive.perl`. We will use this framework to add new actions for interactive git-clean later. Please NOTE: * Method `list_and_choose` return an array of integers, and * it is up to you to free the allocated