git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Hudec <bulb@ucw.cz>
To: Brian Gernhardt <benji@silverinsanity.com>
Cc: Morten Welinder <mwelinder@gmail.com>,
	git@vger.kernel.org, spearce@spearce.org
Subject: Re: [PATCH] Use exit 1 instead of die when req_Root fails.
Date: Thu, 18 Oct 2007 20:54:14 +0200	[thread overview]
Message-ID: <20071018185414.GL26127@efreet.light.src> (raw)
In-Reply-To: <DC3D43FD-F03D-4E0A-9C2B-DE56F9C16D60@silverinsanity.com>

[-- Attachment #1: Type: text/plain, Size: 2093 bytes --]

On Wed, Oct 17, 2007 at 11:16:34 -0400, Brian Gernhardt wrote:
>
> On Oct 17, 2007, at 10:39 AM, Morten Welinder wrote:
>
>>>  made it into your repo.  It fixes test failures on my machine that have
>>>  been plauging me for months.
>>
>> That sounds more like a reason to fix the test.  "die" is the perl
>> standard way of reporting an error.  It will print the error message
>> on stderr, not on stdout like your version does.
>>
>> IMHO, of course.
>
> The problem is that die can exit with varying exit codes, and exit codes >= 
> 128 make the test suite assume something has gone wrong with the test.  In 
> particular, because $! (errcode) and $? (previous shell command return) are 
> both 0, it returns 255.  Or at least that's how it works out on my system.  
> I'm not sure why it doesn't do that on others.
>
> But the test is expecting a failure here and it appears to be failing in 
> the correct way, just with an error code test-lib.sh doesn't like.  I asked 
> on list the best way to fix it and Frank Lichtenheld said (and nobody 
> objected until now) that this was the best way to fix it.
>
> Also, the not printing on STRERR is identical to another section of code 
> just below mine:
>
>>     unless ($line eq 'anonymous') {
>>        print "E Only anonymous user allowed via pserver\n";
>>        print "I HATE YOU\n";
>>        exit 1;
>>     }
>
> However, amending my patch to print to STDERR is not difficult.

Hm. There are two kinds of errors in git-cvsserver and they should be handled
differently.

If the error is an invalid request (like the quoted one), there should be
normal print, to STDOUT, starting with "E", because it's an error message
that should be sent to the client.

On the other hand if the error is internal error in the script or it's
configuration, than the error should probably be reported via die, *without*
E at the begining (it will be prefixed with location anyway). Such message
will probably end up in the log rather than sent to the client.

-- 
						 Jan 'Bulb' Hudec <bulb@ucw.cz>

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

  parent reply	other threads:[~2007-10-18 18:54 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-17 14:05 [PATCH] Use exit 1 instead of die when req_Root fails Brian Gernhardt
2007-10-17 14:39 ` Morten Welinder
2007-10-17 15:16   ` Brian Gernhardt
2007-10-17 15:39     ` Lars Hjemli
2007-10-17 18:40       ` Brian Gernhardt
2007-10-17 19:27         ` Lars Hjemli
2007-10-18 18:54     ` Jan Hudec [this message]
2007-10-17 19:08   ` Frank Lichtenheld
2007-10-17 19:06 ` Frank Lichtenheld
2007-10-17 19:15   ` Brian Gernhardt
2007-10-18  5:04     ` Shawn O. Pearce
2007-10-18 13:33       ` Frank Lichtenheld
  -- strict thread matches above, loose matches on Subject: below --
2007-10-04  1:19 git-cvsserver test failures (still) Frank Lichtenheld
2007-10-04  1:43 ` [PATCH] Use exit 1 instead of die when req_Root fails Brian Gernhardt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071018185414.GL26127@efreet.light.src \
    --to=bulb@ucw.cz \
    --cc=benji@silverinsanity.com \
    --cc=git@vger.kernel.org \
    --cc=mwelinder@gmail.com \
    --cc=spearce@spearce.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).