Re: [PATCH 1/2] fsck_commit_buffer(): do not special case the last validation

2016-04-15 Thread Junio C Hamano
Johannes Schindelin writes: >> But that is a selfish code that declares it is the ultimate and >> final form of the function, never to be enhanced later. To allow >> and invite future enhancements, make the last test follow the same >> pattern. > > FWIW I agree with this reasoning. Sorry for lea

Re: [PATCH 1/2] fsck_commit_buffer(): do not special case the last validation

2016-04-15 Thread Johannes Schindelin
Hi Junio, On Thu, 14 Apr 2016, Junio C Hamano wrote: > The pattern taken by all the validations in this function is: > > if (notice a violation exists) { > err = report(... VIOLATION_KIND ...); > if (err) > return err; > } > > where

Re: [PATCH 1/2] fsck_commit_buffer(): do not special case the last validation

2016-04-14 Thread Junio C Hamano
Jeff King writes: > On Thu, Apr 14, 2016 at 11:07:08AM -0700, Junio C Hamano wrote: > >> The pattern taken by all the validations in this function is: >> >> if (notice a violation exists) { >> err = report(... VIOLATION_KIND ...); >> if (err) >>

Re: [PATCH 1/2] fsck_commit_buffer(): do not special case the last validation

2016-04-14 Thread Jeff King
On Thu, Apr 14, 2016 at 11:07:08AM -0700, Junio C Hamano wrote: > The pattern taken by all the validations in this function is: > > if (notice a violation exists) { > err = report(... VIOLATION_KIND ...); > if (err) > return err; > } >

[PATCH 1/2] fsck_commit_buffer(): do not special case the last validation

2016-04-14 Thread Junio C Hamano
The pattern taken by all the validations in this function is: if (notice a violation exists) { err = report(... VIOLATION_KIND ...); if (err) return err; } where report() returns zero if specified kind of violation is set to