[PATCH] git-add--interactive: print message if there are no untracked files

2015-01-21 Thread Alexander Kuleshov
If user selects 'add untracked' and there are no untracked files, Add untracked opens. But it does not make sense in this case, because there are no untracked files. So let's print message and exit from add untracked mode. Signed-off-by: Alexander Kuleshov kuleshovm...@gmail.com ---

Re: [PATCH] git-add--interactive: print message if there are no untracked files

2015-01-21 Thread Junio C Hamano
Alexander Kuleshov kuleshovm...@gmail.com writes: If user selects 'add untracked' and there are no untracked files, Add untracked opens. But it does not make sense in this case, because there are no untracked files. So let's print message and exit from add untracked mode. That reasoning

Re: [PATCH] git-add--interactive: print message if there are no untracked files

2015-01-21 Thread Junio C Hamano
Junio C Hamano gits...@pobox.com writes: sub add_untracked_cmd { -my @add = list_and_choose({ PROMPT = 'Add untracked' }, - list_untracked()); -if (@add) { -system(qw(git update-index --add --), @add); -say_n_paths('added',

Re: [PATCH] git-add--interactive: print message if there are no untracked files

2015-01-21 Thread Alexander Kuleshov
No i don't see any reasons why list_and_choose() shoud give a prompt without candidates. Will resed patch. Thank you. 2015-01-22 3:17 GMT+06:00 Junio C Hamano gits...@pobox.com: Junio C Hamano gits...@pobox.com writes: sub add_untracked_cmd { -my @add = list_and_choose({ PROMPT = 'Add