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

Re: [RFC PATCH v3 00/13] example implementation of revwalk tutorial

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Aug 8, 2019, 19:19 UTC
Message-ID
<nycvar.QRO.7.76.6.1908082118130.46@tvgsbejvaqbjf.bet>
In-Reply-To
<20190806231328.GB130824@google.com>
Hi Emily,
On Tue, 6 Aug 2019, Emily Shaffer wrote:
Show 31 quoted lines
> On Thu, Jul 25, 2019 at 11:25:02AM +0200, Johannes Schindelin wrote:
> >
> > On Mon, 1 Jul 2019, Emily Shaffer wrote:
> >
> > > Since v2, mostly reworded comments, plus fixed the issues mentioned in
> > > the tutorial itself. Thanks Eric for the review.
> > >
> > > Emily Shaffer (13):
> > >   walken: add infrastructure for revwalk demo
> > >   walken: add usage to enable -h
> > >   walken: add placeholder to initialize defaults
> > >   walken: add handler to git_config
> > >   walken: configure rev_info and prepare for walk
> > >   walken: perform our basic revision walk
> > >   walken: filter for authors from gmail address
> > >   walken: demonstrate various topographical sorts
> > >   walken: demonstrate reversing a revision walk list
> > >   walken: add unfiltered object walk from HEAD
> > >   walken: add filtered object walk
> > >   walken: count omitted objects
> > >   walken: reverse the object walk order
> > >
> > >  Makefile         |   1 +
> > >  builtin.h        |   1 +
> > >  builtin/walken.c | 297 +++++++++++++++++++++++++++++++++++++++++++++++
> >
> > Since this is not really intended to be an end user-facing command, I
> > think it should not become a built-in, to be carried into every Git
> > user's setup.
>
> It's not intended to be checked into Git source as-is.

Then it runs the very real danger of becoming stale: we do _not_ guarantee a stable API, not even an internal one.

Show 6 quoted lines
> > Instead, I would recommend to implement this as a test helper.
>
> I'm not sure I follow how you imagine this looking, but the drawback I
> see of implementing this in a different way than you would typically do
> when writing a real feature for the project is that it becomes less
> useful as a reference for new contributors.

To the contrary. Some code in `t/helper/` is intended to test functionality in a way that is copy-editable.

Your use case strikes me a perfect example for such a test helper:
- It guarantees that the example is valid,
- It demonstrates how to use the API,
- In case the API changes, the changes to the helper will inform
  contributors how to change their copy-edited versions
