From: Jeff King <peff@peff.net>
To: "René Scharfe" <rene.scharfe@lsrfire.ath.cx>
Cc: Junio C Hamano <gitster@pobox.com>,
Michael Dressel <MichaelTiloDressel@t-online.de>,
git@vger.kernel.org
Subject: Re: [PATCH 1/2] add '%d' pretty format specifier to show decoration
Date: Wed, 3 Sep 2008 23:51:40 -0400 [thread overview]
Message-ID: <20080904035139.GA28123@sigill.intra.peff.net> (raw)
In-Reply-To: <48BF0A5A.2040502@lsrfire.ath.cx>
On Thu, Sep 04, 2008 at 12:06:18AM +0200, René Scharfe wrote:
> The patch below does that by using a static variable to remember if the
> decorations have already been loaded. That's not too unreasonable, I
> think, because we currently have no way of unloading them.
Yes, I think lazy loading is a good solution here, since there is no
extra context that needs to be known to load the decorations.
> + case 'd':
> + if (add_again(sb, &c->decoration))
> + return 1;
> + format_decoration(sb, commit);
> + c->decoration.len = sb->len - c->decoration.off;
> + return 1;
The add_again chunk code is for things that take a long time (like
finding the shortest abbreviation for some hashes). I'm not sure this
counts as "long", as it is just doing a hash lookup on the decoration.
On the other hand, I doubt the extra couple of bytes used hurts much.
-Peff
next prev parent reply other threads:[~2008-09-04 3:52 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-03 18:40 [PATCH 1/2] add '%d' pretty format specifier to show decoration Michael Dressel
2008-09-03 19:12 ` Jeff King
2008-09-03 20:10 ` Junio C Hamano
2008-09-03 20:36 ` Jeff King
2008-09-03 20:59 ` Junio C Hamano
2008-09-03 21:04 ` Jeff King
2008-09-03 22:06 ` René Scharfe
2008-09-04 3:51 ` Jeff King [this message]
2008-09-04 15:47 ` René Scharfe
2008-09-04 21:38 ` [PATCH 1/3] log: add load_ref_decorations() René Scharfe
2008-09-04 21:39 ` [PATCH 2/3] move load_ref_decorations() to log-tree.c and export it René Scharfe
2008-09-04 21:40 ` [PATCH 3/3] add '%d' pretty format specifier to show decoration René Scharfe
2008-09-05 0:11 ` Jeff King
2008-09-05 0:28 ` Junio C Hamano
2008-09-05 0:37 ` Jeff King
2008-09-05 0:41 ` Junio C Hamano
2008-09-05 18:38 ` Michael Dressel
2008-09-09 17:33 ` Michael Dressel
2008-09-09 20:15 ` René Scharfe
2008-09-05 16:14 ` René Scharfe
2008-09-03 19:17 ` [PATCH 1/2] " Jeff King
2008-09-03 20:06 ` Michael Dressel
2008-09-03 20:33 ` Jeff King
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=20080904035139.GA28123@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=MichaelTiloDressel@t-online.de \
--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).