From: Martin Koegler Date: Mon, 25 Feb 2008 08:21:45 GMT Subject: Re: [PATCH 1/4] add generic, type aware object chain walker Message-ID: <20080225082145.GB20048@auto.tuwien.ac.at> In-Reply-To: <7vskzhmppo.fsf@gitster.siamese.dyndns.org> On Sun, Feb 24, 2008 at 11:59:15PM -0800, Junio C Hamano wrote: > mkoegler@auto.tuwien.ac.at (Martin Koegler) writes: > > How should I define the return value of fsck_walk in the presence of > > multiple errors? > > Returning error is fine. That is not what I was talking about. > > I was talking about an early return in the code, that does not > callback once you find an error. That is not what I was talking about. We need to define the return code of fsck_walk in the case of multiple errors. What error (of all possible) should it return? What about this new behaviour: Callback return values: * 0 everything OK * > 0 error, but continue * < 0 error, but stop The return value of fsck_walk would be: * -1, if fsck_walk discoveres an error (eg. not parseable object) * first callback return value < 0 (and stops further processing in this case) * first callback return value > 0 (if not callback return value < 0) * 0, if no errors are discovered mfg Martin Kögler