diff options
author | Christian Hesse | 2020-12-28 23:27:13 +0100 |
---|---|---|
committer | Jason A. Donenfeld | 2020-12-29 12:29:42 +0100 |
commit | cef27b670a66c9840bb6120260864e4b3a701dc2 (patch) | |
tree | 1cb4684b783f673a7ca3498c4c119dc6f9a6e544 | |
parent | b1739247b17524460282f63fa240b3f34501e000 (diff) | |
download | cgit-cef27b670a66c9840bb6120260864e4b3a701dc2.tar.gz cgit-cef27b670a66c9840bb6120260864e4b3a701dc2.tar.bz2 cgit-cef27b670a66c9840bb6120260864e4b3a701dc2.zip |
git: update to v2.30.0
Update to git version v2.30.0, this requires changes for these
upstream commits:
* 88894aaeeae92e8cb41143cc2e045f50289dc790
blame: simplify 'setup_scoreboard' interface
* 1fbfdf556f2abc708183caca53ae4e2881b46ae2
banned.h: mark non-reentrant gmtime, etc as banned
Signed-off-by: Christian Hesse <mail@eworm.de>
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | cache.c | 6 | ||||
m--------- | git | 0 | ||||
-rw-r--r-- | ui-blame.c | 3 | ||||
-rw-r--r-- | ui-shared.c | 9 | ||||
-rw-r--r-- | ui-stats.c | 48 |
6 files changed, 35 insertions, 33 deletions
@@ -14,7 +14,7 @@ htmldir = $(docdir) | |||
14 | pdfdir = $(docdir) | 14 | pdfdir = $(docdir) |
15 | mandir = $(prefix)/share/man | 15 | mandir = $(prefix)/share/man |
16 | SHA1_HEADER = <openssl/sha.h> | 16 | SHA1_HEADER = <openssl/sha.h> |
17 | GIT_VER = 2.29.2 | 17 | GIT_VER = 2.30.0 |
18 | GIT_URL = https://www.kernel.org/pub/software/scm/git/git-$(GIT_VER).tar.xz | 18 | GIT_URL = https://www.kernel.org/pub/software/scm/git/git-$(GIT_VER).tar.xz |
19 | INSTALL = install | 19 | INSTALL = install |
20 | COPYTREE = cp -r | 20 | COPYTREE = cp -r |
@@ -401,12 +401,12 @@ int cache_process(int size, const char *path, const char *key, int ttl, | |||
401 | static char *sprintftime(const char *format, time_t time) | 401 | static 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 | ||
@@ -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 | ||
31 | void cgit_print_error(const char *fmt, ...) | 32 | void cgit_print_error(const char *fmt, ...) |
@@ -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>"); |