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

Multiple consecutive null bytes with log -z --name-only

From
DNDrew Noakes <drew@drewnoakes.com>
Date
Jul 27, 2018, 20:20 UTC
Message-ID
<CAJd66x7ZHn=6AHFRXo5E4MhzEiW98Mpf37JRWv_18U5eYFeVJg@mail.gmail.com>
Hi all,

I'm a developer on the Git Extensions project [1] and am looking at an issue parsing the output of `git log` in that application.

Some investigation suggests that a certain combination of arguments causes multiple consecutive null bytes between rows, where I would ordinarily expect one.

Passing -z with --name-only causes double nulls.

$ git log -z --pretty=format:"%H" --name-only | grep -obUaP "\x00\x00" | wc -l 8994 $ git log -z --pretty=format:"%H" | grep -obUaP "\x00\x00" | wc -l 0

We can work around this issue, but I would like to understand if it's a bug or if there's some information to be gleaned here.

$ git --version git version 2.18.0.windows.1

Many thanks,
Drew
[1] https://github.com/gitextensions/gitextensions
Next: Junio C Hamano
Message 1 of 2 in “Multiple consecutive null bytes with log -z --name-only”
  1. Drew NoakesJul 27, 2018
  2. Junio C HamanoJul 27, 2018

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.