git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 0/3] Port git-add--interactive.perl:status_cmd to C

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
May 8, 2017, 12:23 UTC
Message-ID
<alpine.DEB.2.21.1.1705081415370.146734@virtualbox>
In-Reply-To
<CAEA2_RJFPZ6-ZMQCjX5pXoA8RL6qscLO4QWP3gi46uWXYyD44Q@mail.gmail.com>
Hi Daniel,
On Fri, 5 May 2017, Daniel Ferreira (theiostream) wrote:
Show 14 quoted lines
> 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.

Okay. But maybe then the `selected` field should not (at least not yet) be a part of this patch.

> 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.
True.

To be honest, I would love for this patch to become part of a "work-in-progress" patch series that lays out the plan a little bit more concretely (I typically implement functions with a single `die("TODO")` in the function body in such patch series). This patch series would of course not be expected to pass the test suite yet, but it would allow other developers (e.g. myself) to jump in and complete individual patches...

There would be real advantages in such a patch series:
- it could be worked on in parallel (coordination required, of course);
  may be a ton of fun, and
- the overall design could be iterated according with the needs of later
  patches in the series.
> > Thank you for this pleasant read!
> 
> Thank *you* for the quick and thorough review :)

Heh... I would not call it "quick"... it took a long time. But not as much time as you spent crafting it!

Thank you, Johannes

Previous: Daniel Ferreira (theiostream)
Message 21 of 21 in “Port git-add--interactive.perl:status_cmd to C”
  1. 0/3 Port git-add--interactive.perl:status_cmd to CDaniel Ferreira, May 5, 2017
  2. 1/3 diff: export diffstat interfaceDaniel Ferreira, May 5, 2017
  3. Johannes SchindelinMay 5, 2017
  4. 2/3 add--interactive: add builtin helper for interactive addDaniel Ferreira, May 5, 2017
  5. Ævar Arnfjörð BjarmasonMay 5, 2017
  6. Johannes SchindelinMay 5, 2017
  7. Ævar Arnfjörð BjarmasonMay 5, 2017
  8. Johannes SchindelinMay 5, 2017
  9. Ævar Arnfjörð BjarmasonMay 5, 2017
  10. Johannes SchindelinMay 8, 2017
  11. Daniel Ferreira (theiostream)May 5, 2017
  12. Ævar Arnfjörð BjarmasonMay 5, 2017
  13. Johannes SchindelinMay 8, 2017
  14. 3/3 add--interactive: use add-interactive--helper for status_cmdDaniel Ferreira, May 5, 2017
  15. Johannes SchindelinMay 5, 2017
  16. Ævar Arnfjörð BjarmasonMay 5, 2017
  17. Johannes SchindelinMay 5, 2017
  18. Jonathan NiederMay 5, 2017
  19. Johannes SchindelinMay 5, 2017
  20. Daniel Ferreira (theiostream)May 5, 2017
  21. Johannes SchindelinMay 8, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.