about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--Makefile2
-rw-r--r--cache.c6
m---------git0
-rw-r--r--ui-blame.c3
-rw-r--r--ui-shared.c9
-rw-r--r--ui-stats.c48
6 files changed, 35 insertions, 33 deletions
diff --git a/Makefile b/Makefile index 1a8f496..6dfc003 100644 --- a/Makefile +++ b/Makefile
@@ -14,7 +14,7 @@ htmldir = $(docdir)
14pdfdir = $(docdir) 14pdfdir = $(docdir)
15mandir = $(prefix)/share/man 15mandir = $(prefix)/share/man
16SHA1_HEADER = <openssl/sha.h> 16SHA1_HEADER = <openssl/sha.h>
17GIT_VER = 2.29.2 17GIT_VER = 2.30.0
18GIT_URL = https://www.kernel.org/pub/software/scm/git/git-$(GIT_VER).tar.xz 18GIT_URL = https://www.kernel.org/pub/software/scm/git/git-$(GIT_VER).tar.xz
19INSTALL = install 19INSTALL = install
20COPYTREE = cp -r 20COPYTREE = cp -r
diff --git a/cache.c b/cache.c index 2c70be7..55199e8 100644 --- a/cache.c +++ b/cache.c
@@ -401,12 +401,12 @@ int cache_process(int size, const char *path, const char *key, int ttl,
401static char *sprintftime(const char *format, time_t time) 401static char *sprintftime(const char *format, time_t time)
402{ 402{
403 static char buf[64]; 403 static char buf[64];
404 struct tm *tm; 404 struct tm tm;
405 405
406 if (!time) 406 if (!time)
407 return NULL; 407 return NULL;
408 tm = gmtime(&time); 408 gmtime_r(&time, &tm);
409 strftime(buf, sizeof(buf)-1, format, tm); 409 strftime(buf, sizeof(buf)-1, format, &tm);
410 return buf; 410 return buf;
411} 411}
412 412
diff --git a/git b/git
Subproject 898f80736c75878acc02dc55672317fcc0e0a5a Subproject 71ca53e8125e36efbda17293c50027d31681a41
diff --git a/ui-blame.c b/ui-blame.c index cfab7fb..ec1d888 100644 --- a/ui-blame.c +++ b/ui-blame.c
@@ -132,7 +132,8 @@ static void print_object(const struct object_id *oid, const char *path,
132 init_scoreboard(&sb); 132 init_scoreboard(&sb);
133 sb.revs = &revs; 133 sb.revs = &revs;
134 sb.repo = the_repository; 134 sb.repo = the_repository;
135 setup_scoreboard(&sb, path, &o); 135 sb.path = path;
136 setup_scoreboard(&sb, &o);
136 o->suspects = blame_entry_prepend(NULL, 0, sb.num_lines, o); 137 o->suspects = blame_entry_prepend(NULL, 0, sb.num_lines, o);
137 prio_queue_put(&sb.commits, o->commit); 138 prio_queue_put(&sb.commits, o->commit);
138 blame_origin_decref(o); 139 blame_origin_decref(o);
diff --git a/ui-shared.c b/ui-shared.c index 151ac17..acd8ab5 100644 --- a/ui-shared.c +++ b/ui-shared.c
@@ -22,10 +22,11 @@ static char *http_date(time_t t)
22 static char month[][4] = 22 static char month[][4] =
23 {"Jan", "Feb", "Mar", "Apr", "May", "Jun", 23 {"Jan", "Feb", "Mar", "Apr", "May", "Jun",
24 "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}; 24 "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
25 struct tm *tm = gmtime(&t); 25 struct tm tm;
26 return fmt("%s, %02d %s %04d %02d:%02d:%02d GMT", day[tm->tm_wday], 26 gmtime_r(&t, &tm);
27 tm->tm_mday, month[tm->tm_mon], 1900 + tm->tm_year, 27 return fmt("%s, %02d %s %04d %02d:%02d:%02d GMT", day[tm.tm_wday],
28 tm->tm_hour, tm->tm_min, tm->tm_sec); 28 tm.tm_mday, month[tm.tm_mon], 1900 + tm.tm_year,
29 tm.tm_hour, tm.tm_min, tm.tm_sec);
29} 30}
30 31
31void cgit_print_error(const char *fmt, ...) 32void cgit_print_error(const char *fmt, ...)
diff --git a/ui-stats.c b/ui-stats.c index 7272a61..09b3625 100644 --- a/ui-stats.c +++ b/ui-stats.c
@@ -166,7 +166,7 @@ static void add_commit(struct string_list *authors, struct commit *commit,
166 struct authorstat *authorstat; 166 struct authorstat *authorstat;
167 struct string_list *items; 167 struct string_list *items;
168 char *tmp; 168 char *tmp;
169 struct tm *date; 169 struct tm date;
170 time_t t; 170 time_t t;
171 uintptr_t *counter; 171 uintptr_t *counter;
172 172
@@ -180,9 +180,9 @@ static void add_commit(struct string_list *authors, struct commit *commit,
180 authorstat = author->util; 180 authorstat = author->util;
181 items = &authorstat->list; 181 items = &authorstat->list;
182 t = info->committer_date; 182 t = info->committer_date;
183 date = gmtime(&t); 183 gmtime_r(&t, &date);
184 period->trunc(date); 184 period->trunc(&date);
185 tmp = xstrdup(period->pretty(date)); 185 tmp = xstrdup(period->pretty(&date));
186 item = string_list_insert(items, tmp); 186 item = string_list_insert(items, tmp);
187 counter = (uintptr_t *)&item->util; 187 counter = (uintptr_t *)&item->util;
188 if (*counter) 188 if (*counter)
@@ -215,15 +215,15 @@ static struct string_list collect_stats(const struct cgit_period *period)
215 int argc = 3; 215 int argc = 3;
216 time_t now; 216 time_t now;
217 long i; 217 long i;
218 struct tm *tm; 218 struct tm tm;
219 char tmp[11]; 219 char tmp[11];
220 220
221 time(&now); 221 time(&now);
222 tm = gmtime(&now); 222 gmtime_r(&now, &tm);
223 period->trunc(tm); 223 period->trunc(&tm);
224 for (i = 1; i < period->count; i++) 224 for (i = 1; i < period->count; i++)
225 period->dec(tm); 225 period->dec(&tm);
226 strftime(tmp, sizeof(tmp), "%Y-%m-%d", tm); 226 strftime(tmp, sizeof(tmp), "%Y-%m-%d", &tm);
227 argv[2] = xstrdup(fmt("--since=%s", tmp)); 227 argv[2] = xstrdup(fmt("--since=%s", tmp));
228 if (ctx.qry.path) { 228 if (ctx.qry.path) {
229 argv[3] = "--"; 229 argv[3] = "--";
@@ -261,21 +261,21 @@ static void print_combined_authorrow(struct string_list *authors, int from,
261 struct string_list_item *date; 261 struct string_list_item *date;
262 time_t now; 262 time_t now;
263 long i, j, total, subtotal; 263 long i, j, total, subtotal;
264 struct tm *tm; 264 struct tm tm;
265 char *tmp; 265 char *tmp;
266 266
267 time(&now); 267 time(&now);
268 tm = gmtime(&now); 268 gmtime_r(&now, &tm);
269 period->trunc(tm); 269 period->trunc(&tm);
270 for (i = 1; i < period->count; i++) 270 for (i = 1; i < period->count; i++)
271 period->dec(tm); 271 period->dec(&tm);
272 272
273 total = 0; 273 total = 0;
274 htmlf("<tr><td class='%s'>%s</td>", leftclass, 274 htmlf("<tr><td class='%s'>%s</td>", leftclass,
275 fmt(name, to - from + 1)); 275 fmt(name, to - from + 1));
276 for (j = 0; j < period->count; j++) { 276 for (j = 0; j < period->count; j++) {
277 tmp = period->pretty(tm); 277 tmp = period->pretty(&tm);
278 period->inc(tm); 278 period->inc(&tm);
279 subtotal = 0; 279 subtotal = 0;
280 for (i = from; i <= to; i++) { 280 for (i = from; i <= to; i++) {
281 author = &authors->items[i]; 281 author = &authors->items[i];
@@ -300,20 +300,20 @@ static void print_authors(struct string_list *authors, int top,
300 struct string_list_item *date; 300 struct string_list_item *date;
301 time_t now; 301 time_t now;
302 long i, j, total; 302 long i, j, total;
303 struct tm *tm; 303 struct tm tm;
304 char *tmp; 304 char *tmp;
305 305
306 time(&now); 306 time(&now);
307 tm = gmtime(&now); 307 gmtime_r(&now, &tm);
308 period->trunc(tm); 308 period->trunc(&tm);
309 for (i = 1; i < period->count; i++) 309 for (i = 1; i < period->count; i++)
310 period->dec(tm); 310 period->dec(&tm);
311 311
312 html("<table class='stats'><tr><th>Author</th>"); 312 html("<table class='stats'><tr><th>Author</th>");
313 for (j = 0; j < period->count; j++) { 313 for (j = 0; j < period->count; j++) {
314 tmp = period->pretty(tm); 314 tmp = period->pretty(&tm);
315 htmlf("<th>%s</th>", tmp); 315 htmlf("<th>%s</th>", tmp);
316 period->inc(tm); 316 period->inc(&tm);
317 } 317 }
318 html("<th>Total</th></tr>\n"); 318 html("<th>Total</th></tr>\n");
319 319
@@ -329,10 +329,10 @@ static void print_authors(struct string_list *authors, int top,
329 items = &authorstat->list; 329 items = &authorstat->list;
330 total = 0; 330 total = 0;
331 for (j = 0; j < period->count; j++) 331 for (j = 0; j < period->count; j++)
332 period->dec(tm); 332 period->dec(&tm);
333 for (j = 0; j < period->count; j++) { 333 for (j = 0; j < period->count; j++) {
334 tmp = period->pretty(tm); 334 tmp = period->pretty(&tm);
335 period->inc(tm); 335 period->inc(&tm);
336 date = string_list_lookup(items, tmp); 336 date = string_list_lookup(items, tmp);
337 if (!date) 337 if (!date)
338 html("<td>0</td>"); 338 html("<td>0</td>");