cgit/cgit-1.2.3-git-2.34.1.patch

1004 lines
30 KiB
Diff

From 0462f08d8508978256118769b3e6dc89773a1367 Mon Sep 17 00:00:00 2001
From: Christian Hesse <mail@eworm.de>
Date: Mon, 9 Mar 2020 09:51:05 +0100
Subject: [PATCH] git: update to v2.26.0
Update to git version v2.26.0.
No changes required.
Signed-off-by: Christian Hesse <mail@eworm.de>
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 49109ad..b50159f 100644
--- a/Makefile
+++ b/Makefile
@@ -14,7 +14,7 @@ htmldir = $(docdir)
pdfdir = $(docdir)
mandir = $(prefix)/share/man
SHA1_HEADER = <openssl/sha.h>
-GIT_VER = 2.25.1
+GIT_VER = 2.26.0
GIT_URL = https://www.kernel.org/pub/software/scm/git/git-$(GIT_VER).tar.xz
INSTALL = install
COPYTREE = cp -r
From f780396c0afa6015a05025c6404a560252605319 Mon Sep 17 00:00:00 2001
From: Christian Hesse <mail@eworm.de>
Date: Tue, 2 Jun 2020 10:10:15 +0200
Subject: [PATCH] git: update to v2.27.0
Update to git version v2.27.0.
No changes required.
Signed-off-by: Christian Hesse <mail@eworm.de>
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index b50159f..5c8fa8c 100644
--- a/Makefile
+++ b/Makefile
@@ -14,7 +14,7 @@ htmldir = $(docdir)
pdfdir = $(docdir)
mandir = $(prefix)/share/man
SHA1_HEADER = <openssl/sha.h>
-GIT_VER = 2.26.0
+GIT_VER = 2.27.0
GIT_URL = https://www.kernel.org/pub/software/scm/git/git-$(GIT_VER).tar.xz
INSTALL = install
COPYTREE = cp -r
From 205837d4684f331afa93c946cbdfa1fa9b3d1ce9 Mon Sep 17 00:00:00 2001
From: Christian Hesse <mail@eworm.de>
Date: Mon, 27 Jul 2020 20:36:14 +0200
Subject: [PATCH] git: update to v2.28.0
Update to git version v2.28.0.
No changes required.
Signed-off-by: Christian Hesse <mail@eworm.de>
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 5c8fa8c..84822f0 100644
--- a/Makefile
+++ b/Makefile
@@ -14,7 +14,7 @@ htmldir = $(docdir)
pdfdir = $(docdir)
mandir = $(prefix)/share/man
SHA1_HEADER = <openssl/sha.h>
-GIT_VER = 2.27.0
+GIT_VER = 2.28.0
GIT_URL = https://www.kernel.org/pub/software/scm/git/git-$(GIT_VER).tar.xz
INSTALL = install
COPYTREE = cp -r
From 629659d2cffbf059374fc53e6400ff0bebe1ddde Mon Sep 17 00:00:00 2001
From: Christian Hesse <mail@eworm.de>
Date: Tue, 6 Oct 2020 16:32:08 +0200
Subject: [PATCH] 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>
---
Makefile | 2 +-
cgit.h | 2 +-
tests/t0109-gitconfig.sh | 2 +-
ui-blame.c | 10 +++++-----
ui-log.c | 30 +++++++++++++++---------------
ui-snapshot.c | 24 ++++++++++++------------
6 files changed, 35 insertions(+), 35 deletions(-)
diff --git a/Makefile b/Makefile
index 84822f0..c947b63 100644
--- a/Makefile
+++ b/Makefile
@@ -14,7 +14,7 @@ htmldir = $(docdir)
pdfdir = $(docdir)
mandir = $(prefix)/share/man
SHA1_HEADER = <openssl/sha.h>
-GIT_VER = 2.28.0
+GIT_VER = 2.29.0
GIT_URL = https://www.kernel.org/pub/software/scm/git/git-$(GIT_VER).tar.xz
INSTALL = install
COPYTREE = cp -r
diff --git a/cgit.h b/cgit.h
index 7ec46b4..f5db364 100644
--- a/cgit.h
+++ b/cgit.h
@@ -14,7 +14,7 @@
#include <tag.h>
#include <diff.h>
#include <diffcore.h>
-#include <argv-array.h>
+#include <strvec.h>
#include <refs.h>
#include <revision.h>
#include <log-tree.h>
diff --git a/tests/t0109-gitconfig.sh b/tests/t0109-gitconfig.sh
index 8cee75c..189ef28 100755
--- a/tests/t0109-gitconfig.sh
+++ b/tests/t0109-gitconfig.sh
@@ -25,7 +25,7 @@ test_no_home_access () {
-E CGIT_CONFIG="$PWD/cgitrc" \
-E QUERY_STRING="url=$1" \
-e access -f -o strace.out cgit &&
- test_must_fail grep "$non_existent_path" strace.out
+ ! grep "$non_existent_path" strace.out
}
test_no_home_access_success() {
diff --git a/ui-blame.c b/ui-blame.c
index f28eea0..c3662bb 100644
--- a/ui-blame.c
+++ b/ui-blame.c
@@ -10,7 +10,7 @@
#include "ui-blame.h"
#include "html.h"
#include "ui-shared.h"
-#include "argv-array.h"
+#include "strvec.h"
#include "blame.h"
@@ -104,7 +104,7 @@ static void print_object(const struct object_id *oid, const char *path,
enum object_type type;
char *buf;
unsigned long size;
- struct argv_array rev_argv = ARGV_ARRAY_INIT;
+ struct strvec rev_argv = STRVEC_INIT;
struct rev_info revs;
struct blame_scoreboard sb;
struct blame_origin *o;
@@ -124,11 +124,11 @@ static void print_object(const struct object_id *oid, const char *path,
return;
}
- argv_array_push(&rev_argv, "blame");
- argv_array_push(&rev_argv, rev);
+ strvec_push(&rev_argv, "blame");
+ strvec_push(&rev_argv, rev);
init_revisions(&revs, NULL);
revs.diffopt.flags.allow_textconv = 1;
- setup_revisions(rev_argv.argc, rev_argv.argv, &revs, NULL);
+ setup_revisions(rev_argv.nr, rev_argv.v, &revs, NULL);
init_scoreboard(&sb);
sb.revs = &revs;
sb.repo = the_repository;
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 @@
#include "ui-log.h"
#include "html.h"
#include "ui-shared.h"
-#include "argv-array.h"
+#include "strvec.h"
static int files, add_lines, rem_lines, lines_counted;
@@ -366,23 +366,23 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern
{
struct rev_info rev;
struct commit *commit;
- struct argv_array rev_argv = ARGV_ARRAY_INIT;
+ struct strvec rev_argv = STRVEC_INIT;
int i, columns = commit_graph ? 4 : 3;
int must_free_tip = 0;
/* rev_argv.argv[0] will be ignored by setup_revisions */
- argv_array_push(&rev_argv, "log_rev_setup");
+ strvec_push(&rev_argv, "log_rev_setup");
if (!tip)
tip = ctx.qry.head;
tip = disambiguate_ref(tip, &must_free_tip);
- argv_array_push(&rev_argv, tip);
+ strvec_push(&rev_argv, tip);
if (grep && pattern && *pattern) {
pattern = xstrdup(pattern);
if (!strcmp(grep, "grep") || !strcmp(grep, "author") ||
!strcmp(grep, "committer")) {
- argv_array_pushf(&rev_argv, "--%s=%s", grep, pattern);
+ strvec_pushf(&rev_argv, "--%s=%s", grep, pattern);
} else if (!strcmp(grep, "range")) {
char *arg;
/* 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
* rev-list options. Also, replace the previously
* pushed tip (it's no longer relevant).
*/
- argv_array_pop(&rev_argv);
+ strvec_pop(&rev_argv);
while ((arg = next_token(&pattern))) {
if (*arg == '-') {
fprintf(stderr, "Bad range expr: %s\n",
arg);
break;
}
- argv_array_push(&rev_argv, arg);
+ strvec_push(&rev_argv, arg);
}
}
}
@@ -412,22 +412,22 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern
}
if (commit_graph && !ctx.qry.follow) {
- argv_array_push(&rev_argv, "--graph");
- argv_array_push(&rev_argv, "--color");
+ strvec_push(&rev_argv, "--graph");
+ strvec_push(&rev_argv, "--color");
graph_set_column_colors(column_colors_html,
COLUMN_COLORS_HTML_MAX);
}
if (commit_sort == 1)
- argv_array_push(&rev_argv, "--date-order");
+ strvec_push(&rev_argv, "--date-order");
else if (commit_sort == 2)
- argv_array_push(&rev_argv, "--topo-order");
+ strvec_push(&rev_argv, "--topo-order");
if (path && ctx.qry.follow)
- argv_array_push(&rev_argv, "--follow");
- argv_array_push(&rev_argv, "--");
+ strvec_push(&rev_argv, "--follow");
+ strvec_push(&rev_argv, "--");
if (path)
- argv_array_push(&rev_argv, path);
+ strvec_push(&rev_argv, path);
init_revisions(&rev, NULL);
rev.abbrev = DEFAULT_ABBREV;
@@ -436,7 +436,7 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern
rev.show_root_diff = 0;
rev.ignore_missing = 1;
rev.simplify_history = 1;
- setup_revisions(rev_argv.argc, rev_argv.argv, &rev, NULL);
+ setup_revisions(rev_argv.nr, rev_argv.v, &rev, NULL);
load_ref_decorations(NULL, DECORATE_FULL_REFS);
rev.show_decorations = 1;
rev.grep_filter.ignore_case = 1;
diff --git a/ui-snapshot.c b/ui-snapshot.c
index 556d3ed..18361a6 100644
--- a/ui-snapshot.c
+++ b/ui-snapshot.c
@@ -13,32 +13,32 @@
static int write_archive_type(const char *format, const char *hex, const char *prefix)
{
- struct argv_array argv = ARGV_ARRAY_INIT;
+ struct strvec argv = STRVEC_INIT;
const char **nargv;
int result;
- argv_array_push(&argv, "snapshot");
- argv_array_push(&argv, format);
+ strvec_push(&argv, "snapshot");
+ strvec_push(&argv, format);
if (prefix) {
struct strbuf buf = STRBUF_INIT;
strbuf_addstr(&buf, prefix);
strbuf_addch(&buf, '/');
- argv_array_push(&argv, "--prefix");
- argv_array_push(&argv, buf.buf);
+ strvec_push(&argv, "--prefix");
+ strvec_push(&argv, buf.buf);
strbuf_release(&buf);
}
- argv_array_push(&argv, hex);
+ strvec_push(&argv, hex);
/*
* Now we need to copy the pointers to arguments into a new
* structure because write_archive will rearrange its arguments
* which may result in duplicated/missing entries causing leaks
- * or double-frees in argv_array_clear.
+ * or double-frees in strvec_clear.
*/
- nargv = xmalloc(sizeof(char *) * (argv.argc + 1));
- /* argv_array guarantees a trailing NULL entry. */
- memcpy(nargv, argv.argv, sizeof(char *) * (argv.argc + 1));
+ nargv = xmalloc(sizeof(char *) * (argv.nr + 1));
+ /* strvec guarantees a trailing NULL entry. */
+ memcpy(nargv, argv.v, sizeof(char *) * (argv.nr + 1));
- result = write_archive(argv.argc, nargv, NULL, the_repository, NULL, 0);
- argv_array_clear(&argv);
+ result = write_archive(argv.nr, nargv, NULL, the_repository, NULL, 0);
+ strvec_clear(&argv);
free(nargv);
return result;
}
From fe99c76ee477f91d6d983486491603109c7b2599 Mon Sep 17 00:00:00 2001
From: Christian Hesse <mail@eworm.de>
Date: Tue, 27 Oct 2020 10:39:46 +0100
Subject: [PATCH] git: update to v2.29.1
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Update to git version v2.29.1. No functional change, but we want latest
and greated version number, no? 😜
Signed-off-by: Christian Hesse <mail@eworm.de>
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index c947b63..eb60388 100644
--- a/Makefile
+++ b/Makefile
@@ -14,7 +14,7 @@ htmldir = $(docdir)
pdfdir = $(docdir)
mandir = $(prefix)/share/man
SHA1_HEADER = <openssl/sha.h>
-GIT_VER = 2.29.0
+GIT_VER = 2.29.1
GIT_URL = https://www.kernel.org/pub/software/scm/git/git-$(GIT_VER).tar.xz
INSTALL = install
COPYTREE = cp -r
From b1739247b17524460282f63fa240b3f34501e000 Mon Sep 17 00:00:00 2001
From: Christian Hesse <mail@eworm.de>
Date: Fri, 30 Oct 2020 22:22:32 +0100
Subject: [PATCH] git: update to v2.29.2
Update to git version v2.29.2.
No changes required.
Signed-off-by: Christian Hesse <mail@eworm.de>
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index eb60388..1a8f496 100644
--- a/Makefile
+++ b/Makefile
@@ -14,7 +14,7 @@ htmldir = $(docdir)
pdfdir = $(docdir)
mandir = $(prefix)/share/man
SHA1_HEADER = <openssl/sha.h>
-GIT_VER = 2.29.1
+GIT_VER = 2.29.2
GIT_URL = https://www.kernel.org/pub/software/scm/git/git-$(GIT_VER).tar.xz
INSTALL = install
COPYTREE = cp -r
From cef27b670a66c9840bb6120260864e4b3a701dc2 Mon Sep 17 00:00:00 2001
From: Christian Hesse <mail@eworm.de>
Date: Mon, 28 Dec 2020 23:27:13 +0100
Subject: [PATCH] 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>
---
Makefile | 2 +-
cache.c | 6 +++---
ui-blame.c | 3 ++-
ui-shared.c | 9 +++++----
ui-stats.c | 48 ++++++++++++++++++++++++------------------------
5 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)
pdfdir = $(docdir)
mandir = $(prefix)/share/man
SHA1_HEADER = <openssl/sha.h>
-GIT_VER = 2.29.2
+GIT_VER = 2.30.0
GIT_URL = https://www.kernel.org/pub/software/scm/git/git-$(GIT_VER).tar.xz
INSTALL = install
COPYTREE = 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,
static char *sprintftime(const char *format, time_t time)
{
static char buf[64];
- struct tm *tm;
+ struct tm tm;
if (!time)
return NULL;
- tm = gmtime(&time);
- strftime(buf, sizeof(buf)-1, format, tm);
+ gmtime_r(&time, &tm);
+ strftime(buf, sizeof(buf)-1, format, &tm);
return buf;
}
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,
init_scoreboard(&sb);
sb.revs = &revs;
sb.repo = the_repository;
- setup_scoreboard(&sb, path, &o);
+ sb.path = path;
+ setup_scoreboard(&sb, &o);
o->suspects = blame_entry_prepend(NULL, 0, sb.num_lines, o);
prio_queue_put(&sb.commits, o->commit);
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)
static char month[][4] =
{"Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
- struct tm *tm = gmtime(&t);
- return fmt("%s, %02d %s %04d %02d:%02d:%02d GMT", day[tm->tm_wday],
- tm->tm_mday, month[tm->tm_mon], 1900 + tm->tm_year,
- tm->tm_hour, tm->tm_min, tm->tm_sec);
+ struct tm tm;
+ gmtime_r(&t, &tm);
+ return fmt("%s, %02d %s %04d %02d:%02d:%02d GMT", day[tm.tm_wday],
+ tm.tm_mday, month[tm.tm_mon], 1900 + tm.tm_year,
+ tm.tm_hour, tm.tm_min, tm.tm_sec);
}
void 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,
struct authorstat *authorstat;
struct string_list *items;
char *tmp;
- struct tm *date;
+ struct tm date;
time_t t;
uintptr_t *counter;
@@ -180,9 +180,9 @@ static void add_commit(struct string_list *authors, struct commit *commit,
authorstat = author->util;
items = &authorstat->list;
t = info->committer_date;
- date = gmtime(&t);
- period->trunc(date);
- tmp = xstrdup(period->pretty(date));
+ gmtime_r(&t, &date);
+ period->trunc(&date);
+ tmp = xstrdup(period->pretty(&date));
item = string_list_insert(items, tmp);
counter = (uintptr_t *)&item->util;
if (*counter)
@@ -215,15 +215,15 @@ static struct string_list collect_stats(const struct cgit_period *period)
int argc = 3;
time_t now;
long i;
- struct tm *tm;
+ struct tm tm;
char tmp[11];
time(&now);
- tm = gmtime(&now);
- period->trunc(tm);
+ gmtime_r(&now, &tm);
+ period->trunc(&tm);
for (i = 1; i < period->count; i++)
- period->dec(tm);
- strftime(tmp, sizeof(tmp), "%Y-%m-%d", tm);
+ period->dec(&tm);
+ strftime(tmp, sizeof(tmp), "%Y-%m-%d", &tm);
argv[2] = xstrdup(fmt("--since=%s", tmp));
if (ctx.qry.path) {
argv[3] = "--";
@@ -261,21 +261,21 @@ static void print_combined_authorrow(struct string_list *authors, int from,
struct string_list_item *date;
time_t now;
long i, j, total, subtotal;
- struct tm *tm;
+ struct tm tm;
char *tmp;
time(&now);
- tm = gmtime(&now);
- period->trunc(tm);
+ gmtime_r(&now, &tm);
+ period->trunc(&tm);
for (i = 1; i < period->count; i++)
- period->dec(tm);
+ period->dec(&tm);
total = 0;
htmlf("<tr><td class='%s'>%s</td>", leftclass,
fmt(name, to - from + 1));
for (j = 0; j < period->count; j++) {
- tmp = period->pretty(tm);
- period->inc(tm);
+ tmp = period->pretty(&tm);
+ period->inc(&tm);
subtotal = 0;
for (i = from; i <= to; i++) {
author = &authors->items[i];
@@ -300,20 +300,20 @@ static void print_authors(struct string_list *authors, int top,
struct string_list_item *date;
time_t now;
long i, j, total;
- struct tm *tm;
+ struct tm tm;
char *tmp;
time(&now);
- tm = gmtime(&now);
- period->trunc(tm);
+ gmtime_r(&now, &tm);
+ period->trunc(&tm);
for (i = 1; i < period->count; i++)
- period->dec(tm);
+ period->dec(&tm);
html("<table class='stats'><tr><th>Author</th>");
for (j = 0; j < period->count; j++) {
- tmp = period->pretty(tm);
+ tmp = period->pretty(&tm);
htmlf("<th>%s</th>", tmp);
- period->inc(tm);
+ period->inc(&tm);
}
html("<th>Total</th></tr>\n");
@@ -329,10 +329,10 @@ static void print_authors(struct string_list *authors, int top,
items = &authorstat->list;
total = 0;
for (j = 0; j < period->count; j++)
- period->dec(tm);
+ period->dec(&tm);
for (j = 0; j < period->count; j++) {
- tmp = period->pretty(tm);
- period->inc(tm);
+ tmp = period->pretty(&tm);
+ period->inc(&tm);
date = string_list_lookup(items, tmp);
if (!date)
html("<td>0</td>");
From 4ffadc1e0c589f9bcfb4a721f5625914ef2d496d Mon Sep 17 00:00:00 2001
From: Christian Hesse <mail@eworm.de>
Date: Wed, 10 Feb 2021 16:13:53 +0100
Subject: [PATCH] git: update to v2.30.1
Update to git version v2.30.1, no additional changes required.
Signed-off-by: Christian Hesse <mail@eworm.de>
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 6dfc003..a4e597b 100644
--- a/Makefile
+++ b/Makefile
@@ -14,7 +14,7 @@ htmldir = $(docdir)
pdfdir = $(docdir)
mandir = $(prefix)/share/man
SHA1_HEADER = <openssl/sha.h>
-GIT_VER = 2.30.0
+GIT_VER = 2.30.1
GIT_URL = https://www.kernel.org/pub/software/scm/git/git-$(GIT_VER).tar.xz
INSTALL = install
COPYTREE = cp -r
From d889cae811f27a052317ac5aea23890cba414760 Mon Sep 17 00:00:00 2001
From: Christian Hesse <mail@eworm.de>
Date: Mon, 15 Mar 2021 22:48:26 +0100
Subject: [PATCH] git: update to v2.31.0
Update to git version v2.31.0, this requires changes for these
upstream commits:
* 36a317929b8f0c67d77d54235f2d20751c576cbb
refs: switch peel_ref() to peel_iterated_oid()
Signed-off-by: Christian Hesse <mail@eworm.de>
---
Makefile | 2 +-
ui-log.c | 7 ++++---
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/Makefile b/Makefile
index a4e597b..11b437b 100644
--- a/Makefile
+++ b/Makefile
@@ -14,7 +14,7 @@ htmldir = $(docdir)
pdfdir = $(docdir)
mandir = $(prefix)/share/man
SHA1_HEADER = <openssl/sha.h>
-GIT_VER = 2.30.1
+GIT_VER = 2.31.0
GIT_URL = https://www.kernel.org/pub/software/scm/git/git-$(GIT_VER).tar.xz
INSTALL = install
COPYTREE = cp -r
diff --git a/ui-log.c b/ui-log.c
index 6914f75..20774bf 100644
--- a/ui-log.c
+++ b/ui-log.c
@@ -65,8 +65,9 @@ void show_commit_decorations(struct commit *commit)
return;
html("<span class='decoration'>");
while (deco) {
- struct object_id peeled;
+ struct object_id oid_tag, peeled;
int is_annotated = 0;
+
strlcpy(buf, prettify_refname(deco->name), sizeof(buf));
switch(deco->type) {
case DECORATION_NONE:
@@ -79,8 +80,8 @@ void show_commit_decorations(struct commit *commit)
ctx.qry.showmsg, 0);
break;
case DECORATION_REF_TAG:
- if (!peel_ref(deco->name, &peeled))
- is_annotated = !oidcmp(&commit->object.oid, &peeled);
+ if (!read_ref(deco->name, &oid_tag) && !peel_iterated_oid(&oid_tag, &peeled))
+ is_annotated = !oideq(&oid_tag, &peeled);
cgit_tag_link(buf, NULL, is_annotated ? "tag-annotated-deco" : "tag-deco", buf);
break;
case DECORATION_REF_REMOTE:
From 6dbbffe01533a91c79c4497c80f46af8e1581e25 Mon Sep 17 00:00:00 2001
From: Christian Hesse <mail@eworm.de>
Date: Tue, 18 May 2021 21:54:23 +0200
Subject: [PATCH] git: update to v2.31.1
Update to git version v2.31.1, no additional changes required.
Signed-off-by: Christian Hesse <mail@eworm.de>
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 11b437b..abc52bc 100644
--- a/Makefile
+++ b/Makefile
@@ -14,7 +14,7 @@ htmldir = $(docdir)
pdfdir = $(docdir)
mandir = $(prefix)/share/man
SHA1_HEADER = <openssl/sha.h>
-GIT_VER = 2.31.0
+GIT_VER = 2.31.1
GIT_URL = https://www.kernel.org/pub/software/scm/git/git-$(GIT_VER).tar.xz
INSTALL = install
COPYTREE = cp -r
From 5258c297ba6fb604ae1415fbc19a3fe42457e49e Mon Sep 17 00:00:00 2001
From: Christian Hesse <mail@eworm.de>
Date: Tue, 18 May 2021 22:49:13 +0200
Subject: [PATCH] git: update to v2.32.0
Update to git version v2.32.0, this requires changes for these
upstream commits:
* 47957485b3b731a7860e0554d2bd12c0dce1c75a
tree.h API: simplify read_tree_recursive() signature
Signed-off-by: Christian Hesse <mail@eworm.de>
---
Makefile | 2 +-
ui-blame.c | 9 +++------
ui-blob.c | 20 ++++++++------------
ui-plain.c | 7 +++----
ui-tree.c | 21 ++++++++-------------
5 files changed, 23 insertions(+), 36 deletions(-)
diff --git a/Makefile b/Makefile
index abc52bc..d13c5bd 100644
--- a/Makefile
+++ b/Makefile
@@ -14,7 +14,7 @@ htmldir = $(docdir)
pdfdir = $(docdir)
mandir = $(prefix)/share/man
SHA1_HEADER = <openssl/sha.h>
-GIT_VER = 2.31.1
+GIT_VER = 2.32.0
GIT_URL = https://www.kernel.org/pub/software/scm/git/git-$(GIT_VER).tar.xz
INSTALL = install
COPYTREE = cp -r
diff --git a/ui-blame.c b/ui-blame.c
index ec1d888..03136f7 100644
--- a/ui-blame.c
+++ b/ui-blame.c
@@ -221,8 +221,7 @@ cleanup:
}
static int walk_tree(const struct object_id *oid, struct strbuf *base,
- const char *pathname, unsigned mode, int stage,
- void *cbdata)
+ const char *pathname, unsigned mode, void *cbdata)
{
struct walk_tree_context *walk_tree_ctx = cbdata;
@@ -291,10 +290,8 @@ void cgit_print_blame(void)
walk_tree_ctx.match_baselen = (path_items.match) ?
basedir_len(path_items.match) : -1;
- read_tree_recursive(the_repository,
- repo_get_commit_tree(the_repository, commit),
- "", 0, 0,
- &paths, walk_tree, &walk_tree_ctx);
+ read_tree(the_repository, repo_get_commit_tree(the_repository, commit),
+ &paths, walk_tree, &walk_tree_ctx);
if (!walk_tree_ctx.state)
cgit_print_error_page(404, "Not found", "Not found");
else if (walk_tree_ctx.state == 2)
diff --git a/ui-blob.c b/ui-blob.c
index f76c641..c10ae42 100644
--- a/ui-blob.c
+++ b/ui-blob.c
@@ -19,7 +19,7 @@ struct walk_tree_context {
};
static int walk_tree(const struct object_id *oid, struct strbuf *base,
- const char *pathname, unsigned mode, int stage, void *cbdata)
+ const char *pathname, unsigned mode, void *cbdata)
{
struct walk_tree_context *walk_tree_ctx = cbdata;
@@ -56,9 +56,9 @@ int cgit_ref_path_exists(const char *path, const char *ref, int file_only)
goto done;
if (oid_object_info(the_repository, &oid, &size) != OBJ_COMMIT)
goto done;
- read_tree_recursive(the_repository,
- repo_get_commit_tree(the_repository, lookup_commit_reference(the_repository, &oid)),
- "", 0, 0, &paths, walk_tree, &walk_tree_ctx);
+ read_tree(the_repository,
+ repo_get_commit_tree(the_repository, lookup_commit_reference(the_repository, &oid)),
+ &paths, walk_tree, &walk_tree_ctx);
done:
free(path_items.match);
@@ -92,10 +92,8 @@ int cgit_print_file(char *path, const char *head, int file_only)
type = oid_object_info(the_repository, &oid, &size);
if (type == OBJ_COMMIT) {
commit = lookup_commit_reference(the_repository, &oid);
- read_tree_recursive(the_repository,
- repo_get_commit_tree(the_repository, commit),
- "", 0, 0, &paths, walk_tree,
- &walk_tree_ctx);
+ read_tree(the_repository, repo_get_commit_tree(the_repository, commit),
+ &paths, walk_tree, &walk_tree_ctx);
if (!walk_tree_ctx.found_path)
return -1;
type = oid_object_info(the_repository, &oid, &size);
@@ -151,10 +149,8 @@ void cgit_print_blob(const char *hex, char *path, const char *head, int file_onl
if ((!hex) && type == OBJ_COMMIT && path) {
commit = lookup_commit_reference(the_repository, &oid);
- read_tree_recursive(the_repository,
- repo_get_commit_tree(the_repository, commit),
- "", 0, 0, &paths, walk_tree,
- &walk_tree_ctx);
+ read_tree(the_repository, repo_get_commit_tree(the_repository, commit),
+ &paths, walk_tree, &walk_tree_ctx);
type = oid_object_info(the_repository, &oid, &size);
}
diff --git a/ui-plain.c b/ui-plain.c
index 001001c..65a205f 100644
--- a/ui-plain.c
+++ b/ui-plain.c
@@ -130,7 +130,7 @@ static void print_dir_tail(void)
}
static int walk_tree(const struct object_id *oid, struct strbuf *base,
- const char *pathname, unsigned mode, int stage, void *cbdata)
+ const char *pathname, unsigned mode, void *cbdata)
{
struct walk_tree_context *walk_tree_ctx = cbdata;
@@ -198,9 +198,8 @@ void cgit_print_plain(void)
}
else
walk_tree_ctx.match_baselen = basedir_len(path_items.match);
- read_tree_recursive(the_repository,
- repo_get_commit_tree(the_repository, commit),
- "", 0, 0, &paths, walk_tree, &walk_tree_ctx);
+ read_tree(the_repository, repo_get_commit_tree(the_repository, commit),
+ &paths, walk_tree, &walk_tree_ctx);
if (!walk_tree_ctx.match)
cgit_print_error_page(404, "Not found", "Not found");
else if (walk_tree_ctx.match == 2)
diff --git a/ui-tree.c b/ui-tree.c
index 1e4efb2..b61f6f5 100644
--- a/ui-tree.c
+++ b/ui-tree.c
@@ -139,8 +139,7 @@ struct single_tree_ctx {
};
static int single_tree_cb(const struct object_id *oid, struct strbuf *base,
- const char *pathname, unsigned mode, int stage,
- void *cbdata)
+ const char *pathname, unsigned mode, void *cbdata)
{
struct single_tree_ctx *ctx = cbdata;
@@ -185,8 +184,7 @@ static void write_tree_link(const struct object_id *oid, char *name,
tree_ctx.name = NULL;
tree_ctx.count = 0;
- read_tree_recursive(the_repository, tree, "", 0, 1,
- &paths, single_tree_cb, &tree_ctx);
+ read_tree(the_repository, tree, &paths, single_tree_cb, &tree_ctx);
if (tree_ctx.count != 1)
break;
@@ -199,7 +197,7 @@ static void write_tree_link(const struct object_id *oid, char *name,
}
static int ls_item(const struct object_id *oid, struct strbuf *base,
- const char *pathname, unsigned mode, int stage, void *cbdata)
+ const char *pathname, unsigned mode, void *cbdata)
{
struct walk_tree_context *walk_tree_ctx = cbdata;
char *name;
@@ -294,14 +292,13 @@ static void ls_tree(const struct object_id *oid, const char *path, struct walk_t
}
ls_head();
- read_tree_recursive(the_repository, tree, "", 0, 1,
- &paths, ls_item, walk_tree_ctx);
+ read_tree(the_repository, tree, &paths, ls_item, walk_tree_ctx);
ls_tail();
}
static int walk_tree(const struct object_id *oid, struct strbuf *base,
- const char *pathname, unsigned mode, int stage, void *cbdata)
+ const char *pathname, unsigned mode, void *cbdata)
{
struct walk_tree_context *walk_tree_ctx = cbdata;
@@ -326,7 +323,7 @@ static int walk_tree(const struct object_id *oid, struct strbuf *base,
return 0;
}
}
- ls_item(oid, base, pathname, mode, stage, walk_tree_ctx);
+ ls_item(oid, base, pathname, mode, walk_tree_ctx);
return 0;
}
@@ -374,10 +371,8 @@ void cgit_print_tree(const char *rev, char *path)
goto cleanup;
}
- read_tree_recursive(the_repository,
- repo_get_commit_tree(the_repository, commit),
- "", 0, 0,
- &paths, walk_tree, &walk_tree_ctx);
+ read_tree(the_repository, repo_get_commit_tree(the_repository, commit),
+ &paths, walk_tree, &walk_tree_ctx);
if (walk_tree_ctx.state == 1)
ls_tail();
else if (walk_tree_ctx.state == 2)
From 45eff406554f3ff31bdf7d54daae1da5635db72e Mon Sep 17 00:00:00 2001
From: Christian Hesse <mail@eworm.de>
Date: Sun, 8 Aug 2021 17:55:53 +0200
Subject: [PATCH] git: update to v2.33.0
Update to git version v2.33.0, no additional changes required.
Signed-off-by: Christian Hesse <mail@eworm.de>
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index d13c5bd..b030ff9 100644
--- a/Makefile
+++ b/Makefile
@@ -14,7 +14,7 @@ htmldir = $(docdir)
pdfdir = $(docdir)
mandir = $(prefix)/share/man
SHA1_HEADER = <openssl/sha.h>
-GIT_VER = 2.32.0
+GIT_VER = 2.33.0
GIT_URL = https://www.kernel.org/pub/software/scm/git/git-$(GIT_VER).tar.xz
INSTALL = install
COPYTREE = cp -r
From b8f2b675df61e3a4ff4db7073fe7142fc07e8b7a Mon Sep 17 00:00:00 2001
From: Christian Hesse <mail@eworm.de>
Date: Wed, 3 Nov 2021 15:32:17 +0100
Subject: [PATCH] git: update to v2.34.0
Update to git version v2.34.0, this requires changes for these
upstream commits:
* abf897bacd2d36b9dbd07c70b4a2f97a084704ee
string-list.[ch]: remove string_list_init() compatibility function
Signed-off-by: Christian Hesse <mail@eworm.de>
---
Makefile | 2 +-
cgit.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index b030ff9..9153a39 100644
--- a/Makefile
+++ b/Makefile
@@ -14,7 +14,7 @@ htmldir = $(docdir)
pdfdir = $(docdir)
mandir = $(prefix)/share/man
SHA1_HEADER = <openssl/sha.h>
-GIT_VER = 2.33.0
+GIT_VER = 2.34.0
GIT_URL = https://www.kernel.org/pub/software/scm/git/git-$(GIT_VER).tar.xz
INSTALL = install
COPYTREE = cp -r
diff --git a/cgit.c b/cgit.c
index 08d81a1..4b2d86c 100644
--- a/cgit.c
+++ b/cgit.c
@@ -428,7 +428,7 @@ static void prepare_context(void)
ctx.page.modified = time(NULL);
ctx.page.expires = ctx.page.modified;
ctx.page.etag = NULL;
- string_list_init(&ctx.cfg.mimetypes, 1);
+ string_list_init_dup(&ctx.cfg.mimetypes);
if (ctx.env.script_name)
ctx.cfg.script_name = xstrdup(ctx.env.script_name);
if (ctx.env.query_string)
From 11be5b8182fc71c00c1c00c693f64c97769d77bb Mon Sep 17 00:00:00 2001
From: Christian Hesse <mail@eworm.de>
Date: Wed, 24 Nov 2021 21:12:12 +0100
Subject: [PATCH] git: update to v2.34.1
Update to git version v2.34.1, no additional changes required.
Signed-off-by: Christian Hesse <mail@eworm.de>
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 9153a39..baa7c2d 100644
--- a/Makefile
+++ b/Makefile
@@ -14,7 +14,7 @@ htmldir = $(docdir)
pdfdir = $(docdir)
mandir = $(prefix)/share/man
SHA1_HEADER = <openssl/sha.h>
-GIT_VER = 2.34.0
+GIT_VER = 2.34.1
GIT_URL = https://www.kernel.org/pub/software/scm/git/git-$(GIT_VER).tar.xz
INSTALL = install
COPYTREE = cp -r