Thread (2 messages) 2 messages, 2 authors, 2020-09-28

Re: [PATCH v2 8/8] shortlog: allow multiple groups to be specified

flat view

From: Junio C Hamano <hidden>
Date: 2020-09-27 21:18:15

Jeff King [off-list ref] writes:
quoted hunk
-		if (strcasecmp(iter.key.buf, log->trailer))
+		if (!string_list_has_string(&log->trailers, iter.key.buf))
 			continue;
...
quoted hunk
+	if (!log.groups)
+		log.groups = SHORTLOG_GROUP_AUTHOR;
+	string_list_sort(&log.trailers);
I initially reacted with "oh, why sort?" to this line, before
realizing that the list is used as a look-up table, which, if I
recall correctly, you said you want to see us move off of in the
longer term.  

As we already have the string-set in this series, I am wondering
why we are not using it.  It's not like the code at some point
needs to iterate over log.trailers in some stable order, right?

I do realize that going to hashmap might be overkill, but once we
have an easy-to-use wrapper around it, between one "table of
strings" API and another "table of strings" API, I do not see a
reason why we want to choose the string_list.

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