From: Junio C Hamano Date: Tue, 18 Apr 2006 20:56:36 +0000 (-0700) Subject: Merge branch 'lt/logopt' X-Git-Tag: v1.4.0-rc1~239 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=34e98ea56414adc5a582e6368e8ec9c109dbee48;p=git.git Merge branch 'lt/logopt' * lt/logopt: Fix "git log --stat": make sure to set recursive with --stat. combine-diff: show diffstat with the first parent. git.c: LOGSIZE is unused after log printing cleanup. Log message printout cleanups (#3): fix --pretty=oneline Log message printout cleanups (#2) Log message printout cleanups rev-list --header: output format fix Fixes for option parsing log/whatchanged/show - log formatting cleanup. Simplify common default options setup for built-in log family. Tentative built-in "git show" Built-in git-whatchanged. rev-list option parser fix. Split init_revisions() out of setup_revisions() Fix up rev-list option parsing. Fix up default abbrev in setup_revisions() argument parser. Common option parsing for "git log --diff" and friends --- 34e98ea56414adc5a582e6368e8ec9c109dbee48 diff --cc combine-diff.c index 9445e86c2,27f6f57f3..ca36f5d5e --- a/combine-diff.c +++ b/combine-diff.c @@@ -584,12 -585,22 +585,22 @@@ static void reuse_combine_diff(struct s sline->p_lno[i] = sline->p_lno[j]; } + static void dump_quoted_path(const char *prefix, const char *path) + { + fputs(prefix, stdout); + if (quote_c_style(path, NULL, NULL, 0)) + quote_c_style(path, NULL, stdout, 0); + else + printf("%s", path); + putchar('\n'); + } + static int show_patch_diff(struct combine_diff_path *elem, int num_parent, - int dense, const char *header, - struct diff_options *opt) + int dense, struct rev_info *rev) { + struct diff_options *opt = &rev->diffopt; unsigned long result_size, cnt, lno; - char *result, *cp, *ep; + char *result, *cp; struct sline *sline; /* survived lines */ int mode_differs = 0; int i, show_hunks, shown_header = 0; @@@ -749,9 -756,10 +755,10 @@@ #define COLONS "::::::::::::::::::::::::::::::::" - static void show_raw_diff(struct combine_diff_path *p, int num_parent, const char *header, struct diff_options *opt) + static void show_raw_diff(struct combine_diff_path *p, int num_parent, struct rev_info *rev) { + struct diff_options *opt = &rev->diffopt; - int i, offset, mod_type = 'A'; + int i, offset; const char *prefix; int line_termination, inter_name_termination; @@@ -760,9 -768,16 +767,9 @@@ if (!line_termination) inter_name_termination = 0; - if (header) - printf("%s%c", header, line_termination); + if (rev->loginfo) + show_log(rev, rev->loginfo, "\n"); - for (i = 0; i < num_parent; i++) { - if (p->parent[i].mode) - mod_type = 'M'; - } - if (!p->mode) - mod_type = 'D'; - if (opt->output_format == DIFF_FORMAT_RAW) { offset = strlen(COLONS) - num_parent; if (offset < 0) diff --cc rev-list.c index a8fe83c5d,a4d72af6e..8b0ec388f --- a/rev-list.c +++ b/rev-list.c @@@ -365,14 -333,14 +333,16 @@@ int main(int argc, const char **argv list = revs.commits; - if (!list && - (!(revs.tag_objects||revs.tree_objects||revs.blob_objects) && !revs.pending_objects)) + if ((!list && + (!(revs.tag_objects||revs.tree_objects||revs.blob_objects) && + !revs.pending_objects)) || + revs.diff) usage(rev_list_usage); - save_commit_buffer = verbose_header; + save_commit_buffer = revs.verbose_header; track_object_refs = 0; + if (bisect_list) + revs.limited = 1; prepare_revision_walk(&revs); if (revs.tree_objects) diff --cc revision.h index 4b2704351,05f658a21..48d7b4ca9 --- a/revision.h +++ b/revision.h @@@ -7,10 -7,10 +7,11 @@@ #define SHOWN (1u<<3) #define TMP_MARK (1u<<4) /* for isolated cases; clean after use */ #define BOUNDARY (1u<<5) -#define ADDED (1u<<6) /* Parents already parsed and added? */ +#define BOUNDARY_SHOW (1u<<6) +#define ADDED (1u<<7) /* Parents already parsed and added? */ struct rev_info; + struct log_info; typedef void (prune_fn_t)(struct rev_info *revs, struct commit *commit);