Re: [PATCH 0/3] Port git-add--interactive.perl:status_cmd to C
- From
Daniel Ferreira (theiostream) <bnmvco@gmail.com>
- Date
- May 5, 2017, 23:37 UTC
- Message-ID
- <CAEA2_RJFPZ6-ZMQCjX5pXoA8RL6qscLO4QWP3gi46uWXYyD44Q@mail.gmail.com>
- In-Reply-To
- <alpine.DEB.2.21.1.1705052316250.146734@virtualbox>
On Fri, May 5, 2017 at 7:38 PM, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> But maybe you want to keep the naming a little more consistent with the > Perl script, e.g. instead of calling the function `print_modified()` call > it already `list()` (and rename it later to `list_and_choose()` once you > have taught it to ask for a choice)?
Actually, I named it print_modified() because I anticipated there would be no list_and_choose() equivalent in C. I don't think the builtin should have the interactive menu + modified list + untracked list being handled by one function. Rather, I think a saner way to go on with it would be to create functions like print_untracked(); choose_from_input(); print_menu() etc.
This is still pure speculation from what I've written until now and from the roadmap I have in my head (I do not know how writing code from now on will actually be), but I have a hunch that list_and_choose() is already convoluted enough in Perl; in C it might become a monster.
> Thank you for this pleasant read!
Thank *you* for the quick and thorough review :)
-- Daniel.