From: Junio C Hamano Date: Wed, 26 Oct 2016 20:14:45 +0000 (-0700) Subject: Merge branch 'mg/gpg-richer-status' X-Git-Tag: v2.11.0-rc0~44 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/56d268bafff7538f82c01d3c9c07bdc54b2993b1?hp=-c Merge branch 'mg/gpg-richer-status' The GPG verification status shown in "%G?" pretty format specifier was not rich enough to differentiate a signature made by an expired key, a signature made by a revoked key, etc. New output letters have been assigned to express them. * mg/gpg-richer-status: gpg-interface: use more status letters --- 56d268bafff7538f82c01d3c9c07bdc54b2993b1 diff --combined Documentation/pretty-formats.txt index 69c289dd0c,179c9389aa..3bcee2ddb1 --- a/Documentation/pretty-formats.txt +++ b/Documentation/pretty-formats.txt @@@ -143,8 -143,14 +143,14 @@@ ifndef::git-rev-list[ - '%N': commit notes endif::git-rev-list[] - '%GG': raw verification message from GPG for a signed commit - - '%G?': show "G" for a good (valid) signature, "B" for a bad signature, - "U" for a good signature with unknown validity and "N" for no signature + - '%G?': show "G" for a good (valid) signature, + "B" for a bad signature, + "U" for a good signature with unknown validity, + "X" for a good signature that has expired, + "Y" for a good signature made by an expired key, + "R" for a good signature made by a revoked key, + "E" if the signature cannot be checked (e.g. missing key) + and "N" for no signature - '%GS': show the name of the signer for a signed commit - '%GK': show the key used to sign a signed commit - '%gD': reflog selector, e.g., `refs/stash@{1}` or @@@ -166,8 -172,7 +172,8 @@@ - '%Cgreen': switch color to green - '%Cblue': switch color to blue - '%Creset': reset color -- '%C(...)': color specification, as described in color.branch.* config option; +- '%C(...)': color specification, as described under Values in the + "CONFIGURATION FILE" section of linkgit:git-config[1]; adding `auto,` at the beginning will emit color only when colors are enabled for log output (by `color.diff`, `color.ui`, or `--color`, and respecting the `auto` settings of the former if we are going to a diff --combined pretty.c index 0c31495240,f98b271069..37b2c3b1f9 --- a/pretty.c +++ b/pretty.c @@@ -544,13 -544,15 +544,13 @@@ static void add_merge_info(const struc strbuf_addstr(sb, "Merge:"); while (parent) { - struct commit *p = parent->item; - const char *hex = NULL; + struct object_id *oidp = &parent->item->object.oid; + strbuf_addch(sb, ' '); if (pp->abbrev) - hex = find_unique_abbrev(p->object.oid.hash, pp->abbrev); - if (!hex) - hex = oid_to_hex(&p->object.oid); + strbuf_add_unique_abbrev(sb, oidp->hash, pp->abbrev); + else + strbuf_addstr(sb, oid_to_hex(oidp)); parent = parent->next; - - strbuf_addf(sb, " %s", hex); } strbuf_addch(sb, '\n'); } @@@ -1070,7 -1072,7 +1070,7 @@@ static size_t format_commit_one(struct case 'C': if (starts_with(placeholder + 1, "(auto)")) { c->auto_color = want_color(c->pretty_ctx->color); - if (c->auto_color) + if (c->auto_color && sb->len) strbuf_addstr(sb, GIT_COLOR_RESET); return 7; /* consumed 7 bytes, "C(auto)" */ } else { @@@ -1230,8 -1232,12 +1230,12 @@@ switch (c->signature_check.result) { case 'G': case 'B': + case 'E': case 'U': case 'N': + case 'X': + case 'Y': + case 'R': strbuf_addch(sb, c->signature_check.result); } break;