bash-3.1$ pwd /home/marco/programmi/git bash-3.1$ git status; echo $? # On branch refs/heads/origin nothing to commit (use "git add file1 file2" to include for commit) 1 bash-3.1$ git --version git version 1.5.0.rc0.g244a7
threads / bug / 6309
Possible bug in 'git status' exit code is 1 instead of 0
Subject: Possible bug in 'git status' exit code is 1 instead of 0
Re: Possible bug in 'git status' exit code is 1 instead of 0
"Marco Costalba" <mcostalba@gmail.com> writes:
Show 8 quoted lines
> bash-3.1$ pwd > /home/marco/programmi/git > bash-3.1$ git status; echo $? > # On branch refs/heads/origin > nothing to commit (use "git add file1 file2" to include for commit) > 1 > bash-3.1$ git --version > git version 1.5.0.rc0.g244a7
I think that's normal and has been the way for git-commit to detect if there is anything to commit.
Re: Possible bug in 'git status' exit code is 1 instead of 0
On 1/9/07, Junio C Hamano <junkio@cox.net> wrote:
Show 15 quoted lines
> "Marco Costalba" <mcostalba@gmail.com> writes: > > > bash-3.1$ pwd > > /home/marco/programmi/git > > bash-3.1$ git status; echo $? > > # On branch refs/heads/origin > > nothing to commit (use "git add file1 file2" to include for commit) > > 1 > > bash-3.1$ git --version > > git version 1.5.0.rc0.g244a7 > > I think that's normal and has been the way for git-commit to > detect if there is anything to commit. > >
Ok, I was changing the error detection to check exit status, but it's definitely better to still check for something written to stdErr instead.
Thanks Marco
Re: Possible bug in 'git status' exit code is 1 instead of 0
"Marco Costalba" <mcostalba@gmail.com> writes:
> Ok, I was changing the error detection to check exit status, but it's > definitely better to still check for something written to stdErr > instead.
Non-zero status to indicate there is nothing to commit has always been the way for git-status to report since the very first edition of the command (a3e870f2, May 30 2005), so you should be able to depend on it.
Re: Possible bug in 'git status' exit code is 1 instead of 0
On 1/9/07, Junio C Hamano <junkio@cox.net> wrote:
Show 11 quoted lines
> "Marco Costalba" <mcostalba@gmail.com> writes: > > > Ok, I was changing the error detection to check exit status, but it's > > definitely better to still check for something written to stdErr > > instead. > > Non-zero status to indicate there is nothing to commit has > always been the way for git-status to report since the very > first edition of the command (a3e870f2, May 30 2005), so you > should be able to depend on it. >
Thanks, but what I was trying to find was a reliable way to know, from qgit side, when a launched external program failed. This should apply to git commands of course but also to others, as example StGit or bash ones (ls, cd, etc..).
So the rule should be general enough. Now the rule is to test for the presence of any message in stdError _or_ for a special Qt flag set, that is useful to know if the application crashed or terminated abruptly.
I think I will stick with that because this error detect framework should stay command agnostic.
Marco