From sgothel at jausoft.com Thu Jun 4 11:44:38 2026 From: sgothel at jausoft.com (=?UTF-8?Q?Sven_G=C3=B6thel?=) Date: Thu, 4 Jun 2026 13:44:38 +0200 Subject: patch: cgit_add_repo_with_default_branch Message-ID: <0c1057b8-c68b-454f-99d4-390412419328@jausoft.com> patch: cgit_add_repo_with_default_branch - - and attached Currently, if defbranch is not `master` and no manual config performed, repo age is undefined. This patch reads the default branch from git HEAD if not configured via cgitrc and uses it in all commands like repo-list age, selected at log etc. add_repo is called from scan_path early when gathering and caching server repositories. ~Sven -------------- next part -------------- From 5ccffc927460e651da10a6b0be2e9786129355bb Mon Sep 17 00:00:00 2001 From: Sven G?thel Date: Sat, 30 May 2026 00:56:55 +0200 Subject: cgit: add_repo: Assign default branch from git HEAD to repo->defbranch if undefined MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently, if defbranch is not `master` and no manual config performed, repo age is undefined. This patch reads the default branch from git HEAD if not configured via cgitrc and uses it in all commands like repo-list age, selected at log etc. add_repo is called from scan_path early when gathering and caching server repositories. Signed-off-by: Sven G?thel diff --git a/scan-tree.c b/scan-tree.c index c120efe..b701d00 100644 --- a/scan-tree.c +++ b/scan-tree.c @@ -79,6 +79,32 @@ static char *xstrrchr(char *s, char *from, int c) return from < s ? NULL : from; } +static char *read_git_head_branch(const char *repo_path) { + struct strbuf path = STRBUF_INIT; + size_t size; + char *line = NULL; + + strbuf_addf(&path, "%s/HEAD", repo_path); + + if (read_first_line(path.buf, &line, &size)) { + strbuf_release(&path); + free(line); + return NULL; + } + strbuf_release(&path); + + const char *refname; + char *result = NULL; + + if (!line || !skip_prefix(line, "ref: refs/heads/", &refname)) { + free(line); + return NULL; + } + result = xstrdup(refname); + free(line); + return result; +} + static void add_repo(const char *base, struct strbuf *path) { struct stat st; @@ -180,6 +206,9 @@ static void add_repo(const char *base, struct strbuf *path) if (!stat(path->buf, &st)) parse_configfile(path->buf, &scan_tree_repo_config); + if (!repo->defbranch) + repo->defbranch = read_git_head_branch(repo->path); + strbuf_release(&rel); } -------------- next part -------------- A non-text attachment was scrubbed... Name: OpenPGP_signature.asc Type: application/pgp-signature Size: 833 bytes Desc: OpenPGP digital signature URL: From sgothel at jausoft.com Thu Jun 4 11:46:41 2026 From: sgothel at jausoft.com (=?UTF-8?Q?Sven_G=C3=B6thel?=) Date: Thu, 4 Jun 2026 13:46:41 +0200 Subject: patch: cgit_sendfile_timeout Message-ID: patch: cgit_sendfile_timeout - - and attached cgit: print_slot: Avoid Slow-Attack via `client-io-idle-timeout` and `client-io-min-rate` default `cgitrc` configurable values - `client-io-idle-timeout`: 20s - `client-io-min-rate`: 500 Bps - Note GSM 2G -- 9.6Kbps or ~1200 Bps maximum return ETIMEDOUT if either - idle time from last successfull sendfile/write > `client-io-idle-timeout` - total time spend exceeds max(`client-io-idle-timeout`, size/`client-io-min-rate`) seconds In case of timeout, the event will be logged with REMOTE_ADDR, a potential bad actor if repetitive. Further adds `cgitrc` config value `log-level`, enabling verbose logging if set above zero. ~Sven -------------- next part -------------- From 0e4062841fa929737aad751d279df8ded493cd6b Mon Sep 17 00:00:00 2001 From: Sven G?thel Date: Tue, 2 Jun 2026 04:15:57 +0200 Subject: cgit: print_slot: Avoid Slow-Attack via `client-io-idle-timeout` and `client-io-min-rate` default `cgitrc` configurable values - `client-io-idle-timeout`: 20s - `client-io-min-rate`: 500 Bps - Note GSM 2G -- 9.6Kbps or ~1200 Bps maximum return ETIMEDOUT if either - idle time from last successfull sendfile/write > `client-io-idle-timeout` - total time spend exceeds max(`client-io-idle-timeout`, size/`client-io-min-rate`) seconds In case of timeout, the event will be logged with REMOTE_ADDR, a potential bad actor if repetitive. Further adds `cgitrc` config value `log-level`, enabling verbose logging if set above zero. diff --git a/cache.c b/cache.c index e70af13..28e7180 100644 --- a/cache.c +++ b/cache.c @@ -82,32 +82,145 @@ static int close_slot(struct cache_slot *slot) return err; } +#define MY_MIN(X, Y) (((X) < (Y)) ? (X) : (Y)) +#define MY_MAX(X, Y) (((X) > (Y)) ? (X) : (Y)) + +static int sendslot_to_idle(time_t tStart, time_t tLastSend, time_t tNow, + size_t off, size_t size, const char *cache_name) +{ + const time_t td_total = tNow - tStart; + const time_t td_idle = tNow - tLastSend; + const long rate = off / MY_MAX(1, td_total); + cache_log("[cgit] send_slot timeout idle %lds: sending cache " + "%s (%ld/%ld bytes) to client `%s` " + "within [total %lds, idle %lds, rate %ld Bps]\n", + td_idle, cache_name, off, size, ctx.env.remote_addr, + td_total, td_idle, rate); + return ETIMEDOUT; +} + +static int sendslot_to_minrate(time_t tStart, time_t tNow, size_t off, + size_t size, const char *cache_name) +{ + const time_t td_total = tNow - tStart; + const long rate = off / MY_MAX(1, td_total); + cache_log("[cgit] send_slot timeout rate-limit %ld Bps: sending " + "cache %s (%ld/%ld bytes) to client `%s` " + "within [total %lds, rate %ld Bps]\n", + ctx.cfg.client_io_min_rate, cache_name, off, size, ctx.env.remote_addr, + td_total, rate); + return ETIMEDOUT; +} + +static int sendslot_ok(time_t tStart, time_t tNow, size_t size, + const char *cache_name) +{ + if (ctx.cfg.log_level > 90) { + const time_t td_total = tNow - tStart; + const long rate = size / MY_MAX(1, td_total); + cache_log("[cgit] send_slot status: sent cache %s (%ld bytes) to " + "client `%s` " + "within [total %lds, rate %ld Bps]\n", + cache_name, size, ctx.env.remote_addr, td_total, rate); + } + return 0; +} + +static int sendslot_ok2(time_t tStart, size_t size, const char *cache_name) +{ + if (ctx.cfg.log_level > 90) { + return sendslot_ok(tStart, time(NULL), size, cache_name); + } + return 0; +} + +static ssize_t write_in_full_to(int fd, const void *buf, size_t count, off_t *total_out, + time_t tStart, time_t *tLastSend, time_t to_max) +{ + if (!count) { + return 0; + } + const char *p = buf; + ssize_t total = 0; + time_t tNow = *tLastSend; + + do { + if (tNow - *tLastSend >= ctx.cfg.client_io_idle_timeout) { + errno = ETIMEDOUT; + return -2; + } + if (tNow - tStart > to_max) { + errno = ETIMEDOUT; + return -3; + } + + ssize_t written = write(fd, p, MY_MIN(count, MAX_IO_SIZE)); + tNow = time(NULL); + if (written < 0) { + if (errno == EINTR) + continue; + if (errno == EAGAIN || errno == EWOULDBLOCK) { + struct pollfd pfd; + pfd.fd = fd; + pfd.events = POLLOUT; + // no need to check for errors, + // subsequent read/write will detect unrecoverable errors + poll(&pfd, 1, -1); + continue; + } + return -1; + } else if (written > 0) { + *total_out += written; + count -= written; + p += written; + total += written; + *tLastSend = tNow; + if (!count) + return total; + } + } while (1); +} + /* Print the content of the active cache slot (but skip the key). */ static int print_slot(struct cache_slot *slot) { - off_t off; -#ifdef HAVE_LINUX_SENDFILE - off_t size; -#endif + time_t tStart = time(NULL); + time_t tLastSend = tStart; + time_t tNow = tStart; - off = slot->keylen + 1; + off_t off = slot->keylen + 1; + off_t size = slot->cache_st.st_size; -#ifdef HAVE_LINUX_SENDFILE - size = slot->cache_st.st_size; + if (!size) { + return sendslot_ok(tStart, tNow, size, slot->cache_name); + } + const time_t to_min_rate = + MY_MAX(ctx.cfg.client_io_idle_timeout, size / ctx.cfg.client_io_min_rate); +#ifdef HAVE_LINUX_SENDFILE do { - ssize_t ret; - ret = sendfile(STDOUT_FILENO, slot->cache_fd, &off, size - off); - if (ret < 0) { + if (tNow - tLastSend >= ctx.cfg.client_io_idle_timeout) + return sendslot_to_idle(tStart, tLastSend, tNow, + off, size, slot->cache_name); + if (tNow - tStart > to_min_rate) + return sendslot_to_minrate(tStart, tNow, + off, size, slot->cache_name); + + ssize_t count = + sendfile(STDOUT_FILENO, slot->cache_fd, &off, size - off); + tNow = time(NULL); + if (count < 0) { if (errno == EAGAIN || errno == EINTR) continue; /* Fall back to read/write on EINVAL or ENOSYS */ if (errno == EINVAL || errno == ENOSYS) break; return errno; + } else if (count > 0) { + tLastSend = tNow; + if (off == size) + return sendslot_ok(tStart, tNow, size, slot->cache_name); } - if (off == size) - return 0; } while (1); #endif @@ -115,14 +228,26 @@ static int print_slot(struct cache_slot *slot) return errno; do { - ssize_t ret; - ret = xread(slot->cache_fd, slot->buf, sizeof(slot->buf)); - if (ret < 0) + ssize_t count = xread(slot->cache_fd, slot->buf, sizeof(slot->buf)); + if (count < 0) return errno; - if (ret == 0) - return 0; - if (write_in_full(STDOUT_FILENO, slot->buf, ret) < 0) + + ssize_t res; + if ((res = write_in_full_to(STDOUT_FILENO, slot->buf, count, &off, + tStart, &tLastSend, to_min_rate)) < 0) + { + if (ETIMEDOUT == errno) { + if (-2 == res) + return sendslot_to_idle(tStart, tLastSend, time(NULL), + off, size, slot->cache_name); + else if (-3 == res) + return sendslot_to_minrate(tStart, time(NULL), + off, size, slot->cache_name); + } return errno; + } + if (off == size || !count /* should be redundant */) + return sendslot_ok2(tStart, size, slot->cache_name); } while (1); } diff --git a/cgit.c b/cgit.c index ca318e8..26b4045 100644 --- a/cgit.c +++ b/cgit.c @@ -129,7 +129,9 @@ static void config_cb(const char *name, const char *value) { const char *arg; - if (!strcmp(name, "section")) + if (!strcmp(name, "log-level")) + ctx.cfg.log_level = atoi(value); + else if (!strcmp(name, "section")) ctx.cfg.section = strdup_first_line(value); else if (!strcmp(name, "repo.url")) ctx.repo = cgit_add_repo(value); @@ -215,6 +217,10 @@ static void config_cb(const char *name, const char *value) ctx.cfg.cache_scanrc_ttl = atoi(value); else if (!strcmp(name, "cache-static-ttl")) ctx.cfg.cache_static_ttl = atoi(value); + else if (!strcmp(name, "client-io-idle-timeout")) + ctx.cfg.client_io_idle_timeout = atoi(value); + else if (!strcmp(name, "client-io-min-rate")) + ctx.cfg.client_io_min_rate = atol(value); else if (!strcmp(name, "cache-dynamic-ttl")) ctx.cfg.cache_dynamic_ttl = atoi(value); else if (!strcmp(name, "cache-about-ttl")) @@ -251,15 +257,16 @@ static void config_cb(const char *name, const char *value) ctx.cfg.max_commit_count = atoi(value); else if (!strcmp(name, "project-list")) ctx.cfg.project_list = strdup_first_line(expand_macros(value)); - else if (!strcmp(name, "scan-path")) + else if (!strcmp(name, "scan-path")) { + ctx.cfg.scan_path = strdup_first_line(expand_macros(value)); if (ctx.cfg.cache_size) - process_cached_repolist(expand_macros(value)); + process_cached_repolist(ctx.cfg.scan_path); else if (ctx.cfg.project_list) - scan_projects(expand_macros(value), + scan_projects(ctx.cfg.scan_path, ctx.cfg.project_list); else - scan_tree(expand_macros(value)); - else if (!strcmp(name, "scan-hidden-path")) + scan_tree(ctx.cfg.scan_path); + } else if (!strcmp(name, "scan-hidden-path")) ctx.cfg.scan_hidden_path = atoi(value); else if (!strcmp(name, "section-from-path")) ctx.cfg.section_from_path = atoi(value); @@ -381,6 +388,8 @@ static void prepare_context(void) ctx.cfg.cache_scanrc_ttl = 15; ctx.cfg.cache_dynamic_ttl = 5; ctx.cfg.cache_static_ttl = -1; + ctx.cfg.client_io_idle_timeout = 20; + ctx.cfg.client_io_min_rate = 500; ctx.cfg.case_sensitive_sort = 1; ctx.cfg.branch_sort = 0; ctx.cfg.commit_sort = 0; @@ -426,6 +435,7 @@ static void prepare_context(void) ctx.env.server_port = getenv("SERVER_PORT"); ctx.env.http_cookie = getenv("HTTP_COOKIE"); ctx.env.http_referer = getenv("HTTP_REFERER"); + ctx.env.remote_addr = getenv("REMOTE_ADDR"); ctx.env.content_length = getenv("CONTENT_LENGTH") ? strtoul(getenv("CONTENT_LENGTH"), NULL, 10) : 0; ctx.env.authenticated = 0; ctx.page.mimetype = "text/html"; @@ -871,6 +881,15 @@ static void print_repolist(FILE *f, struct cgit_repolist *list, int start) for (i = start; i < list->count; i++) print_repo(f, &list->repos[i]); } +static void print_config(FILE *f, const char *prefix) +{ + // TODO: May need to be completed, if desired to be functional + fprintf(f, "%slog-level=%d\n", prefix, ctx.cfg.log_level); + fprintf(f, "%sproject-list=%s\n", prefix, ctx.cfg.project_list); + fprintf(f, "%sscan-path=%s\n", prefix, ctx.cfg.scan_path); + fprintf(f, "%sclient-io-idle-timeout=%d\n", prefix, ctx.cfg.client_io_idle_timeout); + fprintf(f, "%sclient-io-min-rate=%ld\n", prefix, ctx.cfg.client_io_min_rate); +} /* Scan 'path' for git repositories, save the resulting repolist in 'cached_rc' * and return 0 on success. @@ -1009,12 +1028,14 @@ static void cgit_parse_args(int argc, const char **argv) * NOTE: We assume that there aren't more than 8 * different snapshot formats supported by cgit... */ + ctx.cfg.scan_path = strdup_first_line(arg); ctx.cfg.snapshots = 0xFF; scan++; scan_tree(arg); } } if (scan) { + print_config(stdout, "[cgit] scan: "); qsort(cgit_repolist.repos, cgit_repolist.count, sizeof(struct cgit_repo), cmp_repos); print_repolist(stdout, &cgit_repolist, 0); @@ -1067,6 +1088,8 @@ int cmd_main(int argc, const char **argv) cgit_parse_args(argc, argv); parse_configfile(expand_macros(ctx.env.cgit_config), config_cb); + if (ctx.cfg.log_level) + print_config(stderr, "[cgit] init: "); ctx.repo = NULL; http_parse_querystring(ctx.qry.raw, querystring_cb); diff --git a/cgit.h b/cgit.h index 7d7ece7..f16e501 100644 --- a/cgit.h +++ b/cgit.h @@ -194,6 +194,7 @@ struct cgit_query { }; struct cgit_config { + int log_level; ///< defaults to zero char *agefile; char *cache_root; char *clone_prefix; @@ -207,6 +208,7 @@ struct cgit_config { char *mimetype_file; char *module_link; char *project_list; + char *scan_path; struct string_list readme; struct string_list css; char *robots; @@ -227,6 +229,10 @@ struct cgit_config { int cache_static_ttl; int cache_about_ttl; int cache_snapshot_ttl; + /* idle timeout in seconds between sending/receiving chunks of the cached body to/from the client. Defaults to 20s. */ + int client_io_idle_timeout; + /* minimum transfer rate in Bps for sending/receiving a full cached body to/from the client. Defaults to 500 Bps. */ + long client_io_min_rate; int case_sensitive_sort; int embedded; int enable_filter_overrides; @@ -302,6 +308,7 @@ struct cgit_environment { const char *server_port; const char *http_cookie; const char *http_referer; + const char *remote_addr; unsigned int content_length; int authenticated; }; diff --git a/cgitrc.5.txt b/cgitrc.5.txt index 7c39bf9..a6016ee 100644 --- a/cgitrc.5.txt +++ b/cgitrc.5.txt @@ -100,6 +100,14 @@ cache-static-ttl:: version of repository pages accessed with a fixed SHA1. See also: "CACHE". Default value: -1". +client-io-idle-timeout:: + IDLE timeout in seconds between sending/receiving chunks + of the cached body to/from the client. Default value: "20". + +client-io-min-rate:: + Minimum transfer rate in Bps for sending/receiving a full cached + body to/from the client. Default value "500". + clone-prefix:: Space-separated list of common prefixes which, when combined with a repository url, generates valid clone urls for the repository. This @@ -456,6 +464,9 @@ virtual-root:: NOTE: cgit has recently learned how to use PATH_INFO to achieve the same kind of virtual urls, so this option will probably be deprecated. +log-level:: + Specifies the logging level. Above zero adds verbose logging. + Default value: "0". REPOSITORY SETTINGS ------------------- -------------- next part -------------- A non-text attachment was scrubbed... Name: OpenPGP_signature.asc Type: application/pgp-signature Size: 833 bytes Desc: OpenPGP digital signature URL: From sgothel at jausoft.com Sat Jun 6 16:21:27 2026 From: sgothel at jausoft.com (=?UTF-8?Q?Sven_G=C3=B6thel?=) Date: Sat, 6 Jun 2026 18:21:27 +0200 Subject: patch: cgit_sendfile_timeout In-Reply-To: References: Message-ID: <405a903e-85fa-4abb-a289-c92105159f98@jausoft.com> My setup is apache2 -> cgit via suexec. After having this patch live for 1.5 days, it caught ~1500 (jausoft) and ~500 (jogamp) idle timeouts. No more slow resource churning cgit instances clogging the server. Cheers ~Sven From list at eworm.de Wed Jun 17 19:51:31 2026 From: list at eworm.de (Christian Hesse) Date: Wed, 17 Jun 2026 21:51:31 +0200 Subject: [PATCH 1/1] RFC: git: update to v2.55.0-rc1 Message-ID: <20260617195131.67459-1-list@eworm.de> From: Christian Hesse Update to git version v2.55.0-rc1, this requires a change for this upstream commit: * a80a8e3ea6a070185840219778df24db832899f6 setup: stop using `the_repository` in `setup_git_directory_gently()` Signed-off-by: Christian Hesse --- Makefile | 4 ++-- cgit.c | 2 +- git | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 9d39bf4..a14477a 100644 --- a/Makefile +++ b/Makefile @@ -14,8 +14,8 @@ htmldir = $(docdir) pdfdir = $(docdir) mandir = $(prefix)/share/man SHA1_HEADER = -GIT_VER = 2.54.0 -GIT_URL = https://www.kernel.org/pub/software/scm/git/git-$(GIT_VER).tar.xz +GIT_VER = 2.55.0.rc1 +GIT_URL = https://www.kernel.org/pub/software/scm/git/testing/git-$(GIT_VER).tar.xz INSTALL = install COPYTREE = cp -r MAN5_TXT = $(wildcard *.5.txt) diff --git a/cgit.c b/cgit.c index 2efbb2c..fc3932c 100644 --- a/cgit.c +++ b/cgit.c @@ -588,7 +588,7 @@ static void prepare_repo_env(int *nongit) /* Setup the git directory and initialize the notes system. Both of these * load local configuration from the git repository, so we do them both while * the HOME variables are unset. */ - setup_git_directory_gently(nongit); + setup_git_directory_gently(the_repository, nongit); load_display_notes(NULL); } diff --git a/git b/git index 94f0577..4621f8c 160000 --- a/git +++ b/git @@ -1 +1 @@ -Subproject commit 94f057755b7941b321fd11fec1b2e3ca5313a4e0 +Subproject commit 4621f8ce5e9b97aa2e8d0d9ffe9d25df2471074d From tg at trevorgross.com Sun Jun 21 05:25:24 2026 From: tg at trevorgross.com (Trevor Gross) Date: Sun, 21 Jun 2026 05:25:24 +0000 Subject: Feature request: easy way to get a permalink Message-ID: <114d1b9e3986a6e1cd584643c6a64348@trevorgross.com> Hello all, It's pretty useful to be able to share a link to a source view that doesn't get outdated if the source updates. cgit supports these links but it requires a few steps to create them. Would it be possible to add a button that makes this easier? For example, when visiting this URL: https://git.zx2c4.com/cgit/tree/README#n4 There could be a `permalink` button in the `path: root/README` bar (or perhaps next to `(plain) (blame)`) that replaces the URL with: https://git.zx2c4.com/cgit/tree/README?id=044821677c774cd24f25f1818ea51d09cc64b006#n4 04482167 being the most recent commit. This should work for directories in the tree view as well, though the `path:` bar is not visible at root. GitHub and GitLab have something similar under the triple dots menu, which also copies the link to the clipboard. Kind regards, Trevor From sternenseemann at systemli.org Mon Jun 22 12:48:22 2026 From: sternenseemann at systemli.org (sternenseemann) Date: Mon, 22 Jun 2026 14:48:22 +0200 Subject: Feature request: easy way to get a permalink In-Reply-To: <114d1b9e3986a6e1cd584643c6a64348@trevorgross.com> References: <114d1b9e3986a6e1cd584643c6a64348@trevorgross.com> Message-ID: On 6/21/26 07:25, Trevor Gross wrote: > It's pretty useful to be able to share a link to a source view that > doesn't get outdated if the source updates. cgit supports these links > but it requires a few steps to create them. Would it be possible to add > a button that makes this easier? The ?this commit? patch by Alyssa Ross achieves this (and works in other situations, too), though it's not quite the same user interface as the permalink button e.g. GitHub uses. Message-ID: <20260521121749.4195-2-hi at alyssa.is> Link: https://lists.zx2c4.com/pipermail/cgit/2026-May/004996.html From list at eworm.de Tue Jun 23 16:45:11 2026 From: list at eworm.de (Christian Hesse) Date: Tue, 23 Jun 2026 18:45:11 +0200 Subject: [PATCH 1/1] RFC: git: update to v2.55.0-rc2 In-Reply-To: <20260617195131.67459-1-list@eworm.de> References: <20260617195131.67459-1-list@eworm.de> Message-ID: <20260623164511.434252-1-list@eworm.de> From: Christian Hesse Update to git version v2.55.0-rc2, this requires a change for this upstream commit: * a80a8e3ea6a070185840219778df24db832899f6 setup: stop using `the_repository` in `setup_git_directory_gently()` Signed-off-by: Christian Hesse --- Makefile | 4 ++-- cgit.c | 2 +- git | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 9d39bf4..7a85ebb 100644 --- a/Makefile +++ b/Makefile @@ -14,8 +14,8 @@ htmldir = $(docdir) pdfdir = $(docdir) mandir = $(prefix)/share/man SHA1_HEADER = -GIT_VER = 2.54.0 -GIT_URL = https://www.kernel.org/pub/software/scm/git/git-$(GIT_VER).tar.xz +GIT_VER = 2.55.0.rc2 +GIT_URL = https://www.kernel.org/pub/software/scm/git/testing/git-$(GIT_VER).tar.xz INSTALL = install COPYTREE = cp -r MAN5_TXT = $(wildcard *.5.txt) diff --git a/cgit.c b/cgit.c index ca318e8..3b9d3aa 100644 --- a/cgit.c +++ b/cgit.c @@ -588,7 +588,7 @@ static void prepare_repo_env(int *nongit) /* Setup the git directory and initialize the notes system. Both of these * load local configuration from the git repository, so we do them both while * the HOME variables are unset. */ - setup_git_directory_gently(nongit); + setup_git_directory_gently(the_repository, nongit); load_display_notes(NULL); } diff --git a/git b/git index 94f0577..ab776a6 160000 --- a/git +++ b/git @@ -1 +1 @@ -Subproject commit 94f057755b7941b321fd11fec1b2e3ca5313a4e0 +Subproject commit ab776a62a78576513ee121424adb19597fbb7613 From list at eworm.de Tue Jun 30 10:24:45 2026 From: list at eworm.de (Christian Hesse) Date: Tue, 30 Jun 2026 12:24:45 +0200 Subject: [PATCH 1/1] git: update to v2.55.0 Message-ID: <20260630102445.107204-1-list@eworm.de> From: Christian Hesse Update to git version v2.55.0, this requires a change for this upstream commit: * a80a8e3ea6a070185840219778df24db832899f6 setup: stop using `the_repository` in `setup_git_directory_gently()` Signed-off-by: Christian Hesse --- Makefile | 2 +- cgit.c | 2 +- git | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 9d39bf4..d039293 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ htmldir = $(docdir) pdfdir = $(docdir) mandir = $(prefix)/share/man SHA1_HEADER = -GIT_VER = 2.54.0 +GIT_VER = 2.55.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 ca318e8..3b9d3aa 100644 --- a/cgit.c +++ b/cgit.c @@ -588,7 +588,7 @@ static void prepare_repo_env(int *nongit) /* Setup the git directory and initialize the notes system. Both of these * load local configuration from the git repository, so we do them both while * the HOME variables are unset. */ - setup_git_directory_gently(nongit); + setup_git_directory_gently(the_repository, nongit); load_display_notes(NULL); } diff --git a/git b/git index 94f0577..e9019fc 160000 --- a/git +++ b/git @@ -1 +1 @@ -Subproject commit 94f057755b7941b321fd11fec1b2e3ca5313a4e0 +Subproject commit e9019fcafe0040228b8631c30f97ae1adb61bcdc From list at eworm.de Tue Jun 30 10:33:08 2026 From: list at eworm.de (Christian Hesse) Date: Tue, 30 Jun 2026 12:33:08 +0200 Subject: [PATCH 1/1] git: update to v2.55.0 In-Reply-To: <20260630102445.107204-1-list@eworm.de> References: <20260630102445.107204-1-list@eworm.de> Message-ID: <20260630123308.3525b712@leda.eworm.net> Christian Hesse on Tue, 2026/06/30 12:24: > Update to git version v2.55.0, this requires a change for this > upstream commit: > > * a80a8e3ea6a070185840219778df24db832899f6 > setup: stop using `the_repository` in `setup_git_directory_gently()` Uh, tests are failing... Not sure why I did not notice earlier. I think this is caused by upstream changes to `t/test-lib.sh` - but not sure, will have to investigate later. -- main(a){char*c=/* Schoene Gruesse */"B?IJj;MEH" "CX:;",b;for(a/* Best regards my address: */=0;b=c[a++];) putchar(b-1/(/* Chris cc -ox -xc - && ./x */b/42*2-3)*42);} -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 488 bytes Desc: OpenPGP digital signature URL: From list at eworm.de Tue Jun 30 10:39:25 2026 From: list at eworm.de (Christian Hesse) Date: Tue, 30 Jun 2026 12:39:25 +0200 Subject: [PATCH v2 1/1] git: update to v2.55.0 In-Reply-To: <20260630102445.107204-1-list@eworm.de> References: <20260630102445.107204-1-list@eworm.de> Message-ID: <20260630103936.147107-1-list@eworm.de> From: Christian Hesse Update to git version v2.55.0, this requires a change for this upstream commit: * a80a8e3ea6a070185840219778df24db832899f6 setup: stop using `the_repository` in `setup_git_directory_gently()` * ffe8005b9d8e0cf1b5d5d796ca4da76fbe219011 t: detect errors outside of test cases Signed-off-by: Christian Hesse --- Makefile | 2 +- cgit.c | 2 +- git | 2 +- tests/setup.sh | 1 + 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 9d39bf4..d039293 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ htmldir = $(docdir) pdfdir = $(docdir) mandir = $(prefix)/share/man SHA1_HEADER = -GIT_VER = 2.54.0 +GIT_VER = 2.55.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 ca318e8..3b9d3aa 100644 --- a/cgit.c +++ b/cgit.c @@ -588,7 +588,7 @@ static void prepare_repo_env(int *nongit) /* Setup the git directory and initialize the notes system. Both of these * load local configuration from the git repository, so we do them both while * the HOME variables are unset. */ - setup_git_directory_gently(nongit); + setup_git_directory_gently(the_repository, nongit); load_display_notes(NULL); } diff --git a/git b/git index 94f0577..e9019fc 160000 --- a/git +++ b/git @@ -1 +1 @@ -Subproject commit 94f057755b7941b321fd11fec1b2e3ca5313a4e0 +Subproject commit e9019fcafe0040228b8631c30f97ae1adb61bcdc diff --git a/tests/setup.sh b/tests/setup.sh index 8db810f..f1beef9 100755 --- a/tests/setup.sh +++ b/tests/setup.sh @@ -45,6 +45,7 @@ IFS=$OLDIFS : ${TEST_DIRECTORY=$(pwd)/../git/t} : ${TEST_OUTPUT_DIRECTORY=$(pwd)} TEST_NO_CREATE_REPO=YesPlease +GIT_TEST_USE_SET_E=false . "$TEST_DIRECTORY"/test-lib.sh # Prepend the directory containing cgit to PATH. From list at eworm.de Tue Jun 30 10:41:20 2026 From: list at eworm.de (Christian Hesse) Date: Tue, 30 Jun 2026 12:41:20 +0200 Subject: [PATCH 1/1] git: update to v2.55.0 In-Reply-To: <20260630123308.3525b712@leda.eworm.net> References: <20260630102445.107204-1-list@eworm.de> <20260630123308.3525b712@leda.eworm.net> Message-ID: <20260630124120.143d371d@leda.eworm.net> Christian Hesse on Tue, 2026/06/30 12:33: > Christian Hesse on Tue, 2026/06/30 12:24: > > Update to git version v2.55.0, this requires a change for this > > upstream commit: > > > > * a80a8e3ea6a070185840219778df24db832899f6 > > setup: stop using `the_repository` in `setup_git_directory_gently()` > > Uh, tests are failing... Not sure why I did not notice earlier. I think this > is caused by upstream changes to `t/test-lib.sh` - but not sure, will have > to investigate later. This can be worked around by setting GIT_TEST_USE_SET_E=false ... Sending a v2 of the patch. But I guess this is something to be fixed properly. -- main(a){char*c=/* Schoene Gruesse */"B?IJj;MEH" "CX:;",b;for(a/* Best regards my address: */=0;b=c[a++];) putchar(b-1/(/* Chris cc -ox -xc - && ./x */b/42*2-3)*42);} -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 488 bytes Desc: OpenPGP digital signature URL: