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

Re: [PATCH] Add --show-size to git log to print message size

From
Sean <seanlkml@sympatico.ca>
Date
Jul 15, 2007, 15:04 UTC
Message-ID
<20070715110415.33692142.seanlkml@sympatico.ca>
In-Reply-To
<e5bfff550707150758h7a9e893frb068d4a9508bc3b2@mail.gmail.com>

On Sun, 15 Jul 2007 16:58:16 +0200 "Marco Costalba" <mcostalba@gmail.com> wrote:

Show 8 quoted lines
> On 7/15/07, Sean <seanlkml@sympatico.ca> wrote:
> >
> > If you only look for ^\0 (ie. first position only) the parsing should
> > be okay.  Not that it helps with the performance issue you're trying
> > to address.
> >
> revisions are streamed, there is only one first revision, all the
> others are linked togheter in a big stream.

Right, but how does that alter the notion that ^\0 is the safe way to test for the "real" NUL terminator?

> Actually I ended up looking for the character after the '\0' (if any)
> to be 'c' that is the beginning of "commit <sha> ....." but it's a bit
> hacky.

Much more hacky than just testing for ^\0. AFAIU, the NUL is guaranteed to come at the start of the line and _all_ other NUL characters are guaranteed to appear somewhere else. Your current test will fail if a "c" happens to follow NUL in the patch text.

Sean
Previous: Marco CostalbaNext: Marco Costalba
Message 11 of 29 in “Add --show-size to git log to print message size”
  1. Add --show-size to git log to print message sizeMarco Costalba, Jul 14, 2007
  2. Junio C HamanoJul 14, 2007
  3. Marco CostalbaJul 14, 2007
  4. Alex RiesenJul 15, 2007
  5. Marco CostalbaJul 15, 2007
  6. Alex RiesenJul 15, 2007
  7. Marco CostalbaJul 15, 2007
  8. Marco CostalbaJul 15, 2007
  9. SeanJul 15, 2007
  10. Marco CostalbaJul 15, 2007
  11. SeanJul 15, 2007
  12. Marco CostalbaJul 15, 2007
  13. SeanJul 15, 2007
  14. Marco CostalbaJul 15, 2007
  15. SeanJul 15, 2007
  16. Marco CostalbaJul 15, 2007
  17. Linus TorvaldsJul 15, 2007
  18. Marco CostalbaJul 15, 2007
  19. Marco CostalbaJul 16, 2007
  20. Alex RiesenJul 16, 2007
  21. Junio C HamanoJul 16, 2007
  22. Marco CostalbaJul 16, 2007
  23. Marco CostalbaJul 16, 2007
  24. Junio C HamanoJul 16, 2007
  25. Marco CostalbaJul 16, 2007
  26. Andy ParkinsJul 17, 2007
  27. Marco CostalbaJul 17, 2007
  28. Junio C HamanoJul 25, 2007
  29. Marco CostalbaJul 25, 2007

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.