From: Junio C Hamano Date: Sat, 23 Jan 2010 00:08:01 +0000 (-0800) Subject: Merge branch 'jc/maint-limit-note-output' X-Git-Tag: v1.7.0-rc0~24 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/67bc7407211d26de518811dafc2c1cf2e6124709?ds=inline;hp=-c Merge branch 'jc/maint-limit-note-output' * jc/maint-limit-note-output: Fix "log --oneline" not to show notes Fix "log" family not to be too agressive about showing notes --- 67bc7407211d26de518811dafc2c1cf2e6124709 diff --combined builtin-log.c index 41b6df490f,2cb292fa72..8d16832f7e --- a/builtin-log.c +++ b/builtin-log.c @@@ -58,6 -58,9 +58,9 @@@ static void cmd_log_init(int argc, cons usage(builtin_log_usage); argc = setup_revisions(argc, argv, rev, "HEAD"); + if (!rev->show_notes_given && !rev->pretty_given) + rev->show_notes = 1; + if (rev->diffopt.pickaxe || rev->diffopt.filter) rev->always_show_header = 0; if (DIFF_OPT_TST(&rev->diffopt, FOLLOW_RENAMES)) { @@@ -567,7 -570,7 +570,7 @@@ static int reopen_stdout(struct commit get_patch_filename(commit, rev->nr, fmt_patch_suffix, &filename); - if (!DIFF_OPT_TST(&rev->diffopt, QUIET)) + if (!DIFF_OPT_TST(&rev->diffopt, QUICK)) fprintf(realstdout, "%s\n", filename.buf + outdir_offset); if (freopen(filename.buf, "w", stdout) == NULL) diff --combined commit.h index 24128d7a2a,2c0742b721..3cf5166581 --- a/commit.h +++ b/commit.h @@@ -70,9 -70,11 +70,10 @@@ struct pretty_print_contex const char *after_subject; enum date_mode date_mode; int need_8bit_cte; + int show_notes; struct reflog_walk_info *reflog_info; }; -extern int non_ascii(int); extern int has_non_ascii(const char *text); struct rev_info; /* in revision.h, it circularly uses enum cmit_fmt */ extern char *reencode_commit_message(const struct commit *commit, diff --combined pretty.c index 9001379a9d,b2ee7fe9de..d493cade26 --- a/pretty.c +++ b/pretty.c @@@ -83,7 -83,7 +83,7 @@@ static int get_one_line(const char *msg } /* High bit set, or ISO-2022-INT */ -int non_ascii(int ch) +static int non_ascii(int ch) { return !isascii(ch) || ch == '\033'; } @@@ -1094,7 -1094,7 +1094,7 @@@ void pretty_print_commit(enum cmit_fmt if (fmt == CMIT_FMT_EMAIL && sb->len <= beginning_of_body) strbuf_addch(sb, '\n'); - if (fmt != CMIT_FMT_ONELINE) + if (context->show_notes) get_commit_notes(commit, sb, encoding, NOTES_SHOW_HEADER | NOTES_INDENT); diff --combined revision.c index 25fa14d93e,34f9ab98d1..f3b82d97bc --- a/revision.c +++ b/revision.c @@@ -791,7 -791,7 +791,7 @@@ void init_revisions(struct rev_info *re revs->ignore_merges = 1; revs->simplify_history = 1; DIFF_OPT_SET(&revs->pruning, RECURSIVE); - DIFF_OPT_SET(&revs->pruning, QUIET); + DIFF_OPT_SET(&revs->pruning, QUICK); revs->pruning.add_remove = file_add_remove; revs->pruning.change = file_change; revs->lifo = 1; @@@ -1161,13 -1161,22 +1161,22 @@@ static int handle_revision_opt(struct r revs->verbose_header = 1; } else if (!strcmp(arg, "--pretty")) { revs->verbose_header = 1; + revs->pretty_given = 1; get_commit_format(arg+8, revs); } else if (!prefixcmp(arg, "--pretty=") || !prefixcmp(arg, "--format=")) { revs->verbose_header = 1; + revs->pretty_given = 1; get_commit_format(arg+9, revs); + } else if (!strcmp(arg, "--show-notes")) { + revs->show_notes = 1; + revs->show_notes_given = 1; + } else if (!strcmp(arg, "--no-notes")) { + revs->show_notes = 0; + revs->show_notes_given = 1; } else if (!strcmp(arg, "--oneline")) { revs->verbose_header = 1; get_commit_format("oneline", revs); + revs->pretty_given = 1; revs->abbrev_commit = 1; } else if (!strcmp(arg, "--graph")) { revs->topo_order = 1;