git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Possible bug in 'git status' exit code is 1 instead of 0
@ 2007-01-09 17:45 Marco Costalba
  2007-01-09 18:12 ` Junio C Hamano
  0 siblings, 1 reply; 5+ messages in thread
From: Marco Costalba @ 2007-01-09 17:45 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: GIT list

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Possible bug in 'git status' exit code is 1 instead of 0
  2007-01-09 17:45 Possible bug in 'git status' exit code is 1 instead of 0 Marco Costalba
@ 2007-01-09 18:12 ` Junio C Hamano
  2007-01-09 18:33   ` Marco Costalba
  0 siblings, 1 reply; 5+ messages in thread
From: Junio C Hamano @ 2007-01-09 18:12 UTC (permalink / raw)
  To: Marco Costalba; +Cc: Junio C Hamano, GIT list

"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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Possible bug in 'git status' exit code is 1 instead of 0
  2007-01-09 18:12 ` Junio C Hamano
@ 2007-01-09 18:33   ` Marco Costalba
  2007-01-09 18:50     ` Junio C Hamano
  0 siblings, 1 reply; 5+ messages in thread
From: Marco Costalba @ 2007-01-09 18:33 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: GIT list

On 1/9/07, Junio C Hamano <junkio@cox.net> wrote:
> "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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Possible bug in 'git status' exit code is 1 instead of 0
  2007-01-09 18:33   ` Marco Costalba
@ 2007-01-09 18:50     ` Junio C Hamano
  2007-01-09 20:47       ` Marco Costalba
  0 siblings, 1 reply; 5+ messages in thread
From: Junio C Hamano @ 2007-01-09 18:50 UTC (permalink / raw)
  To: Marco Costalba; +Cc: git

"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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Possible bug in 'git status' exit code is 1 instead of 0
  2007-01-09 18:50     ` Junio C Hamano
@ 2007-01-09 20:47       ` Marco Costalba
  0 siblings, 0 replies; 5+ messages in thread
From: Marco Costalba @ 2007-01-09 20:47 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

On 1/9/07, Junio C Hamano <junkio@cox.net> wrote:
> "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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-01-09 20:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-09 17:45 Possible bug in 'git status' exit code is 1 instead of 0 Marco Costalba
2007-01-09 18:12 ` Junio C Hamano
2007-01-09 18:33   ` Marco Costalba
2007-01-09 18:50     ` Junio C Hamano
2007-01-09 20:47       ` Marco Costalba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).