git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Eric Raible <raible@gmail.com>
Cc: Junio C Hamano <gitster@pobox.com>,
	Git Mailing List <git@vger.kernel.org>
Subject: Re: RFH - git-log variant that _does_ search through diffs
Date: Wed, 1 Jul 2009 03:02:52 -0400	[thread overview]
Message-ID: <20090701070252.GA7987@sigio.peff.net> (raw)
In-Reply-To: <279b37b20906301422w2b895afai5edf42fcbfcc7d5a@mail.gmail.com>

On Tue, Jun 30, 2009 at 02:22:43PM -0700, Eric Raible wrote:

> Unfortunately --format seems to turn off -z (at least in msysgit):
> 
> $ git --version
> git version 1.6.3.2.1299.gee46c
> $ git log -p > L1
> $ git log -p -z > L2
> $ diff L1 L2 | wc
>    2415    4347   62889
> $ git log -p --format=%s > L1
> $ git log -p -z --format=%s > L2
> $ diff L1 L2 | wc
>       0       0       0

Ugh. I did some looking into this. It actually does work if you do:

  git log -p -z --pretty=format:%s

rather than

  git log -p -z --pretty=tformat:%s

And --format=%s behaves as if 'tformat' was given. And if you are not up
to date on the difference, "format" implies "separator semantics", where
the NUL is placed _between_ each record. "tformat" implies "terminator
semantics", where the NUL is placed at the end.

Placing the separator correctly is fairly easy; when we start a new
record, if we are not the first, we print the separator. Placing a
terminator is a little trickier because of the way the code is
structured. I'll post my attempt in a minute; see patch 2/2 for more
discussion.

-Peff

  parent reply	other threads:[~2009-07-01  7:01 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-30  0:08 RFH - git-log variant that _does_ search through diffs Eric Raible
2009-06-30  4:03 ` Jeff King
2009-06-30  8:09   ` Junio C Hamano
2009-06-30 18:06     ` Eric Raible
2009-06-30 18:05   ` Eric Raible
2009-06-30 19:31     ` Jeff King
2009-06-30 21:22       ` Eric Raible
2009-06-30 21:34         ` Eric Raible
2009-07-01  7:02         ` Jeff King [this message]
2009-07-01  7:26           ` [PATCH 1/2] log-tree: fix confusing comment Jeff King
2009-07-01  7:26           ` [RFC/PATCH 2/2] fix missing NUL termination with pretty=tformat Jeff King
2009-07-01  8:27             ` Junio C Hamano

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=20090701070252.GA7987@sigio.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=raible@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).