{"thread":{"id":"49984","subject":"[PATCH] style: the opening '{' of a function is in a separate line","startedAt":"2018-12-09T10:25:37Z","lastAt":"2018-12-10T18:51:58Z","messageCount":3,"participants":["Nguyễn Thái Ngọc Duy","Stefan Beller","Duy Nguyen"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"364841","messageId":"20181209102521.5301-1-pclouds@gmail.com","threadId":"49984","inReplyTo":null,"subject":"[PATCH] style: the opening '{' of a function is in a separate line","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-12-09T10:25:21Z","receivedAt":"2018-12-09T10:25:37Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n bisect.c                   | 3 ++-\n builtin/config.c           | 3 ++-\n builtin/push.c             | 4 +++-\n convert.c                  | 3 ++-\n credential-cache--daemon.c | 3 ++-\n diff.c                     | 6 ++++--\n git.c                      | 3 ++-\n imap-send.c                | 3 ++-\n remote-curl.c              | 3 ++-\n sequencer.c                | 6 ++++--\n string-list.c              | 3 ++-\n t/helper/test-sigchain.c   | 3 ++-\n transport-helper.c         | 3 ++-\n url.c                      | 3 ++-\n userdiff.c                 | 3 ++-\n 15 files changed, 35 insertions(+), 17 deletions(-)\n\ndiff --git a/bisect.c b/bisect.c\nindex 487675c672..bd140cde36 100644\n--- a/bisect.c\n+++ b/bisect.c\n@@ -558,7 +558,8 @@ struct commit_list *filter_skipped(struct commit_list *list,\n  * is increased by one between each call, but that should not matter\n  * for this application.\n  */\n-static unsigned get_prn(unsigned count) {\n+static unsigned get_prn(unsigned count)\n+{\n \tcount = count * 1103515245 + 12345;\n \treturn (count/65536) % PRN_MODULO;\n }\ndiff --git a/builtin/config.c b/builtin/config.c\nindex 84385ef165..99bc7ef64e 100644\n--- a/builtin/config.c\n+++ b/builtin/config.c\n@@ -164,7 +164,8 @@ static NORETURN void usage_builtin_config(void)\n \tusage_with_options(builtin_config_usage, builtin_config_options);\n }\n \n-static void check_argc(int argc, int min, int max) {\n+static void check_argc(int argc, int min, int max)\n+{\n \tif (argc >= min && argc <= max)\n \t\treturn;\n \tif (min == max)\ndiff --git a/builtin/push.c b/builtin/push.c\nindex 8bb8a0849b..759812d1d5 100644\n--- a/builtin/push.c\n+++ b/builtin/push.c\n@@ -143,7 +143,9 @@ static int push_url_of_remote(struct remote *remote, const char ***url_p)\n \treturn remote->url_nr;\n }\n \n-static NORETURN int die_push_simple(struct branch *branch, struct remote *remote) {\n+static NORETURN int die_push_simple(struct branch *branch,\n+\t\t\t\t    struct remote *remote)\n+{\n \t/*\n \t * There's no point in using shorten_unambiguous_ref here,\n \t * as the ambiguity would be on the remote side, not what\ndiff --git a/convert.c b/convert.c\nindex e0848226d2..bc40f01eb4 100644\n--- a/convert.c\n+++ b/convert.c\n@@ -778,7 +778,8 @@ static int start_multi_file_filter_fn(struct subprocess_entry *subprocess)\n \n static void handle_filter_error(const struct strbuf *filter_status,\n \t\t\t\tstruct cmd2process *entry,\n-\t\t\t\tconst unsigned int wanted_capability) {\n+\t\t\t\tconst unsigned int wanted_capability)\n+{\n \tif (!strcmp(filter_status->buf, \"error\"))\n \t\t; /* The filter signaled a problem with the file. */\n \telse if (!strcmp(filter_status->buf, \"abort\") && wanted_capability) {\ndiff --git a/credential-cache--daemon.c b/credential-cache--daemon.c\nindex 4dfbc8c9f9..ec1271f89c 100644\n--- a/credential-cache--daemon.c\n+++ b/credential-cache--daemon.c\n@@ -91,7 +91,8 @@ static timestamp_t check_expirations(void)\n }\n \n static int read_request(FILE *fh, struct credential *c,\n-\t\t\tstruct strbuf *action, int *timeout) {\n+\t\t\tstruct strbuf *action, int *timeout)\n+{\n \tstatic struct strbuf item = STRBUF_INIT;\n \tconst char *p;\n \ndiff --git a/diff.c b/diff.c\nindex dc9965e836..b5f573cf7a 100644\n--- a/diff.c\n+++ b/diff.c\n@@ -1637,7 +1637,8 @@ static void emit_hunk_header(struct emit_callback *ecbdata,\n \tstrbuf_release(&msgbuf);\n }\n \n-static struct diff_tempfile *claim_diff_tempfile(void) {\n+static struct diff_tempfile *claim_diff_tempfile(void)\n+{\n \tint i;\n \tfor (i = 0; i < ARRAY_SIZE(diff_temp); i++)\n \t\tif (!diff_temp[i].name)\n@@ -4819,7 +4820,8 @@ static int parse_diff_filter_opt(const char *optarg, struct diff_options *opt)\n \treturn 0;\n }\n \n-static void enable_patch_output(int *fmt) {\n+static void enable_patch_output(int *fmt)\n+{\n \t*fmt &= ~DIFF_FORMAT_NO_OUTPUT;\n \t*fmt |= DIFF_FORMAT_PATCH;\n }\ndiff --git a/git.c b/git.c\nindex 2f604a41ea..d69beaf3b0 100644\n--- a/git.c\n+++ b/git.c\n@@ -98,7 +98,8 @@ static int list_cmds(const char *spec)\n \treturn 0;\n }\n \n-static void commit_pager_choice(void) {\n+static void commit_pager_choice(void)\n+{\n \tswitch (use_pager) {\n \tcase 0:\n \t\tsetenv(\"GIT_PAGER\", \"cat\", 1);\ndiff --git a/imap-send.c b/imap-send.c\nindex b4eb886e2a..18ca6ba10a 100644\n--- a/imap-send.c\n+++ b/imap-send.c\n@@ -1471,7 +1471,8 @@ static CURL *setup_curl(struct imap_server_conf *srvc, struct credential *cred)\n }\n \n static int curl_append_msgs_to_imap(struct imap_server_conf *server,\n-\t\t\t\t    struct strbuf* all_msgs, int total) {\n+\t\t\t\t    struct strbuf* all_msgs, int total)\n+{\n \tint ofs = 0;\n \tint n = 0;\n \tstruct buffer msgbuf = { STRBUF_INIT, 0 };\ndiff --git a/remote-curl.c b/remote-curl.c\nindex 1220dffcdc..90d565c8c5 100644\n--- a/remote-curl.c\n+++ b/remote-curl.c\n@@ -617,7 +617,8 @@ static int probe_rpc(struct rpc_state *rpc, struct slot_results *results)\n \treturn err;\n }\n \n-static curl_off_t xcurl_off_t(size_t len) {\n+static curl_off_t xcurl_off_t(size_t len)\n+{\n \tuintmax_t size = len;\n \tif (size > maximum_signed_value_of_type(curl_off_t))\n \t\tdie(\"cannot handle pushes this big\");\ndiff --git a/sequencer.c b/sequencer.c\nindex e1a4dd15f1..55b609a7f4 100644\n--- a/sequencer.c\n+++ b/sequencer.c\n@@ -1670,7 +1670,8 @@ static int update_squash_messages(enum todo_command command,\n \treturn res;\n }\n \n-static void flush_rewritten_pending(void) {\n+static void flush_rewritten_pending(void)\n+{\n \tstruct strbuf buf = STRBUF_INIT;\n \tstruct object_id newoid;\n \tFILE *out;\n@@ -1695,7 +1696,8 @@ static void flush_rewritten_pending(void) {\n }\n \n static void record_in_rewritten(struct object_id *oid,\n-\t\tenum todo_command next_command) {\n+\t\tenum todo_command next_command)\n+{\n \tFILE *out = fopen_or_warn(rebase_path_rewritten_pending(), \"a\");\n \n \tif (!out)\ndiff --git a/string-list.c b/string-list.c\nindex 1f6063f2a2..a917955fbd 100644\n--- a/string-list.c\n+++ b/string-list.c\n@@ -155,7 +155,8 @@ static int item_is_not_empty(struct string_list_item *item, void *unused)\n \treturn *item->string != '\\0';\n }\n \n-void string_list_remove_empty_items(struct string_list *list, int free_util) {\n+void string_list_remove_empty_items(struct string_list *list, int free_util)\n+{\n \tfilter_string_list(list, free_util, item_is_not_empty, NULL);\n }\n \ndiff --git a/t/helper/test-sigchain.c b/t/helper/test-sigchain.c\nindex 77ac5bc33f..d013bccdda 100644\n--- a/t/helper/test-sigchain.c\n+++ b/t/helper/test-sigchain.c\n@@ -14,7 +14,8 @@ X(two)\n X(three)\n #undef X\n \n-int cmd__sigchain(int argc, const char **argv) {\n+int cmd__sigchain(int argc, const char **argv)\n+{\n \tsigchain_push(SIGTERM, one);\n \tsigchain_push(SIGTERM, two);\n \tsigchain_push(SIGTERM, three);\ndiff --git a/transport-helper.c b/transport-helper.c\nindex bf225c698f..4702e150f0 100644\n--- a/transport-helper.c\n+++ b/transport-helper.c\n@@ -1026,7 +1026,8 @@ static int push_refs(struct transport *transport,\n }\n \n \n-static int has_attribute(const char *attrs, const char *attr) {\n+static int has_attribute(const char *attrs, const char *attr)\n+{\n \tint len;\n \tif (!attrs)\n \t\treturn 0;\ndiff --git a/url.c b/url.c\nindex eaf4f07081..25576c390b 100644\n--- a/url.c\n+++ b/url.c\n@@ -104,7 +104,8 @@ void end_url_with_slash(struct strbuf *buf, const char *url)\n \tstrbuf_complete(buf, '/');\n }\n \n-void str_end_url_with_slash(const char *url, char **dest) {\n+void str_end_url_with_slash(const char *url, char **dest)\n+{\n \tstruct strbuf buf = STRBUF_INIT;\n \tend_url_with_slash(&buf, url);\n \tfree(*dest);\ndiff --git a/userdiff.c b/userdiff.c\nindex 46d34cc2a4..e0579522bd 100644\n--- a/userdiff.c\n+++ b/userdiff.c\n@@ -265,7 +265,8 @@ int userdiff_config(const char *k, const char *v)\n \treturn 0;\n }\n \n-struct userdiff_driver *userdiff_find_by_name(const char *name) {\n+struct userdiff_driver *userdiff_find_by_name(const char *name)\n+{\n \tint len = strlen(name);\n \treturn userdiff_find_by_namelen(name, len);\n }\n-- \n2.20.0.rc2.486.g9832c05c3d\n\n"},{"id":"364960","messageId":"CAGZ79kZpcgRFs=2NgaYHUAfRQ16u-LG7CjEJJg4+=oxUQ6Bbnw@mail.gmail.com","threadId":"49984","inReplyTo":"20181209102521.5301-1-pclouds@gmail.com","subject":"Re: [PATCH] style: the opening '{' of a function is in a separate line","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2018-12-10T18:46:59Z","receivedAt":"2018-12-10T18:47:13Z","isPatch":true,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"On Sun, Dec 9, 2018 at 2:25 AM Nguyễn Thái Ngọc Duy <pclouds@gmail.com> wrote:\n>\n> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n> ---\n>  bisect.c                   | 3 ++-\n>  builtin/config.c           | 3 ++-\n>  builtin/push.c             | 4 +++-\n>  convert.c                  | 3 ++-\n>  credential-cache--daemon.c | 3 ++-\n>  diff.c                     | 6 ++++--\n>  git.c                      | 3 ++-\n>  imap-send.c                | 3 ++-\n>  remote-curl.c              | 3 ++-\n>  sequencer.c                | 6 ++++--\n>  string-list.c              | 3 ++-\n>  t/helper/test-sigchain.c   | 3 ++-\n>  transport-helper.c         | 3 ++-\n>  url.c                      | 3 ++-\n>  userdiff.c                 | 3 ++-\n>  15 files changed, 35 insertions(+), 17 deletions(-)\n\nCan you say more about how you found these?\n(Are these all of them, or did you look through some subset of files?)\nOr did you use a formatting tool?\n"},{"id":"364965","messageId":"CACsJy8B=C05jc512yTRBy6s6BPu0kvfCo2mgoD7O-N29adMnKg@mail.gmail.com","threadId":"49984","inReplyTo":"CAGZ79kZpcgRFs=2NgaYHUAfRQ16u-LG7CjEJJg4+=oxUQ6Bbnw@mail.gmail.com","subject":"Re: [PATCH] style: the opening '{' of a function is in a separate line","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2018-12-10T18:51:29Z","receivedAt":"2018-12-10T18:51:58Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Mon, Dec 10, 2018 at 7:47 PM Stefan Beller <sbeller@google.com> wrote:\n>\n> On Sun, Dec 9, 2018 at 2:25 AM Nguyễn Thái Ngọc Duy <pclouds@gmail.com> wrote:\n> >\n> > Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n> > ---\n> >  bisect.c                   | 3 ++-\n> >  builtin/config.c           | 3 ++-\n> >  builtin/push.c             | 4 +++-\n> >  convert.c                  | 3 ++-\n> >  credential-cache--daemon.c | 3 ++-\n> >  diff.c                     | 6 ++++--\n> >  git.c                      | 3 ++-\n> >  imap-send.c                | 3 ++-\n> >  remote-curl.c              | 3 ++-\n> >  sequencer.c                | 6 ++++--\n> >  string-list.c              | 3 ++-\n> >  t/helper/test-sigchain.c   | 3 ++-\n> >  transport-helper.c         | 3 ++-\n> >  url.c                      | 3 ++-\n> >  userdiff.c                 | 3 ++-\n> >  15 files changed, 35 insertions(+), 17 deletions(-)\n>\n> Can you say more about how you found these?\n\nI was updating diff.c (65 patches coming soon!) and found one function\nthat triggered me. \"git grep '^static.*) {$'\" caught most of them. A\nbit more regex got some more but I don't even know if I have caught\nthem all.\n\n> (Are these all of them, or did you look through some subset of files?)\n\nI left compat and xdiff directories out if I remember correctly.\n\n> Or did you use a formatting tool?\n\nUnfortunately no. Perhaps clang-format can do it? I didn't try.\n-- \nDuy\n"}]}