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

Re: Documentation/MyFirstObjectWalk: add #include "trace.h" to use trace_printf()

From
Emily Shaffer <nasamuffin@google.com>
Date
Jun 29, 2023, 23:06 UTC
Message-ID
<CAJoAoZnaU7WsCpnZY0Pvjg4_GJMZADF0FNC9fNZK56ShX2JO+g@mail.gmail.com>
In-Reply-To
<xmqq1qhu9ifp.fsf@gitster.g>
On Thu, Jun 29, 2023 at 12:28 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 18 quoted lines
>
> Emily Shaffer <nasamuffin@google.com> writes:
>
> > Yeah, it's almost certainly stale in MyFirstObjectWalk - there was
> > very recently a patch to clean up some headers which probably were
> > implicitly including trace.h when I wrote this walkthrough.
>
> We are lucky that we have folks like Vinayak who tried out the
> examples and then bothered to spend time reporting the failure
> discovered.  What does it take, however, for us to have a bit more
> automated way to prevent such a breakage that comes from API
> changes?  Is it feasible, for example, to add a test that extracts
> code snippets from the MyFirstObjectWalk document and try to build
> the result?  Alternatively, we can ship such a set of sample source
> files somewhere in our tree (e.g. contrib/examples?) and have such
> a test try to build using the current set of source files, but then
> we need a mechansim to ensure that the sample source files will not
> go out of sync with the document.

Yeah, I remember we talked about this when MyFirstContribution and MyFirstObjectWalk went in, but never made much headway. I do very much like the idea of keeping the reference source in contrib/ as a set of patches, maybe along with a script to apply them (or a readme with the right `git am` invocation), and then checking that they still build. Checking that against the contents of the document is trickier, though, like you mentioned. Hm.

I'm interested in figuring out how to do this, but not likely to have a lot of development time available to do it. Maybe I can take a day here or there to poke at it, but if someone else is interested and beats me to it, I will not be disappointed. :)

Show 5 quoted lines
>
> Thoughts?
>
> Thanks.
>
Previous: Junio C HamanoNext: Junio C Hamano
Message 9 of 10 in “Documentation/MyFirstObjectWalk: add #include "trace.h" to use trace_printf()”
  1. Vinayak DevJun 29, 2023
  2. Emily ShafferJun 29, 2023
  3. Emily ShafferJun 29, 2023
  4. Vinayak DevJun 29, 2023
  5. Emily ShafferJun 29, 2023
  6. Vinayak DevJun 30, 2023
  7. Vinayak DevJun 30, 2023
  8. Junio C HamanoJun 29, 2023
  9. Emily ShafferJun 29, 2023
  10. Junio C HamanoJun 30, 2023

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.