Re: [PATCH 2/6] pretty: Add %D for script-friendly decoration
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 27, 2011, 19:07 UTC
- Message-ID
- <7voc1jw0ss.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <9d9e18b8c062380025f52a6ff992fae51a17f5d1.1309133817.git.greg@quora.com>
Greg Price <price@MIT.EDU> writes:
Show 11 quoted lines
> +static void format_decoration_short(struct strbuf *sb, const struct commit *commit)
> +{
> + const char *affixes[3] = {" (", ", ", ")"};
> + format_decoration(sb, commit, DECORATE_SHORT_REFS, affixes);
> +}
> +
> +static void format_decoration_full(struct strbuf *sb, const struct commit *commit)
> +{
> + const char *affixes[3] = {"", " ", ""};
> + format_decoration(sb, commit, DECORATE_FULL_REFS, affixes);
> }Nice and cute abstraction. I like this part of the series.