{"thread":{"id":"6309","subject":"Possible bug in 'git status' exit code is 1 instead of 0","startedAt":"2007-01-09T17:45:05Z","lastAt":"2007-01-09T20:47:53Z","messageCount":5,"participants":["Marco Costalba","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"31262","messageId":"e5bfff550701090945u5a240fe9xf46cc40b030e1ba7@mail.gmail.com","threadId":"6309","inReplyTo":null,"subject":"Possible bug in 'git status' exit code is 1 instead of 0","fromName":"Marco Costalba","fromEmail":"mcostalba@gmail.com","sentAt":"2007-01-09T17:45:05Z","receivedAt":"2007-01-09T17:45:05Z","isPatch":false,"sender":{"key":"mcostalba@gmail.com","avatar":null},"body":"bash-3.1$ pwd\n/home/marco/programmi/git\nbash-3.1$ git status; echo $?\n# On branch refs/heads/origin\nnothing to commit (use \"git add file1 file2\" to include for commit)\n1\nbash-3.1$ git --version\ngit version 1.5.0.rc0.g244a7\n"},{"id":"31263","messageId":"7vhcv0m5md.fsf@assigned-by-dhcp.cox.net","threadId":"6309","inReplyTo":"e5bfff550701090945u5a240fe9xf46cc40b030e1ba7@mail.gmail.com","subject":"Re: Possible bug in 'git status' exit code is 1 instead of 0","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-01-09T18:12:26Z","receivedAt":"2007-01-09T18:12:26Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Marco Costalba\" <mcostalba@gmail.com> writes:\n\n> bash-3.1$ pwd\n> /home/marco/programmi/git\n> bash-3.1$ git status; echo $?\n> # On branch refs/heads/origin\n> nothing to commit (use \"git add file1 file2\" to include for commit)\n> 1\n> bash-3.1$ git --version\n> git version 1.5.0.rc0.g244a7\n\nI think that's normal and has been the way for git-commit to\ndetect if there is anything to commit.\n"},{"id":"31265","messageId":"e5bfff550701091033x51496b38x6c6f798e8a7ae795@mail.gmail.com","threadId":"6309","inReplyTo":"7vhcv0m5md.fsf@assigned-by-dhcp.cox.net","subject":"Re: Possible bug in 'git status' exit code is 1 instead of 0","fromName":"Marco Costalba","fromEmail":"mcostalba@gmail.com","sentAt":"2007-01-09T18:33:39Z","receivedAt":"2007-01-09T18:33:39Z","isPatch":false,"sender":{"key":"mcostalba@gmail.com","avatar":null},"body":"On 1/9/07, Junio C Hamano <junkio@cox.net> wrote:\n> \"Marco Costalba\" <mcostalba@gmail.com> writes:\n>\n> > bash-3.1$ pwd\n> > /home/marco/programmi/git\n> > bash-3.1$ git status; echo $?\n> > # On branch refs/heads/origin\n> > nothing to commit (use \"git add file1 file2\" to include for commit)\n> > 1\n> > bash-3.1$ git --version\n> > git version 1.5.0.rc0.g244a7\n>\n> I think that's normal and has been the way for git-commit to\n> detect if there is anything to commit.\n>\n>\n\nOk, I was changing the error detection to check exit status, but it's\ndefinitely better to still check for something written to stdErr\ninstead.\n\nThanks\nMarco\n"},{"id":"31267","messageId":"7vslekkpav.fsf@assigned-by-dhcp.cox.net","threadId":"6309","inReplyTo":"e5bfff550701091033x51496b38x6c6f798e8a7ae795@mail.gmail.com","subject":"Re: Possible bug in 'git status' exit code is 1 instead of 0","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-01-09T18:50:16Z","receivedAt":"2007-01-09T18:50:16Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Marco Costalba\" <mcostalba@gmail.com> writes:\n\n> Ok, I was changing the error detection to check exit status, but it's\n> definitely better to still check for something written to stdErr\n> instead.\n\nNon-zero status to indicate there is nothing to commit has\nalways been the way for git-status to report since the very\nfirst edition of the command (a3e870f2, May 30 2005), so you\nshould be able to depend on it.\n"},{"id":"31279","messageId":"e5bfff550701091247n67b8d080oe804320453114d04@mail.gmail.com","threadId":"6309","inReplyTo":"7vslekkpav.fsf@assigned-by-dhcp.cox.net","subject":"Re: Possible bug in 'git status' exit code is 1 instead of 0","fromName":"Marco Costalba","fromEmail":"mcostalba@gmail.com","sentAt":"2007-01-09T20:47:53Z","receivedAt":"2007-01-09T20:47:53Z","isPatch":false,"sender":{"key":"mcostalba@gmail.com","avatar":null},"body":"On 1/9/07, Junio C Hamano <junkio@cox.net> wrote:\n> \"Marco Costalba\" <mcostalba@gmail.com> writes:\n>\n> > Ok, I was changing the error detection to check exit status, but it's\n> > definitely better to still check for something written to stdErr\n> > instead.\n>\n> Non-zero status to indicate there is nothing to commit has\n> always been the way for git-status to report since the very\n> first edition of the command (a3e870f2, May 30 2005), so you\n> should be able to depend on it.\n>\n\nThanks, but what I was trying to find was a reliable way to know, from\nqgit side, when a launched external program failed. This should apply\nto git commands of course but also to others, as example StGit or bash\nones (ls, cd, etc..).\n\nSo the rule should be general enough. Now the rule is to test for the\npresence of any message in stdError _or_  for a special Qt flag set,\nthat is useful to know if the application crashed or terminated\nabruptly.\n\nI think I will stick with that because this error detect framework\nshould stay command agnostic.\n\n Marco\n"}]}