From: Junio C Hamano Date: Mon, 13 Jun 2016 17:37:48 +0000 (-0700) Subject: Merge branch 'jk/parseopt-string-list' into jk/string-list-static-init X-Git-Tag: v2.10.0-rc0~166^2~1 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/7013220d2b3181d4ae55e21e0f18b9abfd6e011d Merge branch 'jk/parseopt-string-list' into jk/string-list-static-init * jk/parseopt-string-list: blame,shortlog: don't make local option variables static interpret-trailers: don't duplicate option strings parse_opt_string_list: stop allocating new strings --- 7013220d2b3181d4ae55e21e0f18b9abfd6e011d diff --cc builtin/blame.c index 21f42b0b62,9b1701d314..80d24315b3 --- a/builtin/blame.c +++ b/builtin/blame.c @@@ -2520,14 -2502,13 +2520,14 @@@ int cmd_blame(int argc, const char **ar long dashdash_pos, lno; char *final_commit_name = NULL; enum object_type type; + struct commit *final_commit = NULL; - static struct string_list range_list; - static int output_option = 0, opt = 0; - static int show_stats = 0; - static const char *revs_file = NULL; - static const char *contents_from = NULL; - static const struct option options[] = { + struct string_list range_list = STRING_LIST_INIT_NODUP; + int output_option = 0, opt = 0; + int show_stats = 0; + const char *revs_file = NULL; + const char *contents_from = NULL; + const struct option options[] = { OPT_BOOL(0, "incremental", &incremental, N_("Show blame entries as we find them, incrementally")), OPT_BOOL('b', NULL, &blank_boundary, N_("Show blank SHA-1 for boundary commits (Default: off)")), OPT_BOOL(0, "root", &show_root, N_("Do not treat root commits as boundaries (Default: off)")), diff --cc builtin/interpret-trailers.c index b99ae4be88,b75e953111..175f14797b --- a/builtin/interpret-trailers.c +++ b/builtin/interpret-trailers.c @@@ -18,12 -18,10 +18,12 @@@ static const char * const git_interpret int cmd_interpret_trailers(int argc, const char **argv, const char *prefix) { + int in_place = 0; int trim_empty = 0; - struct string_list trailers = STRING_LIST_INIT_DUP; + struct string_list trailers = STRING_LIST_INIT_NODUP; struct option options[] = { + OPT_BOOL(0, "in-place", &in_place, N_("edit files in place")), OPT_BOOL(0, "trim-empty", &trim_empty, N_("trim empty trailers")), OPT_STRING_LIST(0, "trailer", &trailers, N_("trailer"), N_("trailer(s) to add")),