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

Re: Possible BUG in 'git log -z' last commit is not '\0' terminated

From
MCMarco Costalba <mcostalba@gmail.com>
Date
Jun 23, 2007, 05:51 UTC
Message-ID
<e5bfff550706222251kdc6ccb4s6caf0195682ab727@mail.gmail.com>
In-Reply-To
<alpine.LFD.0.98.0706221451570.3593@woody.linux-foundation.org>
On 6/22/07, Linus Torvalds <torvalds@linux-foundation.org> wrote:
Show 5 quoted lines
>
> So you should think of the "\0" as being a delimeter that goes between
> commits, not something that "ends" the commit. It's not a "end of record"
> thing, it's a "between records" thing.
>
Thanks for explanation.
Interesting enough git-dif-tree with -z, documented as
"-z  \0 line termination on output"
has a different behaviour, with and without -p option:
git diff-tree -z HEAD ---> a '\0' is printed at the end
git diff-tree -z -p HEAD --> No '\0' is printed.

I suppose 'git log' passes '-z' to 'git diff-tree' because no documentation exsists in 'git log' man page.

Thanks Marco

BTW git-rev-list --header uses '\0' differently (appends to each record), but that's another story.

Previous: Linus Torvalds
Message 4 of 4 in “Possible BUG in 'git log -z' last commit is not '\0' terminated”
  1. Marco CostalbaJun 22, 2007
  2. Junio C HamanoJun 22, 2007
  3. Linus TorvaldsJun 22, 2007
  4. Marco CostalbaJun 23, 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.