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

Re: git log doesn't allow %x00 in custom format anymore?

From
Kirill Likhodedov <kirill.likhodedov@jetbrains.com>
Date
Oct 7, 2010, 15:18 UTC
Message-ID
<FF2FF369-0B1C-457E-A86E-8651BF0A82CB@jetbrains.com>
In-Reply-To
<4CADE232.8030801@viscovery.net>
Show 14 quoted lines
> With git rev-list, it also happens on Linux:
> 
> $ git log -1 --pretty=foo%x00bar HEAD | od -c
> 0000000   f   o   o  \0   b   a   r  \n
> 0000010
> $ git rev-list -1 --pretty=foo%x00bar HEAD | od -c
> 0000000   c   o   m   m   i   t       8   7   f   a   f   1   0   9   0
> 0000020   5   d   1   f   8   a   b   1   e   9   a   c   2   4   c   c
> 0000040   3   e   f   e   d   8   1   f   a   7   e   2   9   6   7  \n
> 0000060   f   o   o  \n
> 0000064
> $ git version
> git version 1.7.3.67.gcc234
> 
Hannes, 

Thanks for pointing that out. I confirm that on Mac OS X that happens for rev-list as well.

# git log --pretty=format:foo%x00bar HEAD -1 | od -c 0000000 f o o \0 b a r 0000007

# git rev-list --pretty=format:foo%x00bar HEAD -1 | od -c 0000000 c o m m i t 2 3 6 0 1 a 2 c 3 0000020 e 4 6 4 a 4 4 7 9 f 1 7 7 4 e 3 0000040 6 e a 5 b 9 5 8 b 4 6 0 5 2 1 \n 0000060 f o o \n 0000064

And it's not a new issue:

# git version git version 1.7.1

So here's what we have now about this bug:
1. It happens since 1.7.1 for rev-list on all platforms (at least since 1.7.1 on Mac OS X and 1.7.3 on Linux).
2. It also happens at least since 1.7.2.3 for log on Windows.

Sorry for giving some confusion in my previous messages. I probably tested 'rev-list' at the time when I've recovered the problem, but I reported it as a problem with 'log'.

---------------------------------- Kirill Likhodedov JetBrains, Inc http://www.jetbrains.com "Develop with pleasure!"

Previous: Johannes SixtNext: Jeff King
Message 6 of 19 in “git log doesn't allow %x00 in custom format anymore?”
  1. Kirill LikhodedovOct 7, 2010
  2. Jeff KingOct 7, 2010
  3. Kirill LikhodedovOct 7, 2010
  4. Jeff KingOct 7, 2010
  5. Johannes SixtOct 7, 2010
  6. Kirill LikhodedovOct 7, 2010
  7. Jeff KingOct 7, 2010
  8. Matthieu MoyOct 7, 2010
  9. Drew NorthupOct 7, 2010
  10. Erik Faye-LundOct 7, 2010
  11. Erik Faye-LundOct 7, 2010
  12. Jeff KingOct 7, 2010
  13. Matthieu MoyOct 7, 2010
  14. Jeff KingOct 7, 2010
  15. Erik Faye-LundOct 7, 2010
  16. Jeff KingOct 7, 2010
  17. Erik Faye-LundOct 7, 2010
  18. Jeff KingOct 7, 2010
  19. Erik Faye-LundOct 7, 2010

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.