From: Johan Herland Date: Sat, 09 Jun 2007 18:28:54 GMT Subject: Re: [PATCH 02/21] Return error messages when parsing fails. Message-ID: <200706092028.54459.johan@herland.net> In-Reply-To: <7vwsydf1m8.fsf@assigned-by-dhcp.cox.net> On Saturday 09 June 2007, Junio C Hamano wrote: > Johan Herland writes: > > > This patch brings the already similar tag.c:parse_tag_buffer() and > > mktag.c:verify_tag() a little bit closer to eachother. > > While I would agree that it makes sense to have the same > definition of what is and is not a 100% well formatted tag > object for producer side and consumer side, I do not necessarily > think it is a good idea to make parse_tag_buffer() chattier on > errors. mktag.c:verify_tag() can afford to be verbose in its > diagnosis, because it is used when the user is _creating_ the > tag, and it is generally a good idea to be strict when we > create. > > On the other hand, parse_tag_buffer() is on the side of users > who use existing tag objects that were produced by somebody > else. It is generally a good practice to be more lenient when > you are consuming. > > Also, callers of parse_tag_buffer() know the function is silent > on errors (unless there is something seriously wrong with the > repository); they do their own error messages when they get an > error return. > > Ok. I can make the error messages conditional on 'thorough_verify'. ...Johan -- Johan Herland, www.herland.net