{"thread":{"id":"47957","subject":"[PATCH 1/2] ref-filter: mark a file-local symbol as static","startedAt":"2018-03-02T02:54:09Z","lastAt":"2018-03-02T17:57:00Z","messageCount":5,"participants":["Ramsay Jones","Jonathan Nieder","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"340777","messageId":"1d28d866-535c-6d37-4cb9-5decedab3acb@ramsayjones.plus.com","threadId":"47957","inReplyTo":null,"subject":"[PATCH 1/2] ref-filter: mark a file-local symbol as static","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsayjones.plus.com","sentAt":"2018-03-02T02:54:02Z","receivedAt":"2018-03-02T02:54:09Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\nCommit fcfba37337 ('ref-filter: make \"--contains <id>\" less chatty if\n<id> is invalid', 2018-02-23) added the add_str_to_commit_list()\nfunction, which causes sparse to issue a \"... not declared. Should it\nbe static?\" warning for that symbol.\n\nIn order to suppress the warning, mark that function as static.\n\nSigned-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>\n---\n ref-filter.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/ref-filter.c b/ref-filter.c\nindex f375e7670..69bf7b587 100644\n--- a/ref-filter.c\n+++ b/ref-filter.c\n@@ -2000,7 +2000,7 @@ static void do_merge_filter(struct ref_filter_cbdata *ref_cbdata)\n \tfree(to_clear);\n }\n \n-int add_str_to_commit_list(struct string_list_item *item, void *commit_list)\n+static int add_str_to_commit_list(struct string_list_item *item, void *commit_list)\n {\n \tstruct object_id oid;\n \tstruct commit *commit;\n-- \n2.16.0\n"},{"id":"340780","messageId":"20180302035904.GA238112@aiede.svl.corp.google.com","threadId":"47957","inReplyTo":"1d28d866-535c-6d37-4cb9-5decedab3acb@ramsayjones.plus.com","subject":"Re: [PATCH 1/2] ref-filter: mark a file-local symbol as static","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2018-03-02T03:59:04Z","receivedAt":"2018-03-02T03:59:20Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Hi,\n\nRamsay Jones wrote:\n\n> Commit fcfba37337 ('ref-filter: make \"--contains <id>\" less chatty if\n> <id> is invalid', 2018-02-23) added the add_str_to_commit_list()\n> function, which causes sparse to issue a \"... not declared. Should it\n> be static?\" warning for that symbol.\n\nThanks for catching it!\n\n> In order to suppress the warning, mark that function as static.\n\nIsn't this closer to\n\n\tIndeed, the function is only used in this one compilation\n\tunit. Mark it static.\n\n?  In other words, sparse's warning is accurate, and this is not about\ntrying to quiet a false positive but about addressing a true positive.\n\n> Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>\n> ---\n>  ref-filter.c | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n\nThanks,\nJonathan\n"},{"id":"340818","messageId":"733494ed-56b1-9072-3c9d-cedc35acd215@ramsayjones.plus.com","threadId":"47957","inReplyTo":"20180302035904.GA238112@aiede.svl.corp.google.com","subject":"Re: [PATCH 1/2] ref-filter: mark a file-local symbol as static","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsayjones.plus.com","sentAt":"2018-03-02T17:06:27Z","receivedAt":"2018-03-02T17:06:35Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\n\nOn 02/03/18 03:59, Jonathan Nieder wrote:\n> Hi,\n> \n> Ramsay Jones wrote:\n> \n>> Commit fcfba37337 ('ref-filter: make \"--contains <id>\" less chatty if\n>> <id> is invalid', 2018-02-23) added the add_str_to_commit_list()\n>> function, which causes sparse to issue a \"... not declared. Should it\n>> be static?\" warning for that symbol.\n> \n> Thanks for catching it!\n> \n>> In order to suppress the warning, mark that function as static.\n> \n> Isn't this closer to\n> \n> \tIndeed, the function is only used in this one compilation\n> \tunit. Mark it static.\n> \n> ?  In other words, sparse's warning is accurate, and this is not about\n> trying to quiet a false positive but about addressing a true positive.\n\nI thought that was implied by the commit subject line. :-D\n\nHowever, it certainly doesn't hurt to be more explicit.\n\nJunio, do you want me to re-roll, or would you mind tweaking the\ncommit message while queueing?\n\nThanks!\n\nATB,\nRamsay Jones\n\n\n"},{"id":"340822","messageId":"xmqqinaecs3q.fsf@gitster-ct.c.googlers.com","threadId":"47957","inReplyTo":"733494ed-56b1-9072-3c9d-cedc35acd215@ramsayjones.plus.com","subject":"Re: [PATCH 1/2] ref-filter: mark a file-local symbol as static","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-03-02T17:19:53Z","receivedAt":"2018-03-02T17:20:01Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ramsay Jones <ramsay@ramsayjones.plus.com> writes:\n\n> Junio, do you want me to re-roll, or would you mind tweaking the\n> commit message while queueing?\n\nPerfect timing ;-)  I was about to get to these two patches.  Here\nis what is queued.\n\ncommit 2d7cb07e3718d0af6547e2abb35f9cff9b10c1f5\nAuthor: Ramsay Jones <ramsay@ramsayjones.plus.com>\nDate:   Fri Mar 2 02:54:02 2018 +0000\n\n    ref-filter: mark a file-local symbol as static\n    \n    Commit fcfba37337 ('ref-filter: make \"--contains <id>\" less chatty if\n    <id> is invalid', 2018-02-23) added the add_str_to_commit_list()\n    function, which causes sparse to issue a \"... not declared. Should it\n    be static?\" warning for that symbol.\n    \n    Indeed, the function is only used in this one compilation unit. Mark\n    it static.\n    \n    Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>\n    Signed-off-by: Junio C Hamano <gitster@pobox.com>\n\ndiff --git a/ref-filter.c b/ref-filter.c\nindex aa282a27f4..ed993d32d8 100644\n--- a/ref-filter.c\n+++ b/ref-filter.c\n@@ -2000,7 +2000,7 @@ static void do_merge_filter(struct ref_filter_cbdata *ref_cbdata)\n \tfree(to_clear);\n }\n \n-int add_str_to_commit_list(struct string_list_item *item, void *commit_list)\n+static int add_str_to_commit_list(struct string_list_item *item, void *commit_list)\n {\n \tstruct object_id oid;\n \tstruct commit *commit;\n\n"},{"id":"340829","messageId":"07197560-a6b6-91a0-3750-b17ed7dc5f69@ramsayjones.plus.com","threadId":"47957","inReplyTo":"xmqqinaecs3q.fsf@gitster-ct.c.googlers.com","subject":"Re: [PATCH 1/2] ref-filter: mark a file-local symbol as static","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsayjones.plus.com","sentAt":"2018-03-02T17:56:52Z","receivedAt":"2018-03-02T17:57:00Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\n\nOn 02/03/18 17:19, Junio C Hamano wrote:\n> Ramsay Jones <ramsay@ramsayjones.plus.com> writes:\n> \n>> Junio, do you want me to re-roll, or would you mind tweaking the\n>> commit message while queueing?\n> \n> Perfect timing ;-)  I was about to get to these two patches.  Here\n> is what is queued.\n\nThanks!\n\nATB,\nRamsay Jones\n\n> commit 2d7cb07e3718d0af6547e2abb35f9cff9b10c1f5\n> Author: Ramsay Jones <ramsay@ramsayjones.plus.com>\n> Date:   Fri Mar 2 02:54:02 2018 +0000\n> \n>     ref-filter: mark a file-local symbol as static\n>     \n>     Commit fcfba37337 ('ref-filter: make \"--contains <id>\" less chatty if\n>     <id> is invalid', 2018-02-23) added the add_str_to_commit_list()\n>     function, which causes sparse to issue a \"... not declared. Should it\n>     be static?\" warning for that symbol.\n>     \n>     Indeed, the function is only used in this one compilation unit. Mark\n>     it static.\n>     \n>     Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>\n>     Signed-off-by: Junio C Hamano <gitster@pobox.com>\n> \n> diff --git a/ref-filter.c b/ref-filter.c\n> index aa282a27f4..ed993d32d8 100644\n> --- a/ref-filter.c\n> +++ b/ref-filter.c\n> @@ -2000,7 +2000,7 @@ static void do_merge_filter(struct ref_filter_cbdata *ref_cbdata)\n>  \tfree(to_clear);\n>  }\n>  \n> -int add_str_to_commit_list(struct string_list_item *item, void *commit_list)\n> +static int add_str_to_commit_list(struct string_list_item *item, void *commit_list)\n>  {\n>  \tstruct object_id oid;\n>  \tstruct commit *commit;\n> \n> \n"}]}