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

Re: [PATCH] documentation: add tutorial for revision walking

From
Emily Shaffer <emilyshaffer@google.com>
Date
Jun 20, 2019, 21:06 UTC
Message-ID
<20190620210649.GA87385@google.com>
In-Reply-To
<xmqq4l4lr4dy.fsf@gitster-ct.c.googlers.com>
On Wed, Jun 19, 2019 at 08:17:29AM -0700, Junio C Hamano wrote:
Show 38 quoted lines
> Emily Shaffer <emilyshaffer@google.com> writes:
> 
> > Maybe there's a case for storing them as a set of patch files that are
> > revision-controlled somewhere within Documentation/? There was some
> > discussion on the IRC a few weeks ago about trying to organize these
> > tutorials into their own directory to form a sort of "Git Contribution
> > 101" course, maybe it makes sense to store there?
> >
> >   Documentation/contributing/myfirstcontrib/MyFirstContrib.txt
> >   Documentation/contributing/myfirstcontrib/sample/*.patch
> >   Documentation/contributing/myfirstrevwalk/MyFirstRevWalk.txt
> >   Documentation/contributing/myfirstrevwalk/sample/*.patch
> >
> > I don't love the idea of maintaining text patches with the expectation
> > that they should cleanly apply always,...
> 
> Well, I actually think the above organization does match the intent
> of the "My first contribution codelab" perfectly.  When the codebase,
> the workflow used by the project, and/or the coding or documentation
> guideline gets updated, the text that documents how to contribute to
> the project as well as the sample patches must be updated to match
> the updated reality.
> 
> I agree with you that maintaining the *.patch files to always
> cleanly apply is less than ideal.  A topic to update the sample
> patches and tutorial text may be competing with another topic that
> updates the very API the tutorials are teaching, and the sample
> patches may not apply cleanly when two topics are merged together,
> even if the "update sample patches and tutorial text" topic does
> update them to match the API at the tip of the topic branch itself.
> One thing we _could_ do is to pin the target version of the codebase
> for the sake of tutorial.  IOW, the sample/*.patch may not apply
> cleanly to the version of the tree these patches were taken from,
> but would always apply cleanly to the most recent released version
> before the last update to the tutorial, or something like that.
> 
> Also having to review the patch to sample/*.patch files will be
> unpleasant.

I wonder if we can ease some pain for both of the above issues by including some scripts to "inflate" the patch files into a topic branch, or figure out some more easily-reviewed (but more complicated, I suppose) method for sending updates to the sample/*.patch files.

Imagining workflows like this:
Doing the tutorial:
 - In worktree a/.
 - Run a magic script which creates a worktree with the sample code, b/.
 - Read through a/Documentation/MyFirstContribution.txt and generate
   a/builtins/psuh.c, referring to b/builtins/psuh.c if confused.
Rebasing the tutorial patches:
 - In worktree a/.
 - Run a magic script which checks out a new branch at the last known
   good base for the patchset, then applies all the patches.
 - Now faced with, likely, a topic branch based on v<n-1> (where n is
   latest release).
 - `git rebase v<n> -x (make && ./bin-wrappers/git psuh)`
 - Interactively fix conflicts
 - Run a script to generate a magic interdiff from the old version of
   patches
 - Mail out magic interdiff to list and get approval
 - (Maybe maintainer does this when interdiff is happy? Maybe updater
   does this when review looks good?) Run a magic script to regenerate
   patches from rebased branch, and note somewhere they are based on
   v<n>
 - Mail sample/*.patch (based on v<n>) to list (if maintainer rolled the
   patches after interdiff approval, this step can be skipped)
(This seems to still be a lot of steps, even with the magic script..)
Alternatively, for the same process:
 Updater: Run a magic script to create topic branch based on v<n-1>
   (like before)
 U: `git rebase v<n> -x (make && ./bin-wrappers/git psuh)`
 U: Interactively fix conflicts
 U: Run a script to turn topic branch back into sample/*.patch
 U: Send email with changes to sample/*.patch (this will be ugly and
    unreadable) - message ID <M1>
 Reviewer: Run a magic script, providing <M1> argument, which grabs the
    diff-of-.patch and generates an interdiff, or a topic branch based
    on v<n>
 R: Send comments explaining where issue is (tricky to find where to
    inline in the diff-of-.patch)
 U: Reroll diff-of-.patch email
 R: Accepts
 Maintainer: Applies diff-of-.patch email normally
 I suppose for the first suggestion, there ends up being quite a lot of
 onus on the maintainer, and a lot of trust that there is no difference
 between the RFC easy-to-read interdiff patchset. For the second
 suggestion, there ends up being onus on the reviewers to run some
 magical script. Maybe we can split the difference by expecting Updater
 to provide the interdiff below the --- line? Maybe in practice the
 diff-of-.patch isn't so unreadable, if it's only minor changes needed
 to bring the tutorial up to latest?
 I'm not sure there's a way to make this totally painless using email
 tools.
  - Emily
Previous: Junio C HamanoNext: Josh Steadmon
Message 28 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.