Show 10 quoted lines
> > This would have the following advantages:
> >
> > - it won't clutter the end user installations,
> >
> > - it will still be compile-tested with every build (guaranteeing that
> >   the tutorial won't become stale over time as so many other tutorials),
>
> This part of your suggestion appeals to me; so I'm really curious how
> you would do it. Do you have something else written in the way you're
> suggesting in mind?

I looked at `t/helper/test-hashmap.c` and it looks _almost_ like a perfect example for what I have in mind: it uses a given API, demonstrates how to use it properly, and is copy-editable.

Ciao, Dscho

Previous: Emily ShafferNext: Josh Steadmon
Message 89 of 102 in “documentation: add tutorial for revision walking”
  1. documentation: add tutorial for revision walkingEmily Shaffer, Jun 7, 2019
  2. 00/13 example implementation of revwalk tutorialEmily Shaffer, Jun 7, 2019
  3. 01/13 walken: add infrastructure for revwalk demoEmily Shaffer, Jun 7, 2019
  4. 02/13 walken: add usage to enable -hEmily Shaffer, Jun 7, 2019
  5. 03/13 walken: add placeholder to initialize defaultsEmily Shaffer, Jun 7, 2019
  6. 04/13 walken: add handler to git_configEmily Shaffer, Jun 7, 2019
  7. 05/13 walken: configure rev_info and prepare for walkEmily Shaffer, Jun 7, 2019
  8. 06/13 walken: perform our basic revision walkEmily Shaffer, Jun 7, 2019
  9. 07/13 walken: filter for authors from gmail addressEmily Shaffer, Jun 7, 2019
  10. 08/13 walken: demonstrate various topographical sortsEmily Shaffer, Jun 7, 2019
  11. 09/13 walken: demonstrate reversing a revision walk listEmily Shaffer, Jun 7, 2019
  12. 10/13 walken: add unfiltered object walk from HEADEmily Shaffer, Jun 7, 2019
  13. 11/13 walken: add filtered object walkEmily Shaffer, Jun 7, 2019
  14. Jeff HostetlerJun 7, 2019
  15. Emily ShafferJun 17, 2019
  16. 12/13 walken: count omitted objectsEmily Shaffer, Jun 7, 2019
  17. 13/13 walken: reverse the object walk orderEmily Shaffer, Jun 7, 2019
  18. Eric SunshineJun 7, 2019
  19. Junio C HamanoJun 10, 2019
  20. Eric SunshineJun 10, 2019
  21. Emily ShafferJun 17, 2019
  22. Eric SunshineJun 19, 2019
  23. Emily ShafferJun 19, 2019
  24. Eric SunshineJun 23, 2019
  25. Junio C HamanoJun 10, 2019
  26. Emily ShafferJun 17, 2019
  27. Junio C HamanoJun 19, 2019
  28. Emily ShafferJun 20, 2019
  29. Josh SteadmonJul 13, 2019
  30. Emily ShafferJul 16, 2019
  31. Junio C HamanoJul 16, 2019
  32. Junio C HamanoJun 10, 2019
  33. Emily ShafferJun 17, 2019
  34. documentation: add tutorial for revision walkingEmily Shaffer, Jun 26, 2019
  35. 00/13 example implementation of revwalk tutorialEmily Shaffer, Jun 26, 2019
  36. 01/13 walken: add infrastructure for revwalk demoEmily Shaffer, Jun 26, 2019
  37. 02/13 walken: add usage to enable -hEmily Shaffer, Jun 26, 2019
  38. Eric SunshineJun 27, 2019
  39. Emily ShafferJun 27, 2019
  40. Eric SunshineJun 27, 2019
  41. 03/13 walken: add placeholder to initialize defaultsEmily Shaffer, Jun 26, 2019
  42. 04/13 walken: add handler to git_configEmily Shaffer, Jun 26, 2019
  43. Eric SunshineJun 27, 2019
  44. Emily ShafferJun 27, 2019
  45. 05/13 walken: configure rev_info and prepare for walkEmily Shaffer, Jun 26, 2019
  46. Eric SunshineJun 27, 2019
  47. Emily ShafferJun 27, 2019
  48. 06/13 walken: perform our basic revision walkEmily Shaffer, Jun 26, 2019
  49. Eric SunshineJun 27, 2019
  50. Emily ShafferJun 27, 2019
  51. 07/13 walken: filter for authors from gmail addressEmily Shaffer, Jun 26, 2019
  52. Eric SunshineJun 27, 2019
  53. Emily ShafferJun 27, 2019
  54. 08/13 walken: demonstrate various topographical sortsEmily Shaffer, Jun 26, 2019
  55. Eric SunshineJun 27, 2019
  56. Emily ShafferJun 27, 2019
  57. 09/13 walken: demonstrate reversing a revision walk listEmily Shaffer, Jun 26, 2019
  58. Eric SunshineJun 27, 2019
  59. Emily ShafferJun 27, 2019
  60. 10/13 walken: add unfiltered object walk from HEADEmily Shaffer, Jun 26, 2019
  61. Eric SunshineJun 27, 2019
  62. Emily ShafferJun 27, 2019
  63. Eric SunshineJun 28, 2019
  64. Emily ShafferJul 1, 2019
  65. 11/13 walken: add filtered object walkEmily Shaffer, Jun 26, 2019
  66. Eric SunshineJun 27, 2019
  67. Emily ShafferJun 27, 2019
  68. 12/13 walken: count omitted objectsEmily Shaffer, Jun 26, 2019
  69. Eric SunshineJun 27, 2019
  70. 13/13 walken: reverse the object walk orderEmily Shaffer, Jun 26, 2019
  71. Emily ShafferJun 27, 2019
  72. documentation: add tutorial for revision walkingEmily Shaffer, Jul 1, 2019
  73. 00/13 example implementation of revwalk tutorialEmily Shaffer, Jul 1, 2019
  74. 01/13 walken: add infrastructure for revwalk demoEmily Shaffer, Jul 1, 2019
  75. 02/13 walken: add usage to enable -hEmily Shaffer, Jul 1, 2019
  76. 03/13 walken: add placeholder to initialize defaultsEmily Shaffer, Jul 1, 2019
  77. 04/13 walken: add handler to git_configEmily Shaffer, Jul 1, 2019
  78. 05/13 walken: configure rev_info and prepare for walkEmily Shaffer, Jul 1, 2019
  79. 06/13 walken: perform our basic revision walkEmily Shaffer, Jul 1, 2019
  80. 07/13 walken: filter for authors from gmail addressEmily Shaffer, Jul 1, 2019
  81. 08/13 walken: demonstrate various topographical sortsEmily Shaffer, Jul 1, 2019
  82. 09/13 walken: demonstrate reversing a revision walk listEmily Shaffer, Jul 1, 2019
  83. 10/13 walken: add unfiltered object walk from HEADEmily Shaffer, Jul 1, 2019
  84. 11/13 walken: add filtered object walkEmily Shaffer, Jul 1, 2019
  85. 12/13 walken: count omitted objectsEmily Shaffer, Jul 1, 2019
  86. 13/13 walken: reverse the object walk orderEmily Shaffer, Jul 1, 2019
  87. Johannes SchindelinJul 25, 2019
  88. Emily ShafferAug 6, 2019
  89. Johannes SchindelinAug 8, 2019
  90. Josh SteadmonJul 24, 2019
  91. Jonathan TanJul 24, 2019
  92. Emily ShafferAug 6, 2019
  93. documentation: add tutorial for revision walkingEmily Shaffer, Aug 6, 2019
  94. Junio C HamanoAug 7, 2019
  95. Emily ShafferAug 14, 2019
  96. Junio C HamanoAug 14, 2019
  97. documentation: add tutorial for object walkingEmily Shaffer, Oct 10, 2019
  98. Junio C HamanoOct 11, 2019
  99. Emily ShafferOct 11, 2019
  100. SZEDER GáborOct 11, 2019
  101. Emily ShafferOct 11, 2019
  102. documentation: add tutorial for object walkingEmily Shaffer, Oct 11, 2019

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.