{"thread":{"id":"50580","subject":"[PATCH 0/1] jt/fetch-cdn-offload: fix build with clang","startedAt":"2019-02-24T22:12:14Z","lastAt":"2019-03-11T12:54:47Z","messageCount":5,"participants":["Johannes Schindelin via GitGitGadget","Junio C Hamano","Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":1},"messages":[{"id":"370100","messageId":"pull.139.git.gitgitgadget@gmail.com","threadId":"50580","inReplyTo":null,"subject":"[PATCH 0/1] jt/fetch-cdn-offload: fix build with clang","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-02-24T22:12:10Z","receivedAt":"2019-02-24T22:12:14Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"I think this is actually legitimate a build error (see e.g. \nhttps://dev.azure.com/gitgitgadget/git/_build/results?buildId=2394), and I\nam quite surprised that GCC accepts this.\n\nNote: after thinking about this for a while, I guess an empty string would\nwork, too (i.e. \"\" instead of \" 0\"), but I already waited for the macOS\nbuild to finish at https://github.com/gitgitgadget/git/pull/139, and it's a\nfixup! for Jonathan to pick up, anyway...\n\nJunio, could I ask you to apply this on top of your SQUASH??? to fix the\nbuild?\n\nJohannes Schindelin (1):\n  fixup! upload-pack: refactor reading of pack-objects out\n\n upload-pack.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\n\nbase-commit: 2c31d711669adc7a7bfad06df37b976af99dfaa6\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-139%2Fdscho%2Fjt%2Ffetch-cdn-offload-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-139/dscho/jt/fetch-cdn-offload-v1\nPull-Request: https://github.com/gitgitgadget/git/pull/139\n-- \ngitgitgadget\n"},{"id":"370101","messageId":"5fa4fcad63e18dd9d840217eb8cf3dab8f69bc1b.1551046329.git.gitgitgadget@gmail.com","threadId":"50580","inReplyTo":"pull.139.git.gitgitgadget@gmail.com","subject":"[PATCH 1/1] fixup! upload-pack: refactor reading of pack-objects out","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-02-24T22:12:11Z","receivedAt":"2019-02-24T22:12:14Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nThis fixes an issue pointed out by clang.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n upload-pack.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/upload-pack.c b/upload-pack.c\nindex 2365b707bc..534e8951a2 100644\n--- a/upload-pack.c\n+++ b/upload-pack.c\n@@ -179,7 +179,7 @@ static void create_pack_file(const struct object_array *have_obj,\n \t\t\t     const struct string_list *uri_protocols)\n {\n \tstruct child_process pack_objects = CHILD_PROCESS_INIT;\n-\tstruct output_state output_state = {0};\n+\tstruct output_state output_state = {\"\\0\"};\n \tchar progress[128];\n \tchar abort_msg[] = \"aborting due to possible repository \"\n \t\t\"corruption on the remote side.\";\n-- \ngitgitgadget\n"},{"id":"370487","messageId":"xmqq1s3o69cl.fsf@gitster-ct.c.googlers.com","threadId":"50580","inReplyTo":"5fa4fcad63e18dd9d840217eb8cf3dab8f69bc1b.1551046329.git.gitgitgadget@gmail.com","subject":"Re: [PATCH 1/1] fixup! upload-pack: refactor reading of pack-objects out","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2019-03-03T01:21:46Z","receivedAt":"2019-03-03T01:21:51Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Johannes Schindelin via GitGitGadget\" <gitgitgadget@gmail.com>\nwrites:\n\n> From: Johannes Schindelin <johannes.schindelin@gmx.de>\n>\n> This fixes an issue pointed out by clang.\n>\n> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> ---\n>  upload-pack.c | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/upload-pack.c b/upload-pack.c\n> index 2365b707bc..534e8951a2 100644\n> --- a/upload-pack.c\n> +++ b/upload-pack.c\n> @@ -179,7 +179,7 @@ static void create_pack_file(const struct object_array *have_obj,\n>  \t\t\t     const struct string_list *uri_protocols)\n>  {\n>  \tstruct child_process pack_objects = CHILD_PROCESS_INIT;\n> -\tstruct output_state output_state = {0};\n> +\tstruct output_state output_state = {\"\\0\"};\n\nOK, as the structure looks like\n\n\tstruct output_state {\n\t\tchar buffer[8193];\n\t\tint used;\n\t\t...\n\nwe obviously cannot initialize buffer[] with a single integer 0 ;-)\nBetween \"\" and \"\\0\" you wondered elsewhere, I have no strong\npreference, but if I were fixing it, I would probably write it as\n\n\tstruct output_state output_state = { { 0 } };\n\nso that readers do not even have to waste time to wonder between the\ntwo.\n\nThanks.\n\n"},{"id":"370529","messageId":"nycvar.QRO.7.76.6.1903031601130.45@tvgsbejvaqbjf.bet","threadId":"50580","inReplyTo":"xmqq1s3o69cl.fsf@gitster-ct.c.googlers.com","subject":"Re: [PATCH 1/1] fixup! upload-pack: refactor reading of pack-objects out","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2019-03-03T15:01:44Z","receivedAt":"2019-03-03T15:01:54Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sun, 3 Mar 2019, Junio C Hamano wrote:\n\n> \"Johannes Schindelin via GitGitGadget\" <gitgitgadget@gmail.com>\n> writes:\n> \n> > From: Johannes Schindelin <johannes.schindelin@gmx.de>\n> >\n> > This fixes an issue pointed out by clang.\n> >\n> > Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> > ---\n> >  upload-pack.c | 2 +-\n> >  1 file changed, 1 insertion(+), 1 deletion(-)\n> >\n> > diff --git a/upload-pack.c b/upload-pack.c\n> > index 2365b707bc..534e8951a2 100644\n> > --- a/upload-pack.c\n> > +++ b/upload-pack.c\n> > @@ -179,7 +179,7 @@ static void create_pack_file(const struct object_array *have_obj,\n> >  \t\t\t     const struct string_list *uri_protocols)\n> >  {\n> >  \tstruct child_process pack_objects = CHILD_PROCESS_INIT;\n> > -\tstruct output_state output_state = {0};\n> > +\tstruct output_state output_state = {\"\\0\"};\n> \n> OK, as the structure looks like\n> \n> \tstruct output_state {\n> \t\tchar buffer[8193];\n> \t\tint used;\n> \t\t...\n> \n> we obviously cannot initialize buffer[] with a single integer 0 ;-)\n> Between \"\" and \"\\0\" you wondered elsewhere, I have no strong\n> preference, but if I were fixing it, I would probably write it as\n> \n> \tstruct output_state output_state = { { 0 } };\n> \n> so that readers do not even have to waste time to wonder between the\n> two.\n\nRight. I don't care, as long as Jonathan addresses the compile error on\nclang.\n\nCiao,\nDscho\n"},{"id":"371145","messageId":"nycvar.QRO.7.76.6.1903111353150.41@tvgsbejvaqbjf.bet","threadId":"50580","inReplyTo":"nycvar.QRO.7.76.6.1903031601130.45@tvgsbejvaqbjf.bet","subject":"Re: [PATCH 1/1] fixup! upload-pack: refactor reading of pack-objects out","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2019-03-11T12:54:23Z","receivedAt":"2019-03-11T12:54:47Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Jonathan,\n\nOn Sun, 3 Mar 2019, Johannes Schindelin wrote:\n\n> On Sun, 3 Mar 2019, Junio C Hamano wrote:\n> \n> > \"Johannes Schindelin via GitGitGadget\" <gitgitgadget@gmail.com>\n> > writes:\n> > \n> > > From: Johannes Schindelin <johannes.schindelin@gmx.de>\n> > >\n> > > This fixes an issue pointed out by clang.\n> > >\n> > > Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> > > ---\n> > >  upload-pack.c | 2 +-\n> > >  1 file changed, 1 insertion(+), 1 deletion(-)\n> > >\n> > > diff --git a/upload-pack.c b/upload-pack.c\n> > > index 2365b707bc..534e8951a2 100644\n> > > --- a/upload-pack.c\n> > > +++ b/upload-pack.c\n> > > @@ -179,7 +179,7 @@ static void create_pack_file(const struct object_array *have_obj,\n> > >  \t\t\t     const struct string_list *uri_protocols)\n> > >  {\n> > >  \tstruct child_process pack_objects = CHILD_PROCESS_INIT;\n> > > -\tstruct output_state output_state = {0};\n> > > +\tstruct output_state output_state = {\"\\0\"};\n> > \n> > OK, as the structure looks like\n> > \n> > \tstruct output_state {\n> > \t\tchar buffer[8193];\n> > \t\tint used;\n> > \t\t...\n> > \n> > we obviously cannot initialize buffer[] with a single integer 0 ;-)\n> > Between \"\" and \"\\0\" you wondered elsewhere, I have no strong\n> > preference, but if I were fixing it, I would probably write it as\n> > \n> > \tstruct output_state output_state = { { 0 } };\n> > \n> > so that readers do not even have to waste time to wonder between the\n> > two.\n> \n> Right. I don't care, as long as Jonathan addresses the compile error on\n> clang.\n\nThis is *still* broken:\nhttps://dev.azure.com/gitgitgadget/git/_build/results?buildId=4337\n\nJunio, can you please in the least add my fixup! on top of\njt/fetch-cdn-offload?\n\nThanks,\nDscho\n"}]}