All of lore.kernel.org
 help / color / mirror / Atom feed
From: "René Scharfe" <rene.scharfe@lsrfire.ath.cx>
To: Jonathan del Strother <maillist@steelskies.com>
Cc: git@vger.kernel.org
Subject: Re: Serious bug with pretty format strings & empty bodies?
Date: Wed, 19 Dec 2007 19:28:37 +0100	[thread overview]
Message-ID: <476962D5.3050409@lsrfire.ath.cx> (raw)
In-Reply-To: <57518fd10712190632o490af924n61326fddf1819014@mail.gmail.com>

Jonathan del Strother schrieb:
> I'm struggling to come up with a minimal test case that confirms this,
> but I seem to be hitting a bug in the pretty string formatter when
> trying to print bodies of commits that don't have bodies.
> 
> For example, on a private repository, I'm trying to print the subject
> & body of a commit.  This particular commit doesn't actually have a
> body, so I'm expecting to see this output :
> 
> =================
> commit 18d2480ab689b483ef1ebbdb3f7420904049ba0b
> Try to flush log files before terminating the app
> 
> =================
> 
> However, when I actually run the command, I get gibberish in place of %b :
> =================
> $ git rev-list -1- --pretty=format:"%s%n%b"
> 18d2480ab689b483ef1ebbdb3f7420904049ba0b
> commit 18d2480ab689b483ef1ebbdb3f7420904049ba0b
> Try to flush log files before terminating the app
> tree 57bc7cf30a10aee96251852125cf30fd2c81d7aa
> parent 04c833865828538315fcdf6e187da077869ce444
> author Jonathan del Strother <jon.delStrother@bestbefore.tv> 1197901755 +0000
> committer Jonathan del Strother <jon.delStrother@bestbefore.tv> 1197901755 +0000
> 
> Check that ThreadWorker's work method actually returns a value with
> method signatures
> =================
> 
> So here you can see that the full details of a different commit is
> appearing in place of the requested commit's (empty) body.  Rerunning
> the rev-list produces the same output - the same string appears in
> place of %b every time, but it's different for each commit.  Often you
> only get a small fragment of another commit's message, rather than the
> full commit as seen above.
> 
> When I use --pretty=full, it works fine.
> 
> This appears in quite a few places in my repository's history.
> Repacking the repo semi-fixes it - I still get junk bodies, but not
> quite so many.
> 
> It doesn't always happen when a commit message body is empty, but I've
> never seen it happen where the message body has something in.
> 
> This happens with both git 1.5.3.7 and 1.5.4.rc0.1162.g3bfea, though
> the output is slightly different - the former has a number of
> <unknown> markers in it.  This is on OS X 10.5.1

That's strange.  Could you check if this happens with e52a5de, too?
That's the commit that introduced --pretty=format.  If it doesn't, could
you then please try to bisect the bug?

How many '<unknown>' markers are there in the output of version 1.5.3.7
(and e52a5de)?  One per %b?  Are they the only output or are they
combined with parts of unrelated commits, too?

Thanks,
René

  reply	other threads:[~2007-12-19 18:29 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-19 14:32 Serious bug with pretty format strings & empty bodies? Jonathan del Strother
2007-12-19 18:28 ` René Scharfe [this message]
2007-12-20 10:43   ` Jonathan del Strother
2007-12-20 10:46     ` Jonathan del Strother
2007-12-19 18:44 ` Alex Riesen
2007-12-19 22:37   ` Jonathan del Strother
2007-12-19 23:23     ` René Scharfe
2007-12-20 10:44       ` Jonathan del Strother
2007-12-20 12:20         ` René Scharfe
2007-12-20 12:37           ` Johannes Schindelin
2007-12-20 13:08           ` Jonathan del Strother
2007-12-21 10:47             ` Jonathan del Strother
2007-12-22  8:39               ` Junio C Hamano
2007-12-22 15:48                 ` Jonathan del Strother
2007-12-20 11:38       ` Jonathan del Strother
2007-12-20 12:34         ` Johannes Schindelin

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=476962D5.3050409@lsrfire.ath.cx \
    --to=rene.scharfe@lsrfire.ath.cx \
    --cc=git@vger.kernel.org \
    --cc=maillist@steelskies.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.