{"thread":{"id":"36001","subject":"[PATCH] help.c: rename function \"pretty_print_string_list\"","startedAt":"2014-02-28T19:27:29Z","lastAt":"2014-02-28T21:24:02Z","messageCount":2,"participants":["Ralf Thielow","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"235657","messageId":"1393615649-29248-1-git-send-email-ralf.thielow@gmail.com","threadId":"36001","inReplyTo":null,"subject":"[PATCH] help.c: rename function \"pretty_print_string_list\"","fromName":"Ralf Thielow","fromEmail":"ralf.thielow@gmail.com","sentAt":"2014-02-28T19:27:29Z","receivedAt":"2014-02-28T19:27:29Z","isPatch":true,"sender":{"key":"ralf.thielow@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1275832?v=4"},"body":"The part \"string_list\" of the name of function\n\"pretty_print_string_list\" is just an implementation\ndetail. The function pretty-prints command names so\nrename it to \"pretty_print_cmdnames\".\n\nSigned-off-by: Ralf Thielow <ralf.thielow@gmail.com>\n---\nJust noticed this while digging through Git codebase.\n\n help.c | 7 +++----\n 1 file changed, 3 insertions(+), 4 deletions(-)\n\ndiff --git a/help.c b/help.c\nindex df7d16d..b266b09 100644\n--- a/help.c\n+++ b/help.c\n@@ -78,8 +78,7 @@ void exclude_cmds(struct cmdnames *cmds, struct cmdnames *excludes)\n \tcmds->cnt = cj;\n }\n \n-static void pretty_print_string_list(struct cmdnames *cmds,\n-\t\t\t\t     unsigned int colopts)\n+static void pretty_print_cmdnames(struct cmdnames *cmds, unsigned int colopts)\n {\n \tstruct string_list list = STRING_LIST_INIT_NODUP;\n \tstruct column_options copts;\n@@ -209,14 +208,14 @@ void list_commands(unsigned int colopts,\n \t\tconst char *exec_path = git_exec_path();\n \t\tprintf_ln(_(\"available git commands in '%s'\"), exec_path);\n \t\tputchar('\\n');\n-\t\tpretty_print_string_list(main_cmds, colopts);\n+\t\tpretty_print_cmdnames(main_cmds, colopts);\n \t\tputchar('\\n');\n \t}\n \n \tif (other_cmds->cnt) {\n \t\tprintf_ln(_(\"git commands available from elsewhere on your $PATH\"));\n \t\tputchar('\\n');\n-\t\tpretty_print_string_list(other_cmds, colopts);\n+\t\tpretty_print_cmdnames(other_cmds, colopts);\n \t\tputchar('\\n');\n \t}\n }\n-- \n1.9.0.164.g473e143\n"},{"id":"235669","messageId":"xmqqfvn3szgt.fsf@gitster.dls.corp.google.com","threadId":"36001","inReplyTo":"1393615649-29248-1-git-send-email-ralf.thielow@gmail.com","subject":"Re: [PATCH] help.c: rename function \"pretty_print_string_list\"","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-02-28T21:24:02Z","receivedAt":"2014-02-28T21:24:02Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ralf Thielow <ralf.thielow@gmail.com> writes:\n\n> The part \"string_list\" of the name of function\n> \"pretty_print_string_list\" is just an implementation\n> detail. The function pretty-prints command names so\n> rename it to \"pretty_print_cmdnames\".\n>\n> Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>\n> ---\n> Just noticed this while digging through Git codebase.\n\nThanks.  This is a leftover from 7dbc2c04 (git wrapper: basic\nfixes., 2005-11-15); it used to be that this function was to pretty\nprint the contents of a string_list but it was updated to use its\nown structure type.\n\n>\n>  help.c | 7 +++----\n>  1 file changed, 3 insertions(+), 4 deletions(-)\n>\n> diff --git a/help.c b/help.c\n> index df7d16d..b266b09 100644\n> --- a/help.c\n> +++ b/help.c\n> @@ -78,8 +78,7 @@ void exclude_cmds(struct cmdnames *cmds, struct cmdnames *excludes)\n>  \tcmds->cnt = cj;\n>  }\n>  \n> -static void pretty_print_string_list(struct cmdnames *cmds,\n> -\t\t\t\t     unsigned int colopts)\n> +static void pretty_print_cmdnames(struct cmdnames *cmds, unsigned int colopts)\n>  {\n>  \tstruct string_list list = STRING_LIST_INIT_NODUP;\n>  \tstruct column_options copts;\n> @@ -209,14 +208,14 @@ void list_commands(unsigned int colopts,\n>  \t\tconst char *exec_path = git_exec_path();\n>  \t\tprintf_ln(_(\"available git commands in '%s'\"), exec_path);\n>  \t\tputchar('\\n');\n> -\t\tpretty_print_string_list(main_cmds, colopts);\n> +\t\tpretty_print_cmdnames(main_cmds, colopts);\n>  \t\tputchar('\\n');\n>  \t}\n>  \n>  \tif (other_cmds->cnt) {\n>  \t\tprintf_ln(_(\"git commands available from elsewhere on your $PATH\"));\n>  \t\tputchar('\\n');\n> -\t\tpretty_print_string_list(other_cmds, colopts);\n> +\t\tpretty_print_cmdnames(other_cmds, colopts);\n>  \t\tputchar('\\n');\n>  \t}\n>  }\n"}]}