Re: [PATCH] fmt-merge-msg: show those involved in a merged series

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH] fmt-merge-msg: show those involved in a merged series

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:53:14

René Scharfe [off-list ref] writes:
Am 05.03.2012 22:34, schrieb Junio C Hamano:
quoted
+#define util_as_int(elem) ((intptr_t)((elem)->util))
Something that actually returns an int would fit the name better. ;)
The particular type would not matter to the callers of the helper
macro, would it?
quoted
+static int committer_is_me(const char *name)
+{
+	int namelen = strlen(name);
+	const char *me = git_committer_info(IDENT_NO_DATE);
+	return (me && !memcmp(me, name, namelen) &&
+		!memcmp(me + namelen, " <", 2));
+}
This looks scary due to the missing length check of me before the
memcmp() call, but is actually safe because git_committer_info()
returns a pointer to a static buffer that is just as long as name can
possibly be.  Still, perhaps this is nicer instead:

	const char *me = git_committer_info(IDENT_NO_DATE);
	const char *rest = skip_prefix(me, name);
	return rest && skip_prefix(rest, " <");
Probably.  Let me fix it up.

Thanks.

Re: [PATCH] fmt-merge-msg: show those involved in a merged series

From: René Scharfe <hidden>
Date: 2016-06-15 22:53:15

Am 07.03.2012 22:59, schrieb Junio C Hamano:
René Scharfe[off-list ref]  writes:
quoted
Am 05.03.2012 22:34, schrieb Junio C Hamano:
quoted
+#define util_as_int(elem) ((intptr_t)((elem)->util))
Something that actually returns an int would fit the name better. ;)
The particular type would not matter to the callers of the helper
macro, would it?
Three of the five callers introduced in that commit cast the result to 
int and the remaining two don't care, so it actually does seem to matter 
for most of them, strictly speaking.  When I see a nit, I can't resist 
the urge to pick it, apparently.

René
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help