Merge branch 'jk/parseopt-string-list' into jk/string-list-static-init
authorJunio C Hamano <gitster@pobox.com>
Mon, 13 Jun 2016 17:37:48 +0000 (10:37 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 13 Jun 2016 17:37:48 +0000 (10:37 -0700)
* 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

1  2 
builtin/blame.c
builtin/interpret-trailers.c
builtin/shortlog.c
parse-options-cb.c
diff --cc builtin/blame.c
index 21f42b0b62b81b637f1cc9589cd6c0306a93d05e,9b1701d31494c5fe6d1c473b743ac30a6f00b8a8..80d24315b3ae3b7bbf3674356673b1af37fc4084
@@@ -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)")),
index b99ae4be8875ad8fb41fd8be2a84b6191681a4e4,b75e95311177f1db1907e44b36317a94d28ee38d..175f14797b101d22ead9d1008744440da66a7c1c
@@@ -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")),
Simple merge
Simple merge