X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin-log.c;h=25e21ed41534c8c3067c2e0d5afe4284faa2881a;hb=a97a74686d70a318cd802003498054cc1e8b0ae2;hp=3817bf11864dbe5bff2c1004abec2b97210a0c36;hpb=67f272c2f21a3d5a372b113b91836455d45257a7;p=git.git diff --git a/builtin-log.c b/builtin-log.c index 3817bf118..25e21ed41 100644 --- a/builtin-log.c +++ b/builtin-log.c @@ -35,6 +35,7 @@ static void cmd_log_init(int argc, const char **argv, const char *prefix, struct rev_info *rev) { int i; + int decoration_style = 0; rev->abbrev = DEFAULT_ABBREV; rev->commit_format = CMIT_FMT_DEFAULT; @@ -61,8 +62,15 @@ static void cmd_log_init(int argc, const char **argv, const char *prefix, for (i = 1; i < argc; i++) { const char *arg = argv[i]; if (!strcmp(arg, "--decorate")) { - load_ref_decorations(); - rev->show_decorations = 1; + decoration_style = DECORATE_SHORT_REFS; + } else if (!prefixcmp(arg, "--decorate=")) { + const char *v = skip_prefix(arg, "--decorate="); + if (!strcmp(v, "full")) + decoration_style = DECORATE_FULL_REFS; + else if (!strcmp(v, "short")) + decoration_style = DECORATE_SHORT_REFS; + else + die("invalid --decorate option: %s", arg); } else if (!strcmp(arg, "--source")) { rev->show_source = 1; } else if (!strcmp(arg, "-h")) { @@ -70,6 +78,10 @@ static void cmd_log_init(int argc, const char **argv, const char *prefix, } else die("unrecognized argument: %s", arg); } + if (decoration_style) { + rev->show_decorations = 1; + load_ref_decorations(decoration_style); + } } /* @@ -670,6 +682,10 @@ static void make_cover_letter(struct rev_info *rev, int use_stdout, log_write_email_headers(rev, head, &subject_start, &extra_headers, &need_8bit_cte); + for (i = 0; !need_8bit_cte && i < nr; i++) + if (has_non_ascii(list[i]->buffer)) + need_8bit_cte = 1; + msg = body; pp_user_info(NULL, CMIT_FMT_EMAIL, &sb, committer, DATE_RFC2822, encoding);