git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Marco Costalba <mcostalba@gmail.com>
Cc: Junio C Hamano <gitster@pobox.com>,
	Git Mailing List <git@vger.kernel.org>
Subject: Re: Possible BUG in 'git log -z' last commit is not '\0' terminated
Date: Fri, 22 Jun 2007 14:56:10 -0700 (PDT)	[thread overview]
Message-ID: <alpine.LFD.0.98.0706221451570.3593@woody.linux-foundation.org> (raw)
In-Reply-To: <e5bfff550706221227x4b785698taabfa7572bf8204b@mail.gmail.com>



On Fri, 22 Jun 2007, Marco Costalba wrote:
>
> It seems '-z' option is not honoured by the last revision printed that
> is just '\n' terminated.

It's not a bug - it's by design.

What the -z option does is to replace the normal "\n" that delineates 
commits from each other with a "\0".

And we only put that delimeter in *between* commits, not *after* commits. 
The reason? It's prettier. Do a 

	git log -1

to get a single commit, and notice how we do *not* add an empty line at 
the end (or beginning), and compare that to

	git log -2

that shows two commits, and has an empty line in *between*.

Now, add the "-z" flag, and notice how that empty line is now replaced by 
a "\0" character instead.

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.

		Linus

  parent reply	other threads:[~2007-06-22 21:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-22 19:27 Possible BUG in 'git log -z' last commit is not '\0' terminated Marco Costalba
2007-06-22 21:29 ` Junio C Hamano
2007-06-22 21:56 ` Linus Torvalds [this message]
2007-06-23  5:51   ` Marco Costalba

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LFD.0.98.0706221451570.3593@woody.linux-foundation.org \
    --to=torvalds@linux-foundation.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=mcostalba@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).