Re: [PATCH v4 5/5] ref-filter: get_ref_atom_value() error handling

2018-03-21 Thread Eric Sunshine
On Wed, Mar 21, 2018 at 3:30 PM, Junio C Hamano wrote: > Eric Sunshine writes: >> strbuf_error() was a possibility proposed in [1], and it does take a >> strbuf. Failure to pass in a strbuf here is just a typo. > > I've seen it; I just thought it was a

Re: [PATCH v4 5/5] ref-filter: get_ref_atom_value() error handling

2018-03-21 Thread Junio C Hamano
Eric Sunshine writes: >> I have no idea what strbuf_error() that does not take any strbuf is >> doing,... > > strbuf_error() was a possibility proposed in [1], and it does take a > strbuf. Failure to pass in a strbuf here is just a typo. I've seen it; I just thought it

Re: [PATCH v4 5/5] ref-filter: get_ref_atom_value() error handling

2018-03-20 Thread Eric Sunshine
On Tue, Mar 20, 2018 at 6:30 PM, Junio C Hamano wrote: > Eric Sunshine writes: >> int ret = 0; >> void *buf = get_obj(oid, obj, , ); >> if (!buf) >> ret = strbuf_error(_("missing object %s for %s"), >> oid_to_hex(oid),

Re: [PATCH v4 5/5] ref-filter: get_ref_atom_value() error handling

2018-03-20 Thread Junio C Hamano
Eric Sunshine writes: > Overall, with the need for resource cleanup, this function becomes > unusually noisy after this change. It could be tamed by doing > something like this: > > int ret = 0; > void *buf = get_obj(oid, obj, , ); > if (!buf) > ret =

Re: [PATCH v4 5/5] ref-filter: get_ref_atom_value() error handling

2018-03-20 Thread Eric Sunshine
On Tue, Mar 20, 2018 at 12:05 PM, Olga Telezhnaya wrote: > ref-filter: get_ref_atom_value() error handling This doesn't tell us much about what this patch is doing. Perhaps a better subject would be: ref-filter: libify get_ref_atom_value() > Finish removing die()

[PATCH v4 5/5] ref-filter: get_ref_atom_value() error handling

2018-03-20 Thread Olga Telezhnaya
Finish removing die() calls from ref-filter formatting logic, so that it could be used by other commands. Change the signature of get_ref_atom_value() and underlying functions by adding return value and strbuf parameter for error message. Return value equals 0 upon success and -1 upon failure