From 419fe5bc861517c789c8f028519e085fd8d1992f Mon Sep 17 00:00:00 2001 From: Stephen Boyd Date: Wed, 24 Mar 2010 00:15:58 -0700 Subject: [PATCH 1/7] fmt-merge-msg: be quiet if nothing to merge When FETCH_HEAD contains only 'not-for-merge' entries fmt-merge-msg still outputs "Merge" (and if the branch isn't master " into "). In this case fmt-merge-msg is outputting junk and should really just be quiet. Fix it. Signed-off-by: Stephen Boyd Signed-off-by: Junio C Hamano --- builtin/fmt-merge-msg.c | 3 +++ t/t6200-fmt-merge-msg.sh | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/builtin/fmt-merge-msg.c b/builtin/fmt-merge-msg.c index 9d524000b..9bb26255e 100644 --- a/builtin/fmt-merge-msg.c +++ b/builtin/fmt-merge-msg.c @@ -281,6 +281,9 @@ int fmt_merge_msg(int merge_summary, struct strbuf *in, struct strbuf *out) { die ("Error in line %d: %.*s", i, len, p); } + if (!srcs.nr) + return 0; + strbuf_addstr(out, "Merge "); for (i = 0; i < srcs.nr; i++) { struct src_data *src_data = srcs.payload[i]; diff --git a/t/t6200-fmt-merge-msg.sh b/t/t6200-fmt-merge-msg.sh index 42f6fff37..ade209af4 100755 --- a/t/t6200-fmt-merge-msg.sh +++ b/t/t6200-fmt-merge-msg.sh @@ -21,6 +21,8 @@ test_expect_success setup ' setdate && git commit -m "Initial" && + git clone . remote && + echo uno >one && echo dos >two && git add two && @@ -240,4 +242,21 @@ test_expect_success 'merge-msg -F in subdirectory' ' test_cmp expected actual ' +test_expect_success 'merge-msg with nothing to merge' ' + + git config --unset-all merge.log + git config --unset-all merge.summary + git config merge.summary yes && + + ( + cd remote && + git checkout -b unrelated && + setdate && + git fetch origin && + git fmt-merge-msg <.git/FETCH_HEAD >../actual + ) && + + test_cmp /dev/null actual +' + test_done From 6183a6adf140966d85521aa0360518743813ba37 Mon Sep 17 00:00:00 2001 From: Stephen Boyd Date: Wed, 24 Mar 2010 00:15:59 -0700 Subject: [PATCH 2/7] t6200: modernize with test_tick This test defines its own version of test_tick. Get rid of it. Signed-off-by: Stephen Boyd Signed-off-by: Junio C Hamano --- t/t6200-fmt-merge-msg.sh | 64 ++++++++++++++++++---------------------- 1 file changed, 29 insertions(+), 35 deletions(-) diff --git a/t/t6200-fmt-merge-msg.sh b/t/t6200-fmt-merge-msg.sh index ade209af4..b24c5bfd7 100755 --- a/t/t6200-fmt-merge-msg.sh +++ b/t/t6200-fmt-merge-msg.sh @@ -7,18 +7,10 @@ test_description='fmt-merge-msg test' . ./test-lib.sh -datestamp=1151939923 -setdate () { - GIT_COMMITTER_DATE="$datestamp +0200" - GIT_AUTHOR_DATE="$datestamp +0200" - datestamp=`expr "$datestamp" + 1` - export GIT_COMMITTER_DATE GIT_AUTHOR_DATE -} - test_expect_success setup ' echo one >one && git add one && - setdate && + test_tick && git commit -m "Initial" && git clone . remote && @@ -26,46 +18,48 @@ test_expect_success setup ' echo uno >one && echo dos >two && git add two && - setdate && + test_tick && git commit -a -m "Second" && git checkout -b left && - echo $datestamp >one && - setdate && + echo "c1" >one && + test_tick && git commit -a -m "Common #1" && - echo $datestamp >one && - setdate && + echo "c2" >one && + test_tick && git commit -a -m "Common #2" && git branch right && - echo $datestamp >two && - setdate && + echo "l3" >two && + test_tick && git commit -a -m "Left #3" && - echo $datestamp >two && - setdate && + echo "l4" >two && + test_tick && git commit -a -m "Left #4" && - echo $datestamp >two && - setdate && + echo "l5" >two && + test_tick && git commit -a -m "Left #5" && + git tag tag-l5 && git checkout right && - echo $datestamp >three && + echo "r3" >three && git add three && - setdate && + test_tick && git commit -a -m "Right #3" && + git tag tag-r3 && - echo $datestamp >three && - setdate && + echo "r4" >three && + test_tick && git commit -a -m "Right #4" && - echo $datestamp >three && - setdate && + echo "r5" >three && + test_tick && git commit -a -m "Right #5" && git show-branch @@ -115,7 +109,7 @@ test_expect_success 'merge-msg test #3-1' ' git config merge.log true && git checkout master && - setdate && + test_tick && git fetch . left && git fmt-merge-msg <.git/FETCH_HEAD >actual && @@ -129,7 +123,7 @@ test_expect_success 'merge-msg test #3-2' ' git config merge.summary true && git checkout master && - setdate && + test_tick && git fetch . left && git fmt-merge-msg <.git/FETCH_HEAD >actual && @@ -161,7 +155,7 @@ test_expect_success 'merge-msg test #4-1' ' git config merge.log true && git checkout master && - setdate && + test_tick && git fetch . left right && git fmt-merge-msg <.git/FETCH_HEAD >actual && @@ -175,7 +169,7 @@ test_expect_success 'merge-msg test #4-2' ' git config merge.summary true && git checkout master && - setdate && + test_tick && git fetch . left right && git fmt-merge-msg <.git/FETCH_HEAD >actual && @@ -189,7 +183,7 @@ test_expect_success 'merge-msg test #5-1' ' git config merge.log yes && git checkout master && - setdate && + test_tick && git fetch . left right && git fmt-merge-msg <.git/FETCH_HEAD >actual && @@ -203,7 +197,7 @@ test_expect_success 'merge-msg test #5-2' ' git config merge.summary yes && git checkout master && - setdate && + test_tick && git fetch . left right && git fmt-merge-msg <.git/FETCH_HEAD >actual && @@ -217,7 +211,7 @@ test_expect_success 'merge-msg -F' ' git config merge.summary yes && git checkout master && - setdate && + test_tick && git fetch . left right && git fmt-merge-msg -F .git/FETCH_HEAD >actual && @@ -231,7 +225,7 @@ test_expect_success 'merge-msg -F in subdirectory' ' git config merge.summary yes && git checkout master && - setdate && + test_tick && git fetch . left right && mkdir sub && cp .git/FETCH_HEAD sub/FETCH_HEAD && @@ -251,7 +245,7 @@ test_expect_success 'merge-msg with nothing to merge' ' ( cd remote && git checkout -b unrelated && - setdate && + test_tick && git fetch origin && git fmt-merge-msg <.git/FETCH_HEAD >../actual ) && From 6d6f6e68c3e2a18c3f02eba98e35ea13204ec68e Mon Sep 17 00:00:00 2001 From: Stephen Boyd Date: Wed, 24 Mar 2010 00:16:00 -0700 Subject: [PATCH 3/7] t6200: test fmt-merge-msg more Add some more tests so we don't break behavior upon modernizing fmt-merge-msg. Signed-off-by: Stephen Boyd Signed-off-by: Junio C Hamano --- t/t6200-fmt-merge-msg.sh | 115 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 115 insertions(+) diff --git a/t/t6200-fmt-merge-msg.sh b/t/t6200-fmt-merge-msg.sh index b24c5bfd7..42f8ece09 100755 --- a/t/t6200-fmt-merge-msg.sh +++ b/t/t6200-fmt-merge-msg.sh @@ -62,6 +62,14 @@ test_expect_success setup ' test_tick && git commit -a -m "Right #5" && + git checkout -b long && + i=0 && + while test $i -lt 30 + do + test_commit $i one && + i=$(($i+1)) + done && + git show-branch ' @@ -253,4 +261,111 @@ test_expect_success 'merge-msg with nothing to merge' ' test_cmp /dev/null actual ' +cat >expected <<\EOF +Merge tag 'tag-r3' + +* tag 'tag-r3': + Right #3 + Common #2 + Common #1 +EOF + +test_expect_success 'merge-msg tag' ' + + git config --unset-all merge.log + git config --unset-all merge.summary + git config merge.summary yes && + + git checkout master && + test_tick && + git fetch . tag tag-r3 && + + git fmt-merge-msg <.git/FETCH_HEAD >actual && + test_cmp expected actual +' + +cat >expected <<\EOF +Merge tags 'tag-r3' and 'tag-l5' + +* tag 'tag-r3': + Right #3 + Common #2 + Common #1 + +* tag 'tag-l5': + Left #5 + Left #4 + Left #3 + Common #2 + Common #1 +EOF + +test_expect_success 'merge-msg two tags' ' + + git config --unset-all merge.log + git config --unset-all merge.summary + git config merge.summary yes && + + git checkout master && + test_tick && + git fetch . tag tag-r3 tag tag-l5 && + + git fmt-merge-msg <.git/FETCH_HEAD >actual && + test_cmp expected actual +' + +cat >expected <<\EOF +Merge branch 'left', tag 'tag-r3' + +* tag 'tag-r3': + Right #3 + Common #2 + Common #1 + +* left: + Left #5 + Left #4 + Left #3 + Common #2 + Common #1 +EOF + +test_expect_success 'merge-msg tag and branch' ' + + git config --unset-all merge.log + git config --unset-all merge.summary + git config merge.summary yes && + + git checkout master && + test_tick && + git fetch . tag tag-r3 left && + + git fmt-merge-msg <.git/FETCH_HEAD >actual && + test_cmp expected actual +' + +cat >expected <<\EOF +Merge branch 'long' + +* long: (35 commits) +EOF + +test_expect_success 'merge-msg lots of commits' ' + + git checkout master && + test_tick && + git fetch . long && + + i=29 && + while test $i -gt 9 + do + echo " $i" && + i=$(($i-1)) + done >>expected && + echo " ..." >>expected + + git fmt-merge-msg <.git/FETCH_HEAD >actual && + test_cmp expected actual +' + test_done From 15cb500786c3bc618dafa3c6bc9535236e7bfdcd Mon Sep 17 00:00:00 2001 From: Stephen Boyd Date: Wed, 24 Mar 2010 00:16:01 -0700 Subject: [PATCH 4/7] fmt-merge-msg: use pretty.c routines This command duplicates functionality of the '%s' pretty format. Simplify the code a bit by using the pretty printing routine instead of open-coding it here. Signed-off-by: Stephen Boyd Signed-off-by: Junio C Hamano --- builtin/fmt-merge-msg.c | 29 ++++++++--------------------- 1 file changed, 8 insertions(+), 21 deletions(-) diff --git a/builtin/fmt-merge-msg.c b/builtin/fmt-merge-msg.c index 9bb26255e..44b74f447 100644 --- a/builtin/fmt-merge-msg.c +++ b/builtin/fmt-merge-msg.c @@ -185,6 +185,7 @@ static void shortlog(const char *name, unsigned char *sha1, struct object *branch; struct list subjects = { NULL, NULL, 0, 0 }; int flags = UNINTERESTING | TREESAME | SEEN | SHOWN | ADDED; + struct strbuf sb = STRBUF_INIT; branch = deref_tag(parse_object(sha1), sha1_to_hex(sha1), 40); if (!branch || branch->type != OBJ_COMMIT) @@ -198,7 +199,7 @@ static void shortlog(const char *name, unsigned char *sha1, if (prepare_revision_walk(rev)) die("revision walk setup failed"); while ((commit = get_revision(rev)) != NULL) { - char *oneline, *bol, *eol; + struct pretty_print_context ctx = {0}; /* ignore merges */ if (commit->parents && commit->parents->next) @@ -208,30 +209,16 @@ static void shortlog(const char *name, unsigned char *sha1, if (subjects.nr > limit) continue; - bol = strstr(commit->buffer, "\n\n"); - if (bol) { - unsigned char c; - do { - c = *++bol; - } while (isspace(c)); - if (!c) - bol = NULL; - } + format_commit_message(commit, "%s", &sb, &ctx); + strbuf_ltrim(&sb); - if (!bol) { + if (!sb.len) append_to_list(&subjects, xstrdup(sha1_to_hex( commit->object.sha1)), NULL); - continue; - } - - eol = strchr(bol, '\n'); - if (eol) { - oneline = xmemdupz(bol, eol - bol); - } else { - oneline = xstrdup(bol); - } - append_to_list(&subjects, oneline, NULL); + else + append_to_list(&subjects, strbuf_detach(&sb, NULL), + NULL); } if (count > limit) From e242148012196772e3fe2652d538fb923b91ca92 Mon Sep 17 00:00:00 2001 From: Stephen Boyd Date: Wed, 24 Mar 2010 00:16:02 -0700 Subject: [PATCH 5/7] string-list: add unsorted_string_list_lookup() Sometimes users need to lookup a string in an unsorted string_list. In that case they should use this function instead of the version for sorted strings. Signed-off-by: Stephen Boyd Signed-off-by: Junio C Hamano --- Documentation/technical/api-string-list.txt | 6 +++++- string-list.c | 13 ++++++++++--- string-list.h | 3 ++- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/Documentation/technical/api-string-list.txt b/Documentation/technical/api-string-list.txt index 293bb15d2..6d8c24bb1 100644 --- a/Documentation/technical/api-string-list.txt +++ b/Documentation/technical/api-string-list.txt @@ -104,8 +104,12 @@ write `string_list_insert(...)->util = ...;`. `unsorted_string_list_has_string`:: It's like `string_list_has_string()` but for unsorted lists. + +`unsorted_string_list_lookup`:: + + It's like `string_list_lookup()` but for unsorted lists. + -This function needs to look through all items, as opposed to its +The above two functions need to look through all items, as opposed to their counterpart for sorted lists, which performs a binary search. Data structures diff --git a/string-list.c b/string-list.c index 1ac536e63..c9ad7fcd4 100644 --- a/string-list.c +++ b/string-list.c @@ -168,12 +168,19 @@ void sort_string_list(struct string_list *list) qsort(list->items, list->nr, sizeof(*list->items), cmp_items); } -int unsorted_string_list_has_string(struct string_list *list, const char *string) +struct string_list_item *unsorted_string_list_lookup(struct string_list *list, + const char *string) { int i; for (i = 0; i < list->nr; i++) if (!strcmp(string, list->items[i].string)) - return 1; - return 0; + return list->items + i; + return NULL; +} + +int unsorted_string_list_has_string(struct string_list *list, + const char *string) +{ + return unsorted_string_list_lookup(list, string) != NULL; } diff --git a/string-list.h b/string-list.h index 6569cf607..63b69c8d7 100644 --- a/string-list.h +++ b/string-list.h @@ -38,5 +38,6 @@ struct string_list_item *string_list_lookup(const char *string, struct string_li struct string_list_item *string_list_append(const char *string, struct string_list *list); void sort_string_list(struct string_list *list); int unsorted_string_list_has_string(struct string_list *list, const char *string); - +struct string_list_item *unsorted_string_list_lookup(struct string_list *list, + const char *string); #endif /* STRING_LIST_H */ From fcb243f7dbfa30311c017346a7677c93ea5b1321 Mon Sep 17 00:00:00 2001 From: Stephen Boyd Date: Wed, 24 Mar 2010 00:16:03 -0700 Subject: [PATCH 6/7] fmt-merge-msg: remove custom string_list implementation This command uses a custom version of string list when it could just as easily use the string_list API. Convert it to use string_list and reduce the code size a bit. Signed-off-by: Stephen Boyd Signed-off-by: Junio C Hamano --- builtin/fmt-merge-msg.c | 127 ++++++++++++++-------------------------- 1 file changed, 44 insertions(+), 83 deletions(-) diff --git a/builtin/fmt-merge-msg.c b/builtin/fmt-merge-msg.c index 44b74f447..0fb401469 100644 --- a/builtin/fmt-merge-msg.c +++ b/builtin/fmt-merge-msg.c @@ -4,6 +4,7 @@ #include "diff.h" #include "revision.h" #include "tag.h" +#include "string-list.h" static const char * const fmt_merge_msg_usage[] = { "git fmt-merge-msg [--log|--no-log] [--file ]", @@ -24,58 +25,21 @@ static int fmt_merge_msg_config(const char *key, const char *value, void *cb) return 0; } -struct list { - char **list; - void **payload; - unsigned nr, alloc; +struct src_data { + struct string_list branch, tag, r_branch, generic; + int head_status; }; -static void append_to_list(struct list *list, char *value, void *payload) -{ - if (list->nr == list->alloc) { - list->alloc += 32; - list->list = xrealloc(list->list, sizeof(char *) * list->alloc); - list->payload = xrealloc(list->payload, - sizeof(char *) * list->alloc); - } - list->payload[list->nr] = payload; - list->list[list->nr++] = value; -} - -static int find_in_list(struct list *list, char *value) -{ - int i; - - for (i = 0; i < list->nr; i++) - if (!strcmp(list->list[i], value)) - return i; - - return -1; -} - -static void free_list(struct list *list) +void init_src_data(struct src_data *data) { - int i; - - if (list->alloc == 0) - return; - - for (i = 0; i < list->nr; i++) { - free(list->list[i]); - free(list->payload[i]); - } - free(list->list); - free(list->payload); - list->nr = list->alloc = 0; + data->branch.strdup_strings = 1; + data->tag.strdup_strings = 1; + data->r_branch.strdup_strings = 1; + data->generic.strdup_strings = 1; } -struct src_data { - struct list branch, tag, r_branch, generic; - int head_status; -}; - -static struct list srcs = { NULL, NULL, 0, 0}; -static struct list origins = { NULL, NULL, 0, 0}; +static struct string_list srcs = { NULL, 0, 0, 1 }; +static struct string_list origins = { NULL, 0, 0, 1 }; static int handle_line(char *line) { @@ -83,6 +47,7 @@ static int handle_line(char *line) unsigned char *sha1; char *src, *origin; struct src_data *src_data; + struct string_list_item *item; int pulling_head = 0; if (len < 43 || line[40] != '\t') @@ -115,64 +80,62 @@ static int handle_line(char *line) pulling_head = 1; } - i = find_in_list(&srcs, src); - if (i < 0) { - i = srcs.nr; - append_to_list(&srcs, xstrdup(src), - xcalloc(1, sizeof(struct src_data))); + item = unsorted_string_list_lookup(&srcs, src); + if (!item) { + item = string_list_append(src, &srcs); + item->util = xcalloc(1, sizeof(struct src_data)); + init_src_data(item->util); } - src_data = srcs.payload[i]; + src_data = item->util; if (pulling_head) { - origin = xstrdup(src); + origin = src; src_data->head_status |= 1; } else if (!prefixcmp(line, "branch ")) { - origin = xstrdup(line + 7); - append_to_list(&src_data->branch, origin, NULL); + origin = line + 7; + string_list_append(origin, &src_data->branch); src_data->head_status |= 2; } else if (!prefixcmp(line, "tag ")) { origin = line; - append_to_list(&src_data->tag, xstrdup(origin + 4), NULL); + string_list_append(origin + 4, &src_data->tag); src_data->head_status |= 2; } else if (!prefixcmp(line, "remote branch ")) { - origin = xstrdup(line + 14); - append_to_list(&src_data->r_branch, origin, NULL); + origin = line + 14; + string_list_append(origin, &src_data->r_branch); src_data->head_status |= 2; } else { - origin = xstrdup(src); - append_to_list(&src_data->generic, xstrdup(line), NULL); + origin = src; + string_list_append(line, &src_data->generic); src_data->head_status |= 2; } if (!strcmp(".", src) || !strcmp(src, origin)) { int len = strlen(origin); - if (origin[0] == '\'' && origin[len - 1] == '\'') { + if (origin[0] == '\'' && origin[len - 1] == '\'') origin = xmemdupz(origin + 1, len - 2); - } else { - origin = xstrdup(origin); - } } else { char *new_origin = xmalloc(strlen(origin) + strlen(src) + 5); sprintf(new_origin, "%s of %s", origin, src); origin = new_origin; } - append_to_list(&origins, origin, sha1); + string_list_append(origin, &origins)->util = sha1; return 0; } static void print_joined(const char *singular, const char *plural, - struct list *list, struct strbuf *out) + struct string_list *list, struct strbuf *out) { if (list->nr == 0) return; if (list->nr == 1) { - strbuf_addf(out, "%s%s", singular, list->list[0]); + strbuf_addf(out, "%s%s", singular, list->items[0].string); } else { int i; strbuf_addstr(out, plural); for (i = 0; i < list->nr - 1; i++) - strbuf_addf(out, "%s%s", i > 0 ? ", " : "", list->list[i]); - strbuf_addf(out, " and %s", list->list[list->nr - 1]); + strbuf_addf(out, "%s%s", i > 0 ? ", " : "", + list->items[i].string); + strbuf_addf(out, " and %s", list->items[list->nr - 1].string); } } @@ -183,7 +146,7 @@ static void shortlog(const char *name, unsigned char *sha1, int i, count = 0; struct commit *commit; struct object *branch; - struct list subjects = { NULL, NULL, 0, 0 }; + struct string_list subjects = { NULL, 0, 0, 1 }; int flags = UNINTERESTING | TREESAME | SEEN | SHOWN | ADDED; struct strbuf sb = STRBUF_INIT; @@ -213,12 +176,10 @@ static void shortlog(const char *name, unsigned char *sha1, strbuf_ltrim(&sb); if (!sb.len) - append_to_list(&subjects, xstrdup(sha1_to_hex( - commit->object.sha1)), - NULL); + string_list_append(sha1_to_hex(commit->object.sha1), + &subjects); else - append_to_list(&subjects, strbuf_detach(&sb, NULL), - NULL); + string_list_append(strbuf_detach(&sb, NULL), &subjects); } if (count > limit) @@ -230,7 +191,7 @@ static void shortlog(const char *name, unsigned char *sha1, if (i >= limit) strbuf_addf(out, " ...\n"); else - strbuf_addf(out, " %s\n", subjects.list[i]); + strbuf_addf(out, " %s\n", subjects.items[i].string); clear_commit_marks((struct commit *)branch, flags); clear_commit_marks(head, flags); @@ -238,7 +199,7 @@ static void shortlog(const char *name, unsigned char *sha1, rev->commits = NULL; rev->pending.nr = 0; - free_list(&subjects); + string_list_clear(&subjects, 0); } int fmt_merge_msg(int merge_summary, struct strbuf *in, struct strbuf *out) { @@ -273,14 +234,14 @@ int fmt_merge_msg(int merge_summary, struct strbuf *in, struct strbuf *out) { strbuf_addstr(out, "Merge "); for (i = 0; i < srcs.nr; i++) { - struct src_data *src_data = srcs.payload[i]; + struct src_data *src_data = srcs.items[i].util; const char *subsep = ""; strbuf_addstr(out, sep); sep = "; "; if (src_data->head_status == 1) { - strbuf_addstr(out, srcs.list[i]); + strbuf_addstr(out, srcs.items[i].string); continue; } if (src_data->head_status == 3) { @@ -309,8 +270,8 @@ int fmt_merge_msg(int merge_summary, struct strbuf *in, struct strbuf *out) { print_joined("commit ", "commits ", &src_data->generic, out); } - if (strcmp(".", srcs.list[i])) - strbuf_addf(out, " of %s", srcs.list[i]); + if (strcmp(".", srcs.items[i].string)) + strbuf_addf(out, " of %s", srcs.items[i].string); } if (!strcmp("master", current_branch)) @@ -329,7 +290,7 @@ int fmt_merge_msg(int merge_summary, struct strbuf *in, struct strbuf *out) { rev.limited = 1; for (i = 0; i < origins.nr; i++) - shortlog(origins.list[i], origins.payload[i], + shortlog(origins.items[i].string, origins.items[i].util, head, &rev, limit, out); } return 0; From 63e671508782ca2dd386e5878d3682090fd64eda Mon Sep 17 00:00:00 2001 From: Stephen Boyd Date: Wed, 24 Mar 2010 00:16:04 -0700 Subject: [PATCH 7/7] fmt-merge-msg: hide summary option The --summary command line option has been deprecated in favor of --log. Hide the option from the help message to further discourage the use of this option. Signed-off-by: Stephen Boyd Signed-off-by: Junio C Hamano --- builtin/fmt-merge-msg.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/builtin/fmt-merge-msg.c b/builtin/fmt-merge-msg.c index 0fb401469..379a03131 100644 --- a/builtin/fmt-merge-msg.c +++ b/builtin/fmt-merge-msg.c @@ -301,7 +301,9 @@ int cmd_fmt_merge_msg(int argc, const char **argv, const char *prefix) const char *inpath = NULL; struct option options[] = { OPT_BOOLEAN(0, "log", &merge_summary, "populate log with the shortlog"), - OPT_BOOLEAN(0, "summary", &merge_summary, "alias for --log"), + { OPTION_BOOLEAN, 0, "summary", &merge_summary, NULL, + "alias for --log (deprecated)", + PARSE_OPT_NOARG | PARSE_OPT_HIDDEN }, OPT_FILENAME('F', "file", &inpath, "file to read from"), OPT_END() };