From aiden at aidenw.net Fri Apr 3 03:27:20 2026 From: aiden at aidenw.net (Aiden Woodruff) Date: Thu, 2 Apr 2026 23:27:20 -0400 Subject: [PATCH] replace memrchr with strrchr Message-ID: <20260403032740.93724-1-aiden@aidenw.net> - ui-shared.c (cgit_set_title_from_path): remove memrchr which is less widely available (e.g. it is missing on macOS) and replace with an implementation that copies the path and uses strrchr. Signed-off-by: Aiden Woodruff --- I tested locally and the chevrons are correctly retained in the title along with the path components. Although memrchr is in glibc, it is not available everywhere and this patch was necessary for building on my system. --- ui-shared.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/ui-shared.c b/ui-shared.c index 219b830..a60b0a8 100644 --- a/ui-shared.c +++ b/ui-shared.c @@ -1244,17 +1244,19 @@ void cgit_print_snapshot_links(const struct cgit_repo *repo, const char *ref, void cgit_set_title_from_path(const char *path) { - struct strbuf sb = STRBUF_INIT; - const char *slash, *last_slash; - if (!path) return; - for (last_slash = path + strlen(path); (slash = memrchr(path, '/', last_slash - path)) != NULL; last_slash = slash) { + struct strbuf sb = STRBUF_INIT; + char *slash, *last_slash, *path_copy = xstrdup(path); + + for (last_slash = path_copy + strlen(path_copy); (slash = strrchr(path_copy, '/')) != NULL; last_slash = slash) { strbuf_add(&sb, slash + 1, last_slash - slash - 1); strbuf_addstr(&sb, " \xc2\xab "); + *slash = '\0'; } - strbuf_add(&sb, path, last_slash - path); + strbuf_add(&sb, path_copy, last_slash - path_copy); strbuf_addf(&sb, " - %s", ctx.page.title); ctx.page.title = strbuf_detach(&sb, NULL); + free(path_copy); } -- 2.50.1 (Apple Git-155) From aiden at aidenw.net Sun Apr 5 02:25:17 2026 From: aiden at aidenw.net (Aiden Woodruff) Date: Sat, 4 Apr 2026 22:25:17 -0400 Subject: Follow up for mobile responsiveness patch series Message-ID: Hi Rito, As a user of cgit, I like most of the current mobile experience. I do not see what is wrong with the "panzooming dance". The current summary layout shows everything at a glance, and then I zoom in where I want. However, the layout does suffer when the main content (summary rows or code) overflows the width. In those cases it is in my opinion a clear visibility improvement to scroll horizontally. In general, I do not think any content (especially controls like the search bar) should be hidden from view. It might not be immediately clear that there are elements off-screen. To fix only the main content overflow issue, the following simpler, CSS-only patch would suffice. But it is worth mentioning that CSS can easily be customized in any installation. --- cgit.css | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cgit.css b/cgit.css index a37defe..118e75c 100644 --- a/cgit.css +++ b/cgit.css @@ -117,6 +117,9 @@ div#cgit div.content { margin: 0px; padding: 2em; border-bottom: solid 3px #ccc; + overflow-x: auto; + max-width: 100%; + -webkit-overflow-scrolling: touch; } -- Aiden Woodruff -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 265 bytes Desc: not available URL: From list at eworm.de Mon Apr 13 07:30:04 2026 From: list at eworm.de (Christian Hesse) Date: Mon, 13 Apr 2026 09:30:04 +0200 Subject: [PATCH 1/1] RFC: git: update to v2.54.0-rc1 Message-ID: <20260413073004.69983-1-list@eworm.de> From: Christian Hesse Update to git version v2.54.0-rc1, this requires changes for these upstream commits: * d9ecf268ef3f69130fa269012318470d908978f6 odb: embed base source in the "files" backend * cb506a8a69c953f7b87bb3ae099e0bed8218d3ab odb: introduce "files" source ... and probably more related. Signed-off-by: Christian Hesse --- Makefile | 4 ++-- git | 2 +- ui-clone.c | 24 ++++++++++++++---------- 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index 16bfc55..e1db470 100644 --- a/Makefile +++ b/Makefile @@ -14,8 +14,8 @@ htmldir = $(docdir) pdfdir = $(docdir) mandir = $(prefix)/share/man SHA1_HEADER = -GIT_VER = 2.53.0 -GIT_URL = https://www.kernel.org/pub/software/scm/git/git-$(GIT_VER).tar.xz +GIT_VER = 2.54.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/git b/git index 67ad421..2b39a27 160000 --- a/git +++ b/git @@ -1 +1 @@ -Subproject commit 67ad42147a7acc2af6074753ebd03d904476118f +Subproject commit 2b39a27d40682c09ac1c031f099ee602061597cd diff --git a/ui-clone.c b/ui-clone.c index 5a1fab3..e11f496 100644 --- a/ui-clone.c +++ b/ui-clone.c @@ -33,22 +33,26 @@ static int print_ref_info(const struct reference *ref, void *cb_data) static void print_pack_info(void) { - struct packfile_list_entry *e; + struct odb_source *source; char *offset; ctx.page.mimetype = "text/plain"; ctx.page.filename = "objects/info/packs"; cgit_print_http_headers(); odb_reprepare(the_repository->objects); - for (e = packfile_store_get_packs(the_repository->objects->sources->packfiles); e; e = e->next) { - struct packed_git *p = e->pack; - if (p->pack_local) { - offset = strrchr(p->pack_name, '/'); - if (offset && offset[1] != '\0') - ++offset; - else - offset = p->pack_name; - htmlf("P %s\n", offset); + for (source = the_repository->objects->sources; source; source = source->next) { + struct odb_source_files *files = odb_source_files_downcast(source); + struct packfile_list_entry *e; + for (e = files->packed->packs.head; e; e = e->next) { + struct packed_git *p = e->pack; + if (p->pack_local) { + offset = strrchr(p->pack_name, '/'); + if (offset && offset[1] != '\0') + ++offset; + else + offset = p->pack_name; + htmlf("P %s\n", offset); + } } } } From ms at kilabit.info Fri Apr 17 19:43:38 2026 From: ms at kilabit.info (Shulhan) Date: Sat, 18 Apr 2026 02:43:38 +0700 Subject: [PATCH] cmd/cgitd: HTTP server for cgit CGI Message-ID: <20260417194338.649220-1-ms@kilabit.info> The cmd/cgitd provides a quick alternatives to setup and run cgit without installing another second application (usually a web server with their own configuration). To build and run cgitd you needs Go compiler. Its only needs five environment variables, two requireds, and three optionals. Required variables are, - CGITD_CGIT_BIN: path to cgit.cgi - CGITD_CGIT_STATIC_DIR: path to directory that contains cgit.css and cgit.js The other three optional variables are, - CGITD_LISTEN: address and port to serve HTTP connections, default to "127.0.0.1:19418" if it not set. - CGITD_REPO_PREFIXES: comma separated prefix that used in repo.url. - CGITD_STATIC_DIR: path to directory that contains favicon and logo. - CGIT_CONFIG: path to cgitrc Once sets, you can build and run cgitd using the following commands, $ go build ./cmd/cgitd $ ./cgitd Signed-off-by: Shulhan --- This patch is leaning more toward sharing rather than expecting it to be merged to upstream. When the first time I try to setup cgit, I am stuck on "should I install this another package (Apache/lighttpd/...)? Is there any other way I can see how it works before deploying it on server?" The original idea is to be able running cgit on new cloned/modified cgit source code, $ CGIT_CONFIG=${PWD}/cgitrc.test go run ./cmd/cgitd and then update cgitrc.test to see how it works using my local repositories. Then, I think it can be helpful to others, not only for quick testing during cgit development itself, but can be used on live deployment too. PS: Any Arch Linux users who wants to try or like this patch can install the prebuild package from https://build.kilabit.info/aur. You can see whats included in the package here: https://git.kilabit.info/aur-cgit-git and https://git.kilabit.info/cgit .gitignore | 1 + Makefile | 13 +++- README | 33 ++++++++ cmd/cgitd/main.go | 192 ++++++++++++++++++++++++++++++++++++++++++++++ go.mod | 11 +++ go.sum | 4 + 6 files changed, 252 insertions(+), 2 deletions(-) create mode 100644 cmd/cgitd/main.go create mode 100644 go.mod create mode 100644 go.sum diff --git a/.gitignore b/.gitignore index 661df34..0d05b2f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ # Files I don't care to see in git-status/commit /cgit +/cgitd cgit.conf CGIT-CFLAGS VERSION diff --git a/Makefile b/Makefile index 16bfc55..888a5c4 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,7 @@ CGIT_DATA_PATH = $(CGIT_SCRIPT_PATH) CGIT_CONFIG = /etc/cgitrc CACHE_ROOT = /var/cache/cgit prefix = /usr/local +bindir = $(prefix)/bin libdir = $(prefix)/lib filterdir = $(libdir)/cgit/filters docdir = $(prefix)/share/doc/cgit @@ -23,6 +24,7 @@ MAN_TXT = $(MAN5_TXT) DOC_MAN5 = $(patsubst %.txt,%,$(MAN5_TXT)) DOC_HTML = $(patsubst %.txt,%.html,$(MAN_TXT)) DOC_PDF = $(patsubst %.txt,%.pdf,$(MAN_TXT)) +GO := $(shell which go 2>/dev/null) ASCIIDOC = asciidoc ASCIIDOC_EXTRA = @@ -68,13 +70,17 @@ ifndef V export V endif + .SUFFIXES: -all:: cgit +all:: cgit cgitd cgit: $(QUIET_SUBDIR0)git $(QUIET_SUBDIR1) -f ../cgit.mk ../cgit $(EXTRA_GIT_TARGETS) NO_CURL=1 +cgitd: cmd/cgitd/main.go + if [ -n "$(GO)" ]; then $(GO) build ./cmd/cgitd; fi + sparse: $(QUIET_SUBDIR0)git $(QUIET_SUBDIR1) -f ../cgit.mk NO_CURL=1 cgit-sparse @@ -85,6 +91,8 @@ test: install: all $(INSTALL) -m 0755 -d $(DESTDIR)$(CGIT_SCRIPT_PATH) $(INSTALL) -m 0755 cgit $(DESTDIR)$(CGIT_SCRIPT_PATH)/$(CGIT_SCRIPT_NAME) + $(INSTALL) -m 0755 -d $(DESTDIR)$(bindir) + if [ -n "$(GO)" ]; then $(INSTALL) -m 0755 cgitd $(DESTDIR)$(bindir)/cgitd; fi $(INSTALL) -m 0755 -d $(DESTDIR)$(CGIT_DATA_PATH) $(INSTALL) -m 0644 cgit.css $(DESTDIR)$(CGIT_DATA_PATH)/cgit.css $(INSTALL) -m 0644 cgit.js $(DESTDIR)$(CGIT_DATA_PATH)/cgit.js @@ -115,6 +123,7 @@ endef uninstall: rm -f $(DESTDIR)$(CGIT_SCRIPT_PATH)/$(CGIT_SCRIPT_NAME) + rm -f $(DESTDIR)$(bindir)/cgitd rm -f $(DESTDIR)$(CGIT_DATA_PATH)/cgit.css rm -f $(DESTDIR)$(CGIT_DATA_PATH)/cgit.js rm -f $(DESTDIR)$(CGIT_DATA_PATH)/cgit.png @@ -157,7 +166,7 @@ $(DOC_PDF): %.pdf : %.txt a2x -f pdf cgitrc.5.txt clean: clean-doc - $(RM) cgit VERSION CGIT-CFLAGS *.o tags + $(RM) cgit cgitd VERSION CGIT-CFLAGS *.o tags $(RM) -r .deps cleanall: clean diff --git a/README b/README index 7a6b4a4..24cf52e 100644 --- a/README +++ b/README @@ -51,6 +51,7 @@ Dependencies * libzip * libcrypto (OpenSSL) * libssl (OpenSSL) +* optional: Go compiler, to build cgitd * optional: luajit or lua, most reliably used when pkg-config is available Apache configuration @@ -67,6 +68,38 @@ like this: +Running with cgitd +------------------- + +The cmd/cgitd provides a quick alternatives to setup and run cgit +without installing another second application (usually a web server with +their own configuration). + +To build and run cgitd you needs the Go compiler. + +Cgitd needs five environment variables, two are requireds, and three are +optionals. +Required variables are, + +- CGITD_CGIT_BIN: path to cgit.cgi +- CGITD_CGIT_STATIC_DIR: path to directory that contains cgit.css and + cgit.js + +The three optional variables are, + +- CGITD_LISTEN: address and port to serve HTTP connections, default to + "127.0.0.1:19418". +- CGITD_REPO_PREFIXES: comma separated prefix that used in repo.url. +- CGITD_STATIC_DIR: path to directory that contains favicon and logo. + If set, the content of this directory will be served under "/static/" + path, so make sure to add that prefix to favicon= and logo= in cgitrc. +- CGIT_CONFIG: path to cgitrc + +Once sets, you can build and run cgitd using the following commands, + + $ go build ./cmd/cgitd + $ ./cgitd + Runtime configuration --------------------- diff --git a/cmd/cgitd/main.go b/cmd/cgitd/main.go new file mode 100644 index 0000000..56b1b28 --- /dev/null +++ b/cmd/cgitd/main.go @@ -0,0 +1,192 @@ +// Copyright (C) 2026 cgit Development Team +// Licensed under GNU General Public License v2 +// (see COPYING for full license text) + +// Program cgitd is the HTTP server for cgit CGI. +// This program can be built into single binary, provides as an alternatives +// to common setup that require second application (web server with their own +// configuration). +// +// cgitd application can be customized through environment variables or by +// modifying this code directly before build. +// +// # Environment variables +// +// The following environment variables affect on cgitd only. +// +// CGITD_CGIT_BIN - The full path to cgit.cgi. +// It should be in the same directory that contains the "filters" scripts. +// This environment is required, default to "/usr/lib/cgit/cgit.cgi". +// +// CGITD_CGIT_STATIC_DIR - The full path to directory that contains cgit +// resources (cgit.css, cgit.js, cgit.png). +// This environment is required, default to "/usr/share/webapps/cgit/". +// +// CGITD_LISTEN - IP address and port to accept HTTP connections. +// This environment is required, default to "127.0.0.1:19418". +// +// CGITD_REPO_PREFIXES - Comma separated repo URL prefixes that will be +// handled by cgit. +// This environment is optional, no default value. +// +// CGITD_STATIC_DIR - The full path to serve static files, like favicon and +// logo. +// If set, the content of this directory will be served under "/static/" path, +// so make sure to add that prefix to favicon= and logo= in cgitrc. +// This environment is optional, no default value. +// +// # Environment passed to cgit +// +// The following environment variables is passed to cgit process. +// +// CGIT_CONFIG - The full path to cgitrc file. +// This environment is optional. +package main + +import ( + "log" + "net" + "net/http" + "net/http/cgi" + "os" + "strings" + + "git.sr.ht/~shulhan/pakakeh.go/lib/systemd" +) + +// List of known environment variables handled by cgitd. +const ( + envCgitBin = `CGITD_CGIT_BIN` + envCgitStaticDir = `CGITD_CGIT_STATIC_DIR` + envListen = `CGITD_LISTEN` + envRepoPrefixes = `CGITD_REPO_PREFIXES` + envStaticDir = `CGITD_STATIC_DIR` +) + +const ( + defCgitBin = `/usr/lib/cgit/cgit.cgi` + defCgitStaticDir = `/usr/share/webapps/cgit/` + defListen = `127.0.0.1:19418` + defStaticPrefix = `/static` +) + +// List of known environment variables passed to cgit process. +var listCgitEnv = []string{ + `CGIT_CONFIG`, +} + +type config struct { + cgitBin string // Path to cgit.cgi. + cgitStaticDir string // Path to cgit static resources. + listen string // Address for accepting connection. + staticDir string // Path to non-cgit resources like favicon and logo. + + cgitEnvs []string // List of environment variables for cgit. + repoPrefixes []string // List of repo URL prefixes. +} + +func initConfig() (cfg config) { + cfg.cgitBin = os.Getenv(envCgitBin) + if cfg.cgitBin == "" { + cfg.cgitBin = defCgitBin + } + + cfg.cgitStaticDir = os.Getenv(envCgitStaticDir) + if cfg.cgitStaticDir == "" { + cfg.cgitStaticDir = defCgitStaticDir + } + + cfg.listen = os.Getenv(envListen) + if cfg.listen == "" { + cfg.listen = defListen + } + + repoPrefixes := os.Getenv(envRepoPrefixes) + for _, item := range strings.Split(repoPrefixes, ",") { + item = strings.TrimSpace(item) + if item != "" { + cfg.repoPrefixes = append(cfg.repoPrefixes, item) + } + } + + cfg.staticDir = os.Getenv(envStaticDir) + + for _, key := range listCgitEnv { + val := os.Getenv(key) + if val != "" { + cfg.cgitEnvs = append(cfg.cgitEnvs, key+`=`+val) + } + } + + return cfg +} + +func main() { + logp := `cgitd` + cfg := initConfig() + + log.Printf(`%s: %s=%s`, logp, envCgitBin, cfg.cgitBin) + log.Printf(`%s: %s=%s`, logp, envCgitStaticDir, cfg.cgitStaticDir) + log.Printf(`%s: %s=%s`, logp, envListen, cfg.listen) + log.Printf(`%s: %s=%s`, logp, envRepoPrefixes, cfg.repoPrefixes) + log.Printf(`%s: %s=%s`, logp, envStaticDir, cfg.staticDir) + log.Printf(`%s: cgitEnvs=%s`, logp, cfg.cgitEnvs) + + rootfs, err := os.OpenRoot(cfg.cgitStaticDir) + if err != nil { + log.Fatalf(`%s: %s`, logp, err) + } + cgitStaticFS := http.FileServerFS(rootfs.FS()) + + mux := http.NewServeMux() + mux.Handle(`GET /cgit.css`, cgitStaticFS) + mux.Handle(`GET /cgit.js`, cgitStaticFS) + mux.Handle(`GET /cgit.png`, cgitStaticFS) + mux.Handle(`GET /robots.txt`, cgitStaticFS) + + if cfg.staticDir != "" { + rootfs, err = os.OpenRoot(cfg.staticDir) + if err != nil { + log.Fatalf(`%s: %s`, logp, err) + } + staticFS := http.FileServerFS(rootfs.FS()) + mux.Handle(`GET `+defStaticPrefix+`/`, + http.StripPrefix(defStaticPrefix, staticFS)) + } + + cgitHandler := &cgi.Handler{ + Path: cfg.cgitBin, + Env: cfg.cgitEnvs, + } + for _, prefix := range cfg.repoPrefixes { + mux.Handle(`GET `+prefix, cgitHandler) + } + mux.Handle(`GET /`, cgitHandler) + + httpd := http.Server{ + Addr: cfg.listen, + Handler: mux, + } + + // Allow activation through systemd socket. + var listener net.Listener + listeners, err := systemd.Listeners(true) + if err != nil { + log.Fatalf(`%s: %s`, logp, err) + } + for _, l := range listeners { + if l.Addr().String() == cfg.listen { + listener = l + } + } + if listener == nil { + log.Printf(`%s: listening on address %s`, logp, cfg.listen) + err = httpd.ListenAndServe() + } else { + log.Printf(`%s: activated through systemd socket`, logp) + err = httpd.Serve(listener) + } + if err != nil { + log.Fatalf(`%s: %s`, logp, err) + } +} diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..6807df0 --- /dev/null +++ b/go.mod @@ -0,0 +1,11 @@ +// Copyright (C) 2026 cgit Development Team +// Licensed under GNU General Public License v2 +// (see COPYING for full license text) + +module git.zx2c4.com/cgit + +go 1.26.0 + +require git.sr.ht/~shulhan/pakakeh.go v0.62.0 + +require golang.org/x/sys v0.42.0 // indirect diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..c6b687e --- /dev/null +++ b/go.sum @@ -0,0 +1,4 @@ +git.sr.ht/~shulhan/pakakeh.go v0.62.0 h1:rAX0NpfxGbRfe6YhG7I9mmETmcafAreXUZqwPWNDvw4= +git.sr.ht/~shulhan/pakakeh.go v0.62.0/go.mod h1:M8FG29UN+TMqRsOvKFTjsBuZDiGeBzYlAFxHjBM03Rs= +golang.org/x/sys v0.42.0 h1:omrd2nAlyT5ESRdCLYdm3+fMfNFE/+Rf4bDIQImRJeo= +golang.org/x/sys v0.42.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= base-commit: 829eb0711305e8946fa2f4a1c57c43354f35e208 -- 2.54.0.rc2.6.g1194a4dfc5.dirty From ms at kilabit.info Fri Apr 17 20:22:10 2026 From: ms at kilabit.info (Shulhan) Date: Sat, 18 Apr 2026 03:22:10 +0700 Subject: [PATCH] filters: add HTML converter for asciidoc markup Message-ID: <20260417202210.656648-1-ms@kilabit.info> The first style "div#cgit div.content" fix "pre" tag rendered with bottom border. The next style "div#cgit div.content pre" and "code" follow the "pre" and "code" tags styles from Markdown. Signed-off-by: Shulhan --- Here is the screenshots of styles without and with style added to adoc2html, Before style: https://storage.googleapis.com/umum.kilabit.info/patch/cgit/adoc/before_css.png After style: https://storage.googleapis.com/umum.kilabit.info/patch/cgit/adoc/after_css.png cgitrc.5.txt | 2 ++ filters/about-formatting.sh | 1 + filters/html-converters/adoc2html | 21 +++++++++++++++++++++ 3 files changed, 24 insertions(+) create mode 100755 filters/html-converters/adoc2html diff --git a/cgitrc.5.txt b/cgitrc.5.txt index 7c39bf9..c03cfda 100644 --- a/cgitrc.5.txt +++ b/cgitrc.5.txt @@ -912,6 +912,7 @@ about-filter=/var/www/cgit/filters/about-formatting.sh ## Search for these files in the root of the default branch of repositories ## for coming up with the about page: ## +readme=:README.adoc readme=:README.md readme=:readme.md readme=:README.mkd @@ -926,6 +927,7 @@ readme=:README.txt readme=:readme.txt readme=:README readme=:readme +readme=:INSTALL.adoc readme=:INSTALL.md readme=:install.md readme=:INSTALL.mkd diff --git a/filters/about-formatting.sh b/filters/about-formatting.sh index 85daf9c..8e1fa88 100755 --- a/filters/about-formatting.sh +++ b/filters/about-formatting.sh @@ -19,6 +19,7 @@ cd "$(dirname $0)/html-converters/" case "$(printf '%s' "$1" | tr '[:upper:]' '[:lower:]')" in + *.adoc) exec ./adoc2html; ;; *.markdown|*.mdown|*.md|*.mkd) exec ./md2html; ;; *.rst) exec ./rst2html; ;; *.[1-9]) exec ./man2html; ;; diff --git a/filters/html-converters/adoc2html b/filters/html-converters/adoc2html new file mode 100755 index 0000000..0d55e2d --- /dev/null +++ b/filters/html-converters/adoc2html @@ -0,0 +1,21 @@ +#!/bin/sh +echo "" +exec asciidoctor --no-header-footer --safe-mode=server - base-commit: 829eb0711305e8946fa2f4a1c57c43354f35e208 prerequisite-patch-id: 7a0303d4a9294a9a0ef18d5915080b479468b276 -- 2.54.0.rc2.6.g1194a4dfc5.dirty From list at eworm.de Mon Apr 20 19:54:01 2026 From: list at eworm.de (Christian Hesse) Date: Mon, 20 Apr 2026 21:54:01 +0200 Subject: [PATCH 1/1] git: update to v2.54.0 Message-ID: <20260420195401.17868-1-list@eworm.de> From: Christian Hesse Update to git version v2.54.0, this requires changes for these upstream commits: * d9ecf268ef3f69130fa269012318470d908978f6 odb: embed base source in the "files" backend * cb506a8a69c953f7b87bb3ae099e0bed8218d3ab odb: introduce "files" source ... and probably more related. Signed-off-by: Christian Hesse --- Makefile | 2 +- git | 2 +- ui-clone.c | 24 ++++++++++++++---------- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index 16bfc55..8a6b51a 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ htmldir = $(docdir) pdfdir = $(docdir) mandir = $(prefix)/share/man SHA1_HEADER = -GIT_VER = 2.53.0 +GIT_VER = 2.54.0 GIT_URL = https://www.kernel.org/pub/software/scm/git/git-$(GIT_VER).tar.xz INSTALL = install COPYTREE = cp -r diff --git a/git b/git index 67ad421..94f0577 160000 --- a/git +++ b/git @@ -1 +1 @@ -Subproject commit 67ad42147a7acc2af6074753ebd03d904476118f +Subproject commit 94f057755b7941b321fd11fec1b2e3ca5313a4e0 diff --git a/ui-clone.c b/ui-clone.c index 5a1fab3..e11f496 100644 --- a/ui-clone.c +++ b/ui-clone.c @@ -33,22 +33,26 @@ static int print_ref_info(const struct reference *ref, void *cb_data) static void print_pack_info(void) { - struct packfile_list_entry *e; + struct odb_source *source; char *offset; ctx.page.mimetype = "text/plain"; ctx.page.filename = "objects/info/packs"; cgit_print_http_headers(); odb_reprepare(the_repository->objects); - for (e = packfile_store_get_packs(the_repository->objects->sources->packfiles); e; e = e->next) { - struct packed_git *p = e->pack; - if (p->pack_local) { - offset = strrchr(p->pack_name, '/'); - if (offset && offset[1] != '\0') - ++offset; - else - offset = p->pack_name; - htmlf("P %s\n", offset); + for (source = the_repository->objects->sources; source; source = source->next) { + struct odb_source_files *files = odb_source_files_downcast(source); + struct packfile_list_entry *e; + for (e = files->packed->packs.head; e; e = e->next) { + struct packed_git *p = e->pack; + if (p->pack_local) { + offset = strrchr(p->pack_name, '/'); + if (offset && offset[1] != '\0') + ++offset; + else + offset = p->pack_name; + htmlf("P %s\n", offset); + } } } }