{"thread":{"id":"37044","subject":"[PATCH] enums: remove trailing ',' after last item in enum","startedAt":"2014-07-02T18:24:05Z","lastAt":"2014-07-09T14:59:40Z","messageCount":4,"participants":["Ronnie Sahlberg","Jonathan Nieder","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"245338","messageId":"1404325445-17914-1-git-send-email-sahlberg@google.com","threadId":"37044","inReplyTo":null,"subject":"[PATCH] enums: remove trailing ',' after last item in enum","fromName":"Ronnie Sahlberg","fromEmail":"sahlberg@google.com","sentAt":"2014-07-02T18:24:05Z","receivedAt":"2014-07-02T18:24:05Z","isPatch":true,"sender":{"key":"sahlberg@google.com","avatar":"https://avatars.githubusercontent.com/u/7320636?v=4"},"body":"Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>\n---\n builtin/clean.c | 2 +-\n builtin/tag.c   | 2 +-\n pretty.c        | 2 +-\n 3 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/builtin/clean.c b/builtin/clean.c\nindex 9a91515..27701d2 100644\n--- a/builtin/clean.c\n+++ b/builtin/clean.c\n@@ -48,7 +48,7 @@ enum color_clean {\n \tCLEAN_COLOR_PROMPT = 2,\n \tCLEAN_COLOR_HEADER = 3,\n \tCLEAN_COLOR_HELP = 4,\n-\tCLEAN_COLOR_ERROR = 5,\n+\tCLEAN_COLOR_ERROR = 5\n };\n \n #define MENU_OPTS_SINGLETON\t\t01\ndiff --git a/builtin/tag.c b/builtin/tag.c\nindex c6e8a71..ef76556 100644\n--- a/builtin/tag.c\n+++ b/builtin/tag.c\n@@ -83,7 +83,7 @@ static int in_commit_list(const struct commit_list *want, struct commit *c)\n enum contains_result {\n \tCONTAINS_UNKNOWN = -1,\n \tCONTAINS_NO = 0,\n-\tCONTAINS_YES = 1,\n+\tCONTAINS_YES = 1\n };\n \n /*\ndiff --git a/pretty.c b/pretty.c\nindex 4f51287..924bc61 100644\n--- a/pretty.c\n+++ b/pretty.c\n@@ -274,7 +274,7 @@ static void add_rfc822_quoted(struct strbuf *out, const char *s, int len)\n \n enum rfc2047_type {\n \tRFC2047_SUBJECT,\n-\tRFC2047_ADDRESS,\n+\tRFC2047_ADDRESS\n };\n \n static int is_rfc2047_special(char ch, enum rfc2047_type type)\n-- \n2.0.1.442.g7fe6834.dirty\n"},{"id":"245348","messageId":"20140702195805.GD5816@google.com","threadId":"37044","inReplyTo":"1404325445-17914-1-git-send-email-sahlberg@google.com","subject":"Re: [PATCH] enums: remove trailing ',' after last item in enum","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2014-07-02T19:58:05Z","receivedAt":"2014-07-02T19:58:05Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Ronnie Sahlberg wrote:\n\n> Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>\n> ---\n>  builtin/clean.c | 2 +-\n>  builtin/tag.c   | 2 +-\n>  pretty.c        | 2 +-\n>  3 files changed, 3 insertions(+), 3 deletions(-)\n\nIs there some gcc option or other tool that can automatically detect\nthis kind of problem so the regress/fix cycle doesn't have to repeat\ntoo many times?\n\nLooks like v1.7.2-rc0~32^2~16 (2010-03-14) and v1.7.4.2~34 (2011-03-16)\ntried to fix this in the past.\n\nUsing the test from v1.7.4.2~34 also finds enums with trailing comma\nin\n\n grep.h\n log-tree.c\n\nThanks,\nJonathan\n"},{"id":"245351","messageId":"CAL=YDWmz+aQeDAukmH6mweX3q3Sn0g8XYzLxKKGgcQeO3BZNJw@mail.gmail.com","threadId":"37044","inReplyTo":"20140702195805.GD5816@google.com","subject":"Re: [PATCH] enums: remove trailing ',' after last item in enum","fromName":"Ronnie Sahlberg","fromEmail":"sahlberg@google.com","sentAt":"2014-07-02T20:08:16Z","receivedAt":"2014-07-02T20:08:16Z","isPatch":true,"sender":{"key":"sahlberg@google.com","avatar":"https://avatars.githubusercontent.com/u/7320636?v=4"},"body":"GCC can check/error for this with\n\n--pedantic -Werror\n\n\n\n\nOn Wed, Jul 2, 2014 at 12:58 PM, Jonathan Nieder <jrnieder@gmail.com> wrote:\n> Ronnie Sahlberg wrote:\n>\n>> Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>\n>> ---\n>>  builtin/clean.c | 2 +-\n>>  builtin/tag.c   | 2 +-\n>>  pretty.c        | 2 +-\n>>  3 files changed, 3 insertions(+), 3 deletions(-)\n>\n> Is there some gcc option or other tool that can automatically detect\n> this kind of problem so the regress/fix cycle doesn't have to repeat\n> too many times?\n>\n> Looks like v1.7.2-rc0~32^2~16 (2010-03-14) and v1.7.4.2~34 (2011-03-16)\n> tried to fix this in the past.\n>\n> Using the test from v1.7.4.2~34 also finds enums with trailing comma\n> in\n>\n>  grep.h\n>  log-tree.c\n>\n> Thanks,\n> Jonathan\n"},{"id":"245633","messageId":"xmqqr41u7f37.fsf@gitster.dls.corp.google.com","threadId":"37044","inReplyTo":"1404325445-17914-1-git-send-email-sahlberg@google.com","subject":"Re: [PATCH] enums: remove trailing ',' after last item in enum","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-07-09T14:59:40Z","receivedAt":"2014-07-09T14:59:40Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ronnie Sahlberg <sahlberg@google.com> writes:\n\n> Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>\n> ---\n\nLooks good; thanks.\n\n>  builtin/clean.c | 2 +-\n>  builtin/tag.c   | 2 +-\n>  pretty.c        | 2 +-\n>  3 files changed, 3 insertions(+), 3 deletions(-)\n>\n> diff --git a/builtin/clean.c b/builtin/clean.c\n> index 9a91515..27701d2 100644\n> --- a/builtin/clean.c\n> +++ b/builtin/clean.c\n> @@ -48,7 +48,7 @@ enum color_clean {\n>  \tCLEAN_COLOR_PROMPT = 2,\n>  \tCLEAN_COLOR_HEADER = 3,\n>  \tCLEAN_COLOR_HELP = 4,\n> -\tCLEAN_COLOR_ERROR = 5,\n> +\tCLEAN_COLOR_ERROR = 5\n>  };\n>  \n>  #define MENU_OPTS_SINGLETON\t\t01\n> diff --git a/builtin/tag.c b/builtin/tag.c\n> index c6e8a71..ef76556 100644\n> --- a/builtin/tag.c\n> +++ b/builtin/tag.c\n> @@ -83,7 +83,7 @@ static int in_commit_list(const struct commit_list *want, struct commit *c)\n>  enum contains_result {\n>  \tCONTAINS_UNKNOWN = -1,\n>  \tCONTAINS_NO = 0,\n> -\tCONTAINS_YES = 1,\n> +\tCONTAINS_YES = 1\n>  };\n>  \n>  /*\n> diff --git a/pretty.c b/pretty.c\n> index 4f51287..924bc61 100644\n> --- a/pretty.c\n> +++ b/pretty.c\n> @@ -274,7 +274,7 @@ static void add_rfc822_quoted(struct strbuf *out, const char *s, int len)\n>  \n>  enum rfc2047_type {\n>  \tRFC2047_SUBJECT,\n> -\tRFC2047_ADDRESS,\n> +\tRFC2047_ADDRESS\n>  };\n>  \n>  static int is_rfc2047_special(char ch, enum rfc2047_type type)\n"}]}