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
MCMarco Costalba <mcostalba@gmail.com>
Date
Jul 15, 2007, 15:58 UTC
Message-ID
<e5bfff550707150858i1825e01clf0897ad4db319373@mail.gmail.com>
In-Reply-To
<20070715110415.33692142.seanlkml@sympatico.ca>
On 7/15/07, Sean <seanlkml@sympatico.ca> wrote:
>
> characters are guaranteed to appear somewhere else.  Your current
> test will fail if a "c" happens to follow NUL in the patch text.
>
Yes sir, I agree with you 100%

The real issue IMHO is that a 'delimiting character' should not appear in the content that it is trying to delimit. That's all the point around this thing. If a real 'delimiting character' does not exist because the content is free perhaps we should find a way to understand when we are at revision boundaries. The simplest (and most efficient) way is to know the size of the message in advance.

Also if git log filters out the '\0' chars in the content it is suboptimal because we could miss to see we have a '\0' in content. BTW the above mentioned patch in Linux tree was all around removing that garbage '\0'. If diff output was filtered out perhaps the author could have missed that patch opportunity.

Marco
BTW, perhaps I'm retarded, but I fail to see what to search for with ^\0.
As example if I have this output:
    Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c
index fd3fd90..36c523d 100644
--- a/fs/gfs2/rgrp.c
+++ b/fs/gfs2/rgrp.c
@@ -444,7 +444,6 @@ static int compute_bitstructs(struct gfs2_rgrpd *rgd)
 }

 /**
-^@
  * gfs2_ri_total - Total up the file system space, according to the rindex.
  *
  */
^@commit 8fb68595d508fd30ec90939572484b263600376c
fad59c1390045b5adb7c7249ec4e77e0f868aca5
tree 218a457675c111e2224fb57998d38e45d5786bd1
parent fad59c1390045b5adb7c7249ec4e77e0f868aca5


What should I search for to find the revision boundary? "\n\0" ? is
this that you mean with ^\0
Previous: SeanNext: Sean
Message 12 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.