Re: [PATCH 1/2] add '%d' pretty format specifier to show decoration

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux