From: Junio C Hamano Date: Mon, 27 Jun 2011 19:07:31 GMT Subject: Re: [PATCH 2/6] pretty: Add %D for script-friendly decoration Message-ID: <7voc1jw0ss.fsf@alter.siamese.dyndns.org> In-Reply-To: <9d9e18b8c062380025f52a6ff992fae51a17f5d1.1309133817.git.greg@quora.com> Greg Price writes: > +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.