{"thread":{"id":"60430","subject":"git diagnose with invalid CLI argument does not report error","startedAt":"2023-10-25T20:50:04Z","lastAt":"2023-10-26T22:43:34Z","messageCount":5,"participants":["Sheik","Bagas Sanjaya","Eric Sunshine","Emily Shaffer"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"483871","messageId":"849b6ee2-99f3-4aaa-835f-44d3e13befc3@gmail.com","threadId":"60430","inReplyTo":null,"subject":"git diagnose with invalid CLI argument does not report error","fromName":"Sheik","fromEmail":"sahibzone@gmail.com","sentAt":"2023-10-25T20:49:58Z","receivedAt":"2023-10-25T20:50:04Z","isPatch":false,"sender":{"key":"sahibzone@gmail.com","avatar":null},"body":"Hi Maintainers,\n\n\nRunning git diagnose with an invalid CLI argument in a valid Git \ndirectory does not report error. Expected behaviour would be that it \nreports an error.\n\n#Example shell commands which should have reported an error but \ncontinues to succeed\n\ncd $ToAGitDirectory\n\ngit diagnose mod\n\ngit diagnose mode\n\ngit diagnose mode=all\n\n\nThanks\n\nSheik\n\n\n[System Info]\ngit version:\ngit version 2.42.0\ncpu: x86_64\nno commit associated with this build\nsizeof-long: 8\nsizeof-size_t: 8\nshell-path: /bin/sh\nuname: Linux 6.5.0-2-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.5.6-1 \n(2023-10-07) x86_64\ncompiler info: gnuc: 13.2\nlibc info: glibc: 2.37\n$SHELL (typically, interactive shell): /bin/bash\n\n\n[Enabled Hooks]\n\n"},{"id":"483914","messageId":"ZTpJFUdE2U6pbV--@debian.me","threadId":"60430","inReplyTo":"849b6ee2-99f3-4aaa-835f-44d3e13befc3@gmail.com","subject":"Re: git diagnose with invalid CLI argument does not report error","fromName":"Bagas Sanjaya","fromEmail":"bagasdotme@gmail.com","sentAt":"2023-10-26T11:10:13Z","receivedAt":"2023-10-26T11:10:19Z","isPatch":false,"sender":{"key":"bagasdotme@gmail.com","avatar":"https://avatars.githubusercontent.com/u/40219486?v=4"},"body":"On Thu, Oct 26, 2023 at 07:49:58AM +1100, Sheik wrote:\n> Hi Maintainers,\n> \n> \n> Running git diagnose with an invalid CLI argument in a valid Git directory\n> does not report error. Expected behaviour would be that it reports an error.\n> \n> #Example shell commands which should have reported an error but continues to\n> succeed\n> \n> cd $ToAGitDirectory\n> \n> git diagnose mod\n> \n> git diagnose mode\n> \n> git diagnose mode=all\n> \n\nI can reproduce this only when the invalid parameter is a normal word:\n\n```\n$ git diagnose huh\n```\n\nBut the command errors out on invalid flag:\n\n```\n$ git diagnose -m\n```\n\nCc:'ing people who recently worked on builtin/diagnose.c for help.\n\nThanks.\n\n-- \nAn old man doll... just what I always wanted! - Clara\n"},{"id":"483935","messageId":"CAPig+cSsB-2xxF7uQRU2h219+0-9++M_woLX3vNwiq1Uj1SiQQ@mail.gmail.com","threadId":"60430","inReplyTo":"ZTpJFUdE2U6pbV--@debian.me","subject":"Re: git diagnose with invalid CLI argument does not report error","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2023-10-26T22:11:42Z","receivedAt":"2023-10-26T22:11:57Z","isPatch":false,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Thu, Oct 26, 2023 at 7:10 AM Bagas Sanjaya <bagasdotme@gmail.com> wrote:\n> On Thu, Oct 26, 2023 at 07:49:58AM +1100, Sheik wrote:\n> > Hi Maintainers,\n> >\n> > Running git diagnose with an invalid CLI argument in a valid Git directory\n> > does not report error. Expected behaviour would be that it reports an error.\n> >\n> > #Example shell commands which should have reported an error but continues to\n> > succeed\n> >\n> > cd $ToAGitDirectory\n> > git diagnose mod\n> > git diagnose mode\n> > git diagnose mode=all\n>\n> I can reproduce this only when the invalid parameter is a normal word:\n> ```\n> $ git diagnose huh\n> ```\n> But the command errors out on invalid flag:\n> ```\n> $ git diagnose -m\n> ```\n> Cc:'ing people who recently worked on builtin/diagnose.c for help.\n\nA patch by Emily to fix this has been submitted[v4].\n\n[v4]: https://lore.kernel.org/git/20231026182231.3369370-3-nasamuffin@google.com/\n"},{"id":"483936","messageId":"CAJoAoZ=a30QsMXHz+47haZ=QGkY8-QYccSuY_94mi9h9RMiBFA@mail.gmail.com","threadId":"60430","inReplyTo":"CAPig+cSsB-2xxF7uQRU2h219+0-9++M_woLX3vNwiq1Uj1SiQQ@mail.gmail.com","subject":"Re: git diagnose with invalid CLI argument does not report error","fromName":"Emily Shaffer","fromEmail":"nasamuffin@google.com","sentAt":"2023-10-26T22:41:13Z","receivedAt":"2023-10-26T22:41:31Z","isPatch":false,"sender":{"key":"nasamuffin@google.com","avatar":"https://avatars.githubusercontent.com/u/1606826?v=4"},"body":"To be clear, that patch was for git-bugreport and doesn't cover\ngit-diagnose. I assume the fix ends up being pretty similar though.\n\nOn Thu, Oct 26, 2023 at 3:12 PM Eric Sunshine <sunshine@sunshineco.com> wrote:\n>\n> On Thu, Oct 26, 2023 at 7:10 AM Bagas Sanjaya <bagasdotme@gmail.com> wrote:\n> > On Thu, Oct 26, 2023 at 07:49:58AM +1100, Sheik wrote:\n> > > Hi Maintainers,\n> > >\n> > > Running git diagnose with an invalid CLI argument in a valid Git directory\n> > > does not report error. Expected behaviour would be that it reports an error.\n> > >\n> > > #Example shell commands which should have reported an error but continues to\n> > > succeed\n> > >\n> > > cd $ToAGitDirectory\n> > > git diagnose mod\n> > > git diagnose mode\n> > > git diagnose mode=all\n> >\n> > I can reproduce this only when the invalid parameter is a normal word:\n> > ```\n> > $ git diagnose huh\n> > ```\n> > But the command errors out on invalid flag:\n> > ```\n> > $ git diagnose -m\n> > ```\n> > Cc:'ing people who recently worked on builtin/diagnose.c for help.\n>\n> A patch by Emily to fix this has been submitted[v4].\n>\n> [v4]: https://lore.kernel.org/git/20231026182231.3369370-3-nasamuffin@google.com/\n>\n"},{"id":"483937","messageId":"CAPig+cRU5bU-QkX3au_+DvM8KiKHLNeB1u+PB2LXgz6gu-4qzw@mail.gmail.com","threadId":"60430","inReplyTo":"CAJoAoZ=a30QsMXHz+47haZ=QGkY8-QYccSuY_94mi9h9RMiBFA@mail.gmail.com","subject":"Re: git diagnose with invalid CLI argument does not report error","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2023-10-26T22:43:20Z","receivedAt":"2023-10-26T22:43:34Z","isPatch":false,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Thu, Oct 26, 2023 at 6:41 PM Emily Shaffer <nasamuffin@google.com> wrote:\n> On Thu, Oct 26, 2023 at 3:12 PM Eric Sunshine <sunshine@sunshineco.com> wrote:\n> > On Thu, Oct 26, 2023 at 7:10 AM Bagas Sanjaya <bagasdotme@gmail.com> wrote:\n> > > On Thu, Oct 26, 2023 at 07:49:58AM +1100, Sheik wrote:\n> > > > Running git diagnose with an invalid CLI argument in a valid Git directory\n> > > > does not report error. Expected behaviour would be that it reports an error.\n> > >\n> > > I can reproduce this only when the invalid parameter is a normal word:\n> > > Cc:'ing people who recently worked on builtin/diagnose.c for help.\n> >\n> > A patch by Emily to fix this has been submitted[v4].\n>\n> To be clear, that patch was for git-bugreport and doesn't cover\n> git-diagnose. I assume the fix ends up being pretty similar though.\n\nMy bad.\n"}]}