From: Junio C Hamano Date: Tue, 16 Apr 2013 21:37:30 GMT Subject: Re: [PATCH v3 10/13] pretty: add %C(auto) for auto-coloring Message-ID: <7v8v4ijgx1.fsf@alter.siamese.dyndns.org> In-Reply-To: <1366100702-31745-11-git-send-email-pclouds@gmail.com> Nguyễn Thái Ngọc Duy writes: > case 'h': /* abbreviated commit hash */ > + strbuf_addstr(sb, diff_get_color(c->auto_color_next, DIFF_COMMIT)); > if (add_again(sb, &c->abbrev_commit_hash)) > return 1; Doesn't this early return mess things up? > strbuf_addstr(sb, find_unique_abbrev(commit->object.sha1, > c->pretty_ctx->abbrev)); > + strbuf_addstr(sb, diff_get_color(c->auto_color_next, DIFF_RESET)); > c->abbrev_commit_hash.len = sb->len - c->abbrev_commit_hash.off; > return 1;