Re: [PATCHv6 06/23] notes.h/c: Propagate combine_notes_fn return value to add_note() and beyond

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thiago Farina wrote:
> On Tue, Nov 9, 2010 at 7:49 PM, Johan Herland <johan@xxxxxxxxxxx> wrote:

>> --- a/builtin/notes.c
>> +++ b/builtin/notes.c
>> @@ -573,8 +573,8 @@ static int add(int argc, const char **argv, const char *prefix)
>>
>> Â Â Â Âif (is_null_sha1(new_note))
>> Â Â Â Â Â Â Â Âremove_note(t, object);
>> - Â Â Â else
>> - Â Â Â Â Â Â Â add_note(t, object, new_note, combine_notes_overwrite);
>> + Â Â Â else if (add_note(t, object, new_note, combine_notes_overwrite))
>> + Â Â Â Â Â Â Â die("confused: combine_notes_overwrite failed");
>
> This message looks like more a debug information. Could it be
> rewritten to be more user friendly / more informative?

Sverre mentioned the same thing.  The intent is the same as the existing

		die("should not happen, someone must be hit on the forehead");

--- i.e., to provoke bug reports if it happens, without the appearance
of begging. :)

So how about:

		die("BUG: combine_notes_overwrite failed");

Something involving assert() could also work, but that tends to be
a bit ugly.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]