{"thread":{"id":"39967","subject":"[PATCH] parse-options: align curly braces for all options","startedAt":"2015-07-29T20:18:37Z","lastAt":"2015-07-29T21:36:27Z","messageCount":3,"participants":["Stefan Beller","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"267100","messageId":"1438201117-11543-1-git-send-email-sbeller@google.com","threadId":"39967","inReplyTo":null,"subject":"[PATCH] parse-options: align curly braces for all options","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2015-07-29T20:18:37Z","receivedAt":"2015-07-29T20:18:37Z","isPatch":true,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"Signed-off-by: Stefan Beller <sbeller@google.com>\n---\n\nThe non alignment of white space harmed my feelings for aesthetics more\nthan it should have.\n\n parse-options.h | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/parse-options.h b/parse-options.h\nindex c71e9da..08d7818 100644\n--- a/parse-options.h\n+++ b/parse-options.h\n@@ -126,7 +126,7 @@ struct option {\n #define OPT_BOOL(s, l, v, h)        OPT_SET_INT(s, l, v, h, 1)\n #define OPT_HIDDEN_BOOL(s, l, v, h) { OPTION_SET_INT, (s), (l), (v), NULL, \\\n \t\t\t\t      (h), PARSE_OPT_NOARG | PARSE_OPT_HIDDEN, NULL, 1}\n-#define OPT_CMDMODE(s, l, v, h, i) { OPTION_CMDMODE, (s), (l), (v), NULL, \\\n+#define OPT_CMDMODE(s, l, v, h, i)  { OPTION_CMDMODE, (s), (l), (v), NULL, \\\n \t\t\t\t      (h), PARSE_OPT_NOARG|PARSE_OPT_NONEG, NULL, (i) }\n #define OPT_INTEGER(s, l, v, h)     { OPTION_INTEGER, (s), (l), (v), N_(\"n\"), (h) }\n #define OPT_STRING(s, l, v, a, h)   { OPTION_STRING,  (s), (l), (v), (a), (h) }\n-- \n2.5.0.rc1.391.g15b60ce\n"},{"id":"267102","messageId":"xmqq7fpi904h.fsf@gitster.dls.corp.google.com","threadId":"39967","inReplyTo":"1438201117-11543-1-git-send-email-sbeller@google.com","subject":"Re: [PATCH] parse-options: align curly braces for all options","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-07-29T20:31:26Z","receivedAt":"2015-07-29T20:31:26Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Stefan Beller <sbeller@google.com> writes:\n\n> Signed-off-by: Stefan Beller <sbeller@google.com>\n> ---\n>\n> The non alignment of white space harmed my feelings for aesthetics more\n> than it should have.\n\nHmm, but this does not align curlies for OPT_DATE(),\nOPT_EXPIRY_DATE(), etc...\n\n>\n>  parse-options.h | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/parse-options.h b/parse-options.h\n> index c71e9da..08d7818 100644\n> --- a/parse-options.h\n> +++ b/parse-options.h\n> @@ -126,7 +126,7 @@ struct option {\n>  #define OPT_BOOL(s, l, v, h)        OPT_SET_INT(s, l, v, h, 1)\n>  #define OPT_HIDDEN_BOOL(s, l, v, h) { OPTION_SET_INT, (s), (l), (v), NULL, \\\n>  \t\t\t\t      (h), PARSE_OPT_NOARG | PARSE_OPT_HIDDEN, NULL, 1}\n> -#define OPT_CMDMODE(s, l, v, h, i) { OPTION_CMDMODE, (s), (l), (v), NULL, \\\n> +#define OPT_CMDMODE(s, l, v, h, i)  { OPTION_CMDMODE, (s), (l), (v), NULL, \\\n>  \t\t\t\t      (h), PARSE_OPT_NOARG|PARSE_OPT_NONEG, NULL, (i) }\n>  #define OPT_INTEGER(s, l, v, h)     { OPTION_INTEGER, (s), (l), (v), N_(\"n\"), (h) }\n>  #define OPT_STRING(s, l, v, a, h)   { OPTION_STRING,  (s), (l), (v), (a), (h) }\n"},{"id":"267110","messageId":"1438205787-23214-1-git-send-email-sbeller@google.com","threadId":"39967","inReplyTo":"xmqq7fpi904h.fsf@gitster.dls.corp.google.com","subject":"[PATCH] parse-options: align curly braces for all options","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2015-07-29T21:36:27Z","receivedAt":"2015-07-29T21:36:27Z","isPatch":true,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"Signed-off-by: Stefan Beller <sbeller@google.com>\n---\n\n>> The non alignment of white space harmed my feelings for aesthetics more\n>> than it should have.\n>\n> Hmm, but this does not align curlies for OPT_DATE(),\n> OPT_EXPIRY_DATE(), etc...\n\nThat's true, but that was the least invasive fix to appease the aesthetics\nas it was all nicely aligned in the beginning, then there was one outlier,\nand it was nice again, at the end it is a mess.\n\nHere is the another way to make it look nicer, though not minimally but rather\nextensive.\n\n parse-options.h | 79 ++++++++++++++++++++++++++++-----------------------------\n 1 file changed, 39 insertions(+), 40 deletions(-)\n\ndiff --git a/parse-options.h b/parse-options.h\nindex c71e9da..78e4462 100644\n--- a/parse-options.h\n+++ b/parse-options.h\n@@ -111,46 +111,45 @@ struct option {\n \tintptr_t defval;\n };\n \n-#define OPT_END()                   { OPTION_END }\n-#define OPT_ARGUMENT(l, h)          { OPTION_ARGUMENT, 0, (l), NULL, NULL, \\\n-\t\t\t\t      (h), PARSE_OPT_NOARG}\n-#define OPT_GROUP(h)                { OPTION_GROUP, 0, NULL, NULL, NULL, (h) }\n-#define OPT_BIT(s, l, v, h, b)      { OPTION_BIT, (s), (l), (v), NULL, (h), \\\n-\t\t\t\t      PARSE_OPT_NOARG, NULL, (b) }\n-#define OPT_NEGBIT(s, l, v, h, b)   { OPTION_NEGBIT, (s), (l), (v), NULL, \\\n-\t\t\t\t      (h), PARSE_OPT_NOARG, NULL, (b) }\n-#define OPT_COUNTUP(s, l, v, h)     { OPTION_COUNTUP, (s), (l), (v), NULL, \\\n-\t\t\t\t      (h), PARSE_OPT_NOARG }\n-#define OPT_SET_INT(s, l, v, h, i)  { OPTION_SET_INT, (s), (l), (v), NULL, \\\n-\t\t\t\t      (h), PARSE_OPT_NOARG, NULL, (i) }\n-#define OPT_BOOL(s, l, v, h)        OPT_SET_INT(s, l, v, h, 1)\n-#define OPT_HIDDEN_BOOL(s, l, v, h) { OPTION_SET_INT, (s), (l), (v), NULL, \\\n-\t\t\t\t      (h), PARSE_OPT_NOARG | PARSE_OPT_HIDDEN, NULL, 1}\n-#define OPT_CMDMODE(s, l, v, h, i) { OPTION_CMDMODE, (s), (l), (v), NULL, \\\n-\t\t\t\t      (h), PARSE_OPT_NOARG|PARSE_OPT_NONEG, NULL, (i) }\n-#define OPT_INTEGER(s, l, v, h)     { OPTION_INTEGER, (s), (l), (v), N_(\"n\"), (h) }\n-#define OPT_STRING(s, l, v, a, h)   { OPTION_STRING,  (s), (l), (v), (a), (h) }\n-#define OPT_STRING_LIST(s, l, v, a, h) \\\n-\t\t\t\t    { OPTION_CALLBACK, (s), (l), (v), (a), \\\n-\t\t\t\t      (h), 0, &parse_opt_string_list }\n-#define OPT_UYN(s, l, v, h)         { OPTION_CALLBACK, (s), (l), (v), NULL, \\\n-\t\t\t\t      (h), PARSE_OPT_NOARG, &parse_opt_tertiary }\n-#define OPT_DATE(s, l, v, h) \\\n-\t{ OPTION_CALLBACK, (s), (l), (v), N_(\"time\"),(h), 0,\t\\\n-\t  parse_opt_approxidate_cb }\n-#define OPT_EXPIRY_DATE(s, l, v, h) \\\n-\t{ OPTION_CALLBACK, (s), (l), (v), N_(\"expiry-date\"),(h), 0,\t\\\n-\t  parse_opt_expiry_date_cb }\n-#define OPT_CALLBACK(s, l, v, a, h, f) \\\n-\t{ OPTION_CALLBACK, (s), (l), (v), (a), (h), 0, (f) }\n-#define OPT_NUMBER_CALLBACK(v, h, f) \\\n-\t{ OPTION_NUMBER, 0, NULL, (v), NULL, (h), \\\n-\t  PARSE_OPT_NOARG | PARSE_OPT_NONEG, (f) }\n-#define OPT_FILENAME(s, l, v, h)    { OPTION_FILENAME, (s), (l), (v), \\\n-\t\t\t\t       N_(\"file\"), (h) }\n-#define OPT_COLOR_FLAG(s, l, v, h) \\\n-\t{ OPTION_CALLBACK, (s), (l), (v), N_(\"when\"), (h), PARSE_OPT_OPTARG, \\\n-\t\tparse_opt_color_flag_cb, (intptr_t)\"always\" }\n+#define OPT_END()                      { OPTION_END }\n+#define OPT_ARGUMENT(l, h)             { OPTION_ARGUMENT, 0, (l), NULL, NULL, \\\n+\t\t\t\t\t(h), PARSE_OPT_NOARG}\n+#define OPT_GROUP(h)                   { OPTION_GROUP, 0, NULL, NULL, NULL, \\\n+\t\t\t\t\t(h) }\n+#define OPT_BIT(s, l, v, h, b)         { OPTION_BIT, (s), (l), (v), NULL, \\\n+\t\t\t\t\t(h), PARSE_OPT_NOARG, NULL, (b) }\n+#define OPT_NEGBIT(s, l, v, h, b)      { OPTION_NEGBIT, (s), (l), (v), NULL, \\\n+\t\t\t\t\t(h), PARSE_OPT_NOARG, NULL, (b) }\n+#define OPT_COUNTUP(s, l, v, h)        { OPTION_COUNTUP, (s), (l), (v), NULL, \\\n+\t\t\t\t\t(h), PARSE_OPT_NOARG }\n+#define OPT_SET_INT(s, l, v, h, i)     { OPTION_SET_INT, (s), (l), (v), NULL, \\\n+\t\t\t\t\t(h), PARSE_OPT_NOARG, NULL, (i) }\n+#define OPT_BOOL(s, l, v, h)           OPT_SET_INT(s, l, v, \\\n+\t\t\t\t\t(h), 1)\n+#define OPT_HIDDEN_BOOL(s, l, v, h)    { OPTION_SET_INT, (s), (l), (v), NULL, \\\n+\t\t\t\t\t(h), PARSE_OPT_NOARG | PARSE_OPT_HIDDEN, NULL, 1}\n+#define OPT_CMDMODE(s, l, v, h, i)     { OPTION_CMDMODE, (s), (l), (v), NULL, \\\n+\t\t\t\t\t(h), PARSE_OPT_NOARG|PARSE_OPT_NONEG, NULL, (i) }\n+#define OPT_INTEGER(s, l, v, h)        { OPTION_INTEGER, (s), (l), (v), N_(\"n\"), \\\n+\t\t\t\t\t(h) }\n+#define OPT_STRING(s, l, v, a, h)      { OPTION_STRING,  (s), (l), (v), (a), \\\n+\t\t\t\t\t(h) }\n+#define OPT_STRING_LIST(s, l, v, a, h) { OPTION_CALLBACK, (s), (l), (v), (a), \\\n+\t\t\t\t\t(h), 0, &parse_opt_string_list }\n+#define OPT_UYN(s, l, v, h)            { OPTION_CALLBACK, (s), (l), (v), NULL, \\\n+\t\t\t\t\t(h), PARSE_OPT_NOARG, &parse_opt_tertiary }\n+#define OPT_DATE(s, l, v, h)           { OPTION_CALLBACK, (s), (l), (v), N_(\"time\"), \\\n+\t\t\t\t\t(h), 0, parse_opt_approxidate_cb }\n+#define OPT_EXPIRY_DATE(s, l, v, h)    { OPTION_CALLBACK, (s), (l), (v), N_(\"expiry-date\"), \\\n+\t\t\t\t\t(h), 0, parse_opt_expiry_date_cb }\n+#define OPT_CALLBACK(s, l, v, a, h, f) { OPTION_CALLBACK, (s), (l), (v), (a), \\\n+\t\t\t\t\t(h), 0, (f) }\n+#define OPT_NUMBER_CALLBACK(v, h, f)   { OPTION_NUMBER, 0, NULL, (v), NULL, \\\n+\t\t\t\t\t(h), PARSE_OPT_NOARG | PARSE_OPT_NONEG, (f) }\n+#define OPT_FILENAME(s, l, v, h)       { OPTION_FILENAME, (s), (l), (v), N_(\"file\"), \\\n+\t\t\t\t\t(h) }\n+#define OPT_COLOR_FLAG(s, l, v, h)     { OPTION_CALLBACK, (s), (l), (v), N_(\"when\"), \\\n+\t\t\t\t\t(h), PARSE_OPT_OPTARG, parse_opt_color_flag_cb, (intptr_t)\"always\" }\n \n #define OPT_NOOP_NOARG(s, l) \\\n \t{ OPTION_CALLBACK, (s), (l), NULL, NULL, \\\n-- \n2.5.0.rc1.391.g15b60ce\n"}]}