[giggle/giggle-0-6: 7/10] Improve author list performances
- From: Javier JardÃn <jjardon src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [giggle/giggle-0-6: 7/10] Improve author list performances
- Date: Thu, 20 Oct 2011 19:55:54 +0000 (UTC)
commit 7f4d46d32b3629fd2438b3bc9bc4e63106432909
Author: Guilhem Bonnefille <guilhem bonnefille gmail com>
Date: Wed May 26 21:42:03 2010 +0200
Improve author list performances
Instead of parsing a short log, we reclaim only author name and
author email from git-log. Easier to parse => faster.
Signed-off-by: Javier JardÃn <jjardon gnome org>
libgiggle-git/giggle-git-authors.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/libgiggle-git/giggle-git-authors.c b/libgiggle-git/giggle-git-authors.c
index 81fff8b..e1c4eaa 100644
--- a/libgiggle-git/giggle-git-authors.c
+++ b/libgiggle-git/giggle-git-authors.c
@@ -222,7 +222,7 @@ static gboolean
authors_get_command_line (GiggleJob *job,
gchar **command_line)
{
- *command_line = g_strdup (GIT_COMMAND " log");
+ *command_line = g_strdup (GIT_COMMAND " log --format=format:'%an <%ae>'");
return TRUE;
}
@@ -290,8 +290,8 @@ authors_handle_output (GiggleJob *job,
authors_by_email = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
for (line = lines; line && *line; line++) {
- if (g_str_has_prefix (*line, "Author: ")) {
- GiggleAuthor* author = giggle_author_new_from_string (*line + strlen ("Author: "));
+ if (**line != '\0') {
+ GiggleAuthor* author = giggle_author_new_from_string (*line);
gchar const * email = giggle_author_get_email (author);
gchar const * name = giggle_author_get_name (author);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]