Thread (9 messages) 9 messages, 2 authors, 2016-06-15

Re: [PATCH v3 1/5] Refactor pretty_print_commit arguments into a struct

flat view

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:47:34

Possibly related (same subject, not in this thread)

Thomas Rast [off-list ref] writes:
Junio C Hamano wrote:
quoted
The existing calls to format_commit_message() often take DATE_NORMAL to
its "enum date_mode dmode" argument, and you replaced it with a pointer to
a struct.  DATE_NORMAL happens to be "0" and the compiler does not catch
calls you forgot to convert in this patch.
Hmph, that's embarrassing.  Apparently I was way too focused on
pretty_print_commit...
This is nothing to be embarrassed about.  I did not notice it when I
queued the series either, and I noticed it only when I tried to look at
interactions with js/diff-verbose-submodule topic(the other series does
not hardcode the style to be DATE_NORMAL).

One solution to help the compiler catch this kind of semantic crash upon
merging or applying code based on the old format_commit_message() would
have been to change its function signature (or even the name), so that it
would not go unnoticed that DATE_NORMAL that happens to be "0" is silently
interpreted as (void *)0 == NULL.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help