git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: "René Scharfe" <rene.scharfe@lsrfire.ath.cx>,
	"Ivan Lyapunov" <dront78@gmail.com>,
	git@vger.kernel.org, "Antoine Pelisse" <apelisse@gmail.com>
Subject: Re: git log - crash and core dump
Date: Tue, 16 Apr 2013 17:34:14 -0400	[thread overview]
Message-ID: <20130416213414.GA11229@sigill.intra.peff.net> (raw)
In-Reply-To: <7v61zml0ow.fsf@alter.siamese.dyndns.org>

On Tue, Apr 16, 2013 at 12:45:03PM -0700, Junio C Hamano wrote:

> René Scharfe <rene.scharfe@lsrfire.ath.cx> writes:
> 
> > Does this patch help?
> >
> >  pretty.c | 10 ++++++----
> >  1 file changed, 6 insertions(+), 4 deletions(-)
> >
> > diff --git a/pretty.c b/pretty.c
> > index d3a82d2..713eefc 100644
> > --- a/pretty.c
> > +++ b/pretty.c
> > @@ -405,8 +405,8 @@ void pp_user_info(const struct pretty_print_context *pp,
> >  	const char *mailbuf, *namebuf;
> >  	size_t namelen, maillen;
> >  	int max_length = 78; /* per rfc2822 */
> > -	unsigned long time;
> > -	int tz;
> > +	unsigned long time = 0;
> > +	int tz = 0;
> >  
> >  	if (pp->fmt == CMIT_FMT_ONELINE)
> >  		return;
> > @@ -438,8 +438,10 @@ void pp_user_info(const struct pretty_print_context *pp,
> >  	strbuf_add(&name, namebuf, namelen);
> >  
> >  	namelen = name.len + mail.len + 3; /* ' ' + '<' + '>' */
> > -	time = strtoul(ident.date_begin, &date, 10);
> > -	tz = strtol(date, NULL, 10);
> > +	if (ident.date_begin) {
> > +		time = strtoul(ident.date_begin, &date, 10);
> > +		tz = strtol(date, NULL, 10);
> > +	}
> >  
> >  	if (pp->fmt == CMIT_FMT_EMAIL) {
> >  		strbuf_addstr(sb, "From: ");
> 
> Looks like a sensible change.  split_ident_line() decided that the
> given input was mangled and decided there is no valid date (the
> input had <> where the timestamp string was required), so the
> updated code leaves the time/tz unspecified.

Hmm. This seemed oddly familiar to me, and indeed:

  http://thread.gmane.org/gmane.comp.version-control.git/216870/focus=217077

We need to fix blame, too, and there is a question of how "cat-file -p"
behaves.

-Peff

      parent reply	other threads:[~2013-04-16 21:34 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-16 16:55 git log - crash and core dump Ivan Lyapunov
2013-04-16 17:29 ` Antoine Pelisse
2013-04-16 18:09 ` René Scharfe
2013-04-16 19:45   ` Junio C Hamano
2013-04-16 21:10     ` René Scharfe
2013-04-16 22:21       ` Junio C Hamano
2013-04-17  2:50         ` Ivan Lyapunov
2013-04-17  5:22           ` Ivan Lyapunov
2013-04-17  8:27             ` John Keeping
2013-04-17  9:14               ` Ivan Lyapunov
2013-04-17  9:43                 ` Konstantin Khomoutov
     [not found]                   ` <CANKwXW1heci+D5ZO3aF+dMN9davRawuZuKz0bf2n3iRiMjjgHg@mail.gmail.com>
2013-04-17 10:23                     ` Ivan Lyapunov
2013-04-17  5:26         ` Junio C Hamano
2013-04-17  6:39           ` Jeff King
2013-04-17 17:51             ` Junio C Hamano
2013-04-17 17:59             ` René Scharfe
2013-04-17 18:02               ` Jeff King
2013-04-17 19:06                 ` René Scharfe
2013-04-17 21:00                   ` [PATCH] cat-file: print tags raw for "cat-file -p" Jeff King
2013-04-19  3:03                     ` Eric Sunshine
2013-04-17 18:33               ` [PATCH] pretty: handle broken commit headers gracefully René Scharfe
2013-04-17 18:33               ` [PATCH] blame: " René Scharfe
2013-04-17 21:07                 ` Jeff King
2013-04-17 21:22                   ` René Scharfe
2013-04-17 21:55                   ` Junio C Hamano
2013-04-18 16:56                     ` Jeff King
2013-04-16 21:24     ` git log - crash and core dump Antoine Pelisse
2013-04-16 21:34     ` Jeff King [this message]

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=20130416213414.GA11229@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=apelisse@gmail.com \
    --cc=dront78@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=rene.scharfe@lsrfire.ath.cx \
    /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).