about summary refs log tree commit diff stats
path: root/ui-log.c
diff options
context:
space:
mode:
authorChristian Hesse2020-10-06 16:32:08 +0200
committerChristian Hesse2020-10-19 20:27:28 +0200
commit629659d2cffbf059374fc53e6400ff0bebe1ddde (patch)
tree5447658c87e9aa4331e36ace5ebe295d9ed2952e /ui-log.c
parentgit: update to v2.28.0 (diff)
downloadcgit-629659d2cffbf059374fc53e6400ff0bebe1ddde.tar.gz
cgit-629659d2cffbf059374fc53e6400ff0bebe1ddde.zip
git: update to v2.29.0
Update to git version v2.29.0, this requires changes for these
upstream commits:

* dbbcd44fb47347a3fdbee88ea21805b7f4ac0b98
  strvec: rename files from argv-array to strvec

* 873cd28a8b17ff21908c78c7929a7615f8c94992
  argv-array: rename to strvec

* d70a9eb611a9d242c1d26847d223b8677609305b
  strvec: rename struct fields

* 6a67c759489e1025665adf78326e9e0d0981bab5
  test-lib-functions: restrict test_must_fail usage

Signed-off-by: Christian Hesse <mail@eworm.de>
Diffstat (limited to 'ui-log.c')
-rw-r--r--ui-log.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/ui-log.c b/ui-log.c index 2939c01..fd07409 100644 --- a/ui-log.c +++ b/ui-log.c
@@ -10,7 +10,7 @@
10#include "ui-log.h" 10#include "ui-log.h"
11#include "html.h" 11#include "html.h"
12#include "ui-shared.h" 12#include "ui-shared.h"
13#include "argv-array.h" 13#include "strvec.h"
14 14
15static int files, add_lines, rem_lines, lines_counted; 15static int files, add_lines, rem_lines, lines_counted;
16 16
@@ -366,23 +366,23 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern
366{ 366{
367 struct rev_info rev; 367 struct rev_info rev;
368 struct commit *commit; 368 struct commit *commit;
369 struct argv_array rev_argv = ARGV_ARRAY_INIT; 369 struct strvec rev_argv = STRVEC_INIT;
370 int i, columns = commit_graph ? 4 : 3; 370 int i, columns = commit_graph ? 4 : 3;
371 int must_free_tip = 0; 371 int must_free_tip = 0;
372 372
373 /* rev_argv.argv[0] will be ignored by setup_revisions */ 373 /* rev_argv.argv[0] will be ignored by setup_revisions */
374 argv_array_push(&rev_argv, "log_rev_setup"); 374 strvec_push(&rev_argv, "log_rev_setup");
375 375
376 if (!tip) 376 if (!tip)
377 tip = ctx.qry.head; 377 tip = ctx.qry.head;
378 tip = disambiguate_ref(tip, &must_free_tip); 378 tip = disambiguate_ref(tip, &must_free_tip);
379 argv_array_push(&rev_argv, tip); 379 strvec_push(&rev_argv, tip);
380 380
381 if (grep && pattern && *pattern) { 381 if (grep && pattern && *pattern) {
382 pattern = xstrdup(pattern); 382 pattern = xstrdup(pattern);
383 if (!strcmp(grep, "grep") || !strcmp(grep, "author") || 383 if (!strcmp(grep, "grep") || !strcmp(grep, "author") ||
384 !strcmp(grep, "committer")) { 384 !strcmp(grep, "committer")) {
385 argv_array_pushf(&rev_argv, "--%s=%s", grep, pattern); 385 strvec_pushf(&rev_argv, "--%s=%s", grep, pattern);
386 } else if (!strcmp(grep, "range")) { 386 } else if (!strcmp(grep, "range")) {
387 char *arg; 387 char *arg;
388 /* Split the pattern at whitespace and add each token 388 /* Split the pattern at whitespace and add each token
@@ -390,14 +390,14 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern
390 * rev-list options. Also, replace the previously 390 * rev-list options. Also, replace the previously
391 * pushed tip (it's no longer relevant). 391 * pushed tip (it's no longer relevant).
392 */ 392 */
393 argv_array_pop(&rev_argv); 393 strvec_pop(&rev_argv);
394 while ((arg = next_token(&pattern))) { 394 while ((arg = next_token(&pattern))) {
395 if (*arg == '-') { 395 if (*arg == '-') {
396 fprintf(stderr, "Bad range expr: %s\n", 396 fprintf(stderr, "Bad range expr: %s\n",
397 arg); 397 arg);
398 break; 398 break;
399 } 399 }
400 argv_array_push(&rev_argv, arg); 400 strvec_push(&rev_argv, arg);
401 } 401 }
402 } 402 }
403 } 403 }
@@ -412,22 +412,22 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern
412 } 412 }
413 413
414 if (commit_graph && !ctx.qry.follow) { 414 if (commit_graph && !ctx.qry.follow) {
415 argv_array_push(&rev_argv, "--graph"); 415 strvec_push(&rev_argv, "--graph");
416 argv_array_push(&rev_argv, "--color"); 416 strvec_push(&rev_argv, "--color");
417 graph_set_column_colors(column_colors_html, 417 graph_set_column_colors(column_colors_html,
418 COLUMN_COLORS_HTML_MAX); 418 COLUMN_COLORS_HTML_MAX);
419 } 419 }
420 420
421 if (commit_sort == 1) 421 if (commit_sort == 1)
422 argv_array_push(&rev_argv, "--date-order"); 422 strvec_push(&rev_argv, "--date-order");
423 else if (commit_sort == 2) 423 else if (commit_sort == 2)
424 argv_array_push(&rev_argv, "--topo-order"); 424 strvec_push(&rev_argv, "--topo-order");
425 425
426 if (path && ctx.qry.follow) 426 if (path && ctx.qry.follow)
427 argv_array_push(&rev_argv, "--follow"); 427 strvec_push(&rev_argv, "--follow");
428 argv_array_push(&rev_argv, "--"); 428 strvec_push(&rev_argv, "--");
429 if (path) 429 if (path)
430 argv_array_push(&rev_argv, path); 430 strvec_push(&rev_argv, path);
431 431
432 init_revisions(&rev, NULL); 432 init_revisions(&rev, NULL);
433 rev.abbrev = DEFAULT_ABBREV; 433 rev.abbrev = DEFAULT_ABBREV;
@@ -436,7 +436,7 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern
436 rev.show_root_diff = 0; 436 rev.show_root_diff = 0;
437 rev.ignore_missing = 1; 437 rev.ignore_missing = 1;
438 rev.simplify_history = 1; 438 rev.simplify_history = 1;
439 setup_revisions(rev_argv.argc, rev_argv.argv, &rev, NULL); 439 setup_revisions(rev_argv.nr, rev_argv.v, &rev, NULL);
440 load_ref_decorations(NULL, DECORATE_FULL_REFS); 440 load_ref_decorations(NULL, DECORATE_FULL_REFS);
441 rev.show_decorations = 1; 441 rev.show_decorations = 1;
442 rev.grep_filter.ignore_case = 1; 442 rev.grep_filter.ignore_case = 1;