{"thread":{"id":"53596","subject":"[PATCH] git.c: fix sparse warning","startedAt":"2020-06-01T23:27:50Z","lastAt":"2020-06-03T02:17:40Z","messageCount":2,"participants":["Ramsay Jones","Matheus Tavares Bernardino"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"399007","messageId":"d9686e75-0792-33f7-dd70-3dc8ca6c4d66@ramsayjones.plus.com","threadId":"53596","inReplyTo":null,"subject":"[PATCH] git.c: fix sparse warning","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsayjones.plus.com","sentAt":"2020-06-01T23:27:40Z","receivedAt":"2020-06-01T23:27:50Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\nCommit 4acc44d720 (config: add setting to ignore sparsity patterns in\nsome cmds, 2020-05-27) adds an external symbol definition without a\ncorresponding external symbol declaration. This causes sparse to\ncomplain: \"symbol 'opt_restrict_to_sparse_paths' was not declared.\nShould it be static?\".\n\nIn order to suppress the warning, #include the 'sparse-checkout.h'\nheader file, which contains the required extern declaration.\n\nSigned-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>\n---\n\nHi Matheus,\n\nIf you need to re-roll your 'mt/grep-sparse-checkout' branch, could you\nplease squash this into the relevant patch.\n\n[This is the minimum fix - but I might be tempted to move the definition\nof the variable to 'sparse-checkout.c' as well.]\n\nThanks!\n\nATB,\nRamsay Jones\n\n git.c | 1 +\n 1 file changed, 1 insertion(+)\n\ndiff --git a/git.c b/git.c\nindex 07de4363ef..6e62001f2f 100644\n--- a/git.c\n+++ b/git.c\n@@ -5,6 +5,7 @@\n #include \"run-command.h\"\n #include \"alias.h\"\n #include \"shallow.h\"\n+#include \"sparse-checkout.h\"\n \n #define RUN_SETUP\t\t(1<<0)\n #define RUN_SETUP_GENTLY\t(1<<1)\n-- \n2.26.2\n"},{"id":"399060","messageId":"CAHd-oW5gaaH9Tn9Xq99AgH41N30Lr6N3n+GC2j1XUiNKyvAbdA@mail.gmail.com","threadId":"53596","inReplyTo":"d9686e75-0792-33f7-dd70-3dc8ca6c4d66@ramsayjones.plus.com","subject":"Re: [PATCH] git.c: fix sparse warning","fromName":"Matheus Tavares Bernardino","fromEmail":"matheus.bernardino@usp.br","sentAt":"2020-06-03T02:17:24Z","receivedAt":"2020-06-03T02:17:40Z","isPatch":true,"sender":{"key":"matheus.tavb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12701583?v=4"},"body":"On Mon, Jun 1, 2020 at 8:27 PM Ramsay Jones <ramsay@ramsayjones.plus.com> wrote:\n>\n>\n> Commit 4acc44d720 (config: add setting to ignore sparsity patterns in\n> some cmds, 2020-05-27) adds an external symbol definition without a\n> corresponding external symbol declaration. This causes sparse to\n> complain: \"symbol 'opt_restrict_to_sparse_paths' was not declared.\n> Should it be static?\".\n>\n> In order to suppress the warning, #include the 'sparse-checkout.h'\n> header file, which contains the required extern declaration.\n>\n> Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>\n> ---\n>\n> Hi Matheus,\n>\n> If you need to re-roll your 'mt/grep-sparse-checkout' branch, could you\n> please squash this into the relevant patch.\n\nSure! Thanks for catching this.\n"}]}