@matheusbsbs / matheus-bagliano / commits / 028656552b
Fork 0

Remove dead code: show_log() sep argument and diff_options.msg_sep

These variables were made unnecessary by commit 3969cf7db1a13a78f3b7a36d8c1084bbe0a53459. Signed-off-by: Adam Simpkins <adam@adamsimpkins.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Adam Simpkins committed Apr 29, 2008 at 01:32 UTC 028656552bc758b192027c25a1143f1c6ca66d64
6 files changed +13 -25
builtin-log.c
-1
@@ -770,7 +770,6 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
770 rev.diff = 1;
771 rev.combine_merges = 0;
772 rev.ignore_merges = 1;
773 - rev.diffopt.msg_sep = "";
773 DIFF_OPT_SET(&rev.diffopt, RECURSIVE);
774
775 rev.subject_prefix = fmt_patch_subject_prefix;
combine-diff.c
+3 -3
@@ -798,7 +798,7 @@ static void show_patch_diff(struct combine_diff_path *elem, int num_parent,
798 int deleted = 0;
799
800 if (rev->loginfo && !rev->no_commit_id)
801 - show_log(rev, opt->msg_sep);
801 + show_log(rev);
802 dump_quoted_path(dense ? "diff --cc " : "diff --combined ",
803 "", elem->path, c_meta, c_reset);
804 printf("%sindex ", c_meta);
@@ -881,7 +881,7 @@ static void show_raw_diff(struct combine_diff_path *p, int num_parent, struct re
881 inter_name_termination = 0;
882
883 if (rev->loginfo && !rev->no_commit_id)
884 - show_log(rev, opt->msg_sep);
884 + show_log(rev);
885
886 if (opt->output_format & DIFF_FORMAT_RAW) {
887 offset = strlen(COLONS) - num_parent;
@@ -962,7 +962,7 @@ void diff_tree_combined(const unsigned char *sha1,
962 paths = intersect_paths(paths, i, num_parent);
963
964 if (show_log_first && i == 0) {
965 - show_log(rev, opt->msg_sep);
965 + show_log(rev);
966 if (rev->verbose_header && opt->output_format)
967 putchar(opt->line_termination);
968 }
diff.c
-1
@@ -2220,7 +2220,6 @@ void diff_setup(struct diff_options *options)
2220 options->rename_limit = -1;
2221 options->dirstat_percent = 3;
2222 options->context = 3;
2223 - options->msg_sep = "";
2223
2224 options->change = diff_change;
2225 options->add_remove = diff_addremove;
diff.h
-1
@@ -88,7 +88,6 @@ struct diff_options {
88 int abbrev;
89 const char *prefix;
90 int prefix_length;
91 - const char *msg_sep;
91 const char *stat_sep;
92 long xdl_opts;
93
log-tree.c
+9 -18
@@ -208,14 +208,13 @@ void log_write_email_headers(struct rev_info *opt, const char *name,
208 *extra_headers_p = extra_headers;
209 }
210
211 -void show_log(struct rev_info *opt, const char *sep)
211 +void show_log(struct rev_info *opt)
212 {
213 struct strbuf msgbuf;
214 struct log_info *log = opt->loginfo;
215 struct commit *commit = log->commit, *parent = log->parent;
216 int abbrev = opt->diffopt.abbrev;
217 int abbrev_commit = opt->abbrev_commit ? opt->abbrev : 40;
218 - const char *extra;
218 const char *subject = NULL, *extra_headers = opt->extra_headers;
219 int need_8bit_cte = 0;
220
@@ -240,17 +239,10 @@ void show_log(struct rev_info *opt, const char *sep)
239 }
240
241 /*
243 - * The "oneline" format has several special cases:
244 - * - The pretty-printed commit lacks a newline at the end
245 - * of the buffer, but we do want to make sure that we
246 - * have a newline there. If the separator isn't already
247 - * a newline, add an extra one.
248 - * - unlike other log messages, the one-line format does
249 - * not have an empty line between entries.
242 + * If use_terminator is set, add a newline at the end of the entry.
243 + * Otherwise, add a diffopt.line_termination character before all
244 + * entries but the first. (IOW, as a separator between entries)
245 */
251 - extra = "";
252 - if (*sep != '\n' && opt->use_terminator)
253 - extra = "\n";
246 if (opt->shown_one && !opt->use_terminator)
247 putchar(opt->diffopt.line_termination);
248 opt->shown_one = 1;
@@ -292,10 +284,8 @@ void show_log(struct rev_info *opt, const char *sep)
284 show_reflog_message(opt->reflog_info,
285 opt->commit_format == CMIT_FMT_ONELINE,
286 opt->date_mode);
295 - if (opt->commit_format == CMIT_FMT_ONELINE) {
296 - printf("%s", sep);
287 + if (opt->commit_format == CMIT_FMT_ONELINE)
288 return;
298 - }
289 }
290 }
291
@@ -319,7 +309,8 @@ void show_log(struct rev_info *opt, const char *sep)
309
310 if (msgbuf.len) {
311 fwrite(msgbuf.buf, sizeof(char), msgbuf.len, stdout);
322 - printf("%s%s", extra, sep);
312 + if (opt->use_terminator)
313 + putchar('\n');
314 }
315 strbuf_release(&msgbuf);
316 }
@@ -342,7 +333,7 @@ int log_tree_diff_flush(struct rev_info *opt)
333 * an extra newline between the end of log and the
334 * output for readability.
335 */
345 - show_log(opt, opt->diffopt.msg_sep);
336 + show_log(opt);
337 if ((opt->diffopt.output_format & ~DIFF_FORMAT_NO_OUTPUT) &&
338 opt->verbose_header &&
339 opt->commit_format != CMIT_FMT_ONELINE) {
@@ -430,7 +421,7 @@ int log_tree_commit(struct rev_info *opt, struct commit *commit)
421 shown = log_tree_diff(opt, commit, &log);
422 if (!shown && opt->loginfo && opt->always_show_header) {
423 log.parent = NULL;
433 - show_log(opt, "");
424 + show_log(opt);
425 shown = 1;
426 }
427 opt->loginfo = NULL;
log-tree.h
+1 -1
@@ -11,7 +11,7 @@ void init_log_tree_opt(struct rev_info *);
11 int log_tree_diff_flush(struct rev_info *);
12 int log_tree_commit(struct rev_info *, struct commit *);
13 int log_tree_opt_parse(struct rev_info *, const char **, int);
14 -void show_log(struct rev_info *opt, const char *sep);
14 +void show_log(struct rev_info *opt);
15 void show_decorations(struct commit *commit);
16 void log_write_email_headers(struct rev_info *opt, const char *name,
17 const char **subject_p,