From list at eworm.de Mon Feb 2 19:54:31 2026 From: list at eworm.de (Christian Hesse) Date: Mon, 2 Feb 2026 20:54:31 +0100 Subject: [PATCH 1/1] git: update to v2.53.0 Message-ID: <20260202195431.34720-1-list@eworm.de> From: Christian Hesse Update to git version v2.53.0, this requires changes for these upstream commits: * bdbebe5714b25dc9d215b48efbb80f410925d7dd refs: introduce wrapper struct for `each_ref_fn` * 589127caa73090040200989ff4d24c3d54f473f2 packfile: move list of packs into the packfile store * 5a5c7359f77ecd1bc4b0e172563161d602f131d3 refs: drop `current_ref_iter` hack * b6e4cc8c32850315323961659e553d1d14591f7f tag: support arbitrary repositories in parse_tag() * 84f0e60b28de69d1ccb7a51b729af6202b6cf4c8 packfile: move packfile store into object source Signed-off-by: Christian Hesse --- Makefile | 2 +- cgit.c | 7 +++---- cgit.h | 3 +-- git | 2 +- shared.c | 5 ++--- ui-clone.c | 22 +++++++++++----------- ui-log.c | 2 +- ui-shared.c | 5 ++--- ui-tag.c | 2 +- 9 files changed, 23 insertions(+), 27 deletions(-) diff --git a/Makefile b/Makefile index c376d2f..649e474 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ htmldir = $(docdir) pdfdir = $(docdir) mandir = $(prefix)/share/man SHA1_HEADER = -GIT_VER = 2.52.0 +GIT_VER = 2.53.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 65c38c0..579db64 100644 --- a/cgit.c +++ b/cgit.c @@ -448,16 +448,15 @@ struct refmatch { int match; }; -static int find_current_ref(const char *refname, const char *referent UNUSED, - const struct object_id *oid, int flags, void *cb_data) +static int find_current_ref(const struct reference *ref, void *cb_data) { struct refmatch *info; info = (struct refmatch *)cb_data; - if (!strcmp(refname, info->req_ref)) + if (!strcmp(ref->name, info->req_ref)) info->match = 1; if (!info->first_ref) - info->first_ref = xstrdup(refname); + info->first_ref = xstrdup(ref->name); return info->match; } diff --git a/cgit.h b/cgit.h index 653ec28..28d2772 100644 --- a/cgit.h +++ b/cgit.h @@ -346,8 +346,7 @@ extern void strbuf_ensure_end(struct strbuf *sb, char c); extern void cgit_add_ref(struct reflist *list, struct refinfo *ref); extern void cgit_free_reflist_inner(struct reflist *list); -extern int cgit_refs_cb(const char *refname, const char *referent UNUSED, - const struct object_id *oid, int flags, void *cb_data); +extern int cgit_refs_cb(const struct reference *ref, void *cb_data); extern void cgit_free_commitinfo(struct commitinfo *info); extern void cgit_free_taginfo(struct taginfo *info); diff --git a/git b/git index 9a2fb14..67ad421 160000 --- a/git +++ b/git @@ -1 +1 @@ -Subproject commit 9a2fb147f2c61d0cab52c883e7e26f5b7948e3ed +Subproject commit 67ad42147a7acc2af6074753ebd03d904476118f diff --git a/shared.c b/shared.c index 401cf86..07b38ba 100644 --- a/shared.c +++ b/shared.c @@ -212,11 +212,10 @@ void cgit_free_reflist_inner(struct reflist *list) free(list->refs); } -int cgit_refs_cb(const char *refname, const char *referent UNUSED, - const struct object_id *oid, int flags, void *cb_data) +int cgit_refs_cb(const struct reference *ref, void *cb_data) { struct reflist *list = (struct reflist *)cb_data; - struct refinfo *info = cgit_mk_refinfo(refname, oid); + struct refinfo *info = cgit_mk_refinfo(ref->name, ref->oid); if (info) cgit_add_ref(list, info); diff --git a/ui-clone.c b/ui-clone.c index 9445454..5a1fab3 100644 --- a/ui-clone.c +++ b/ui-clone.c @@ -15,39 +15,39 @@ #include "ui-shared.h" #include "packfile.h" -static int print_ref_info(const char *refname, const char *referent UNUSED, - const struct object_id *oid, int flags, void *cb_data) +static int print_ref_info(const struct reference *ref, void *cb_data) { struct object *obj; - if (!(obj = parse_object(the_repository, oid))) + if (!(obj = parse_object(the_repository, ref->oid))) return 0; - htmlf("%s\t%s\n", oid_to_hex(oid), refname); + htmlf("%s\t%s\n", oid_to_hex(ref->oid), ref->name); if (obj->type == OBJ_TAG) { - if (!(obj = deref_tag(the_repository, obj, refname, 0))) + if (!(obj = deref_tag(the_repository, obj, ref->name, 0))) return 0; - htmlf("%s\t%s^{}\n", oid_to_hex(&obj->oid), refname); + htmlf("%s\t%s^{}\n", oid_to_hex(&obj->oid), ref->name); } return 0; } static void print_pack_info(void) { - struct packed_git *pack; + struct packfile_list_entry *e; char *offset; ctx.page.mimetype = "text/plain"; ctx.page.filename = "objects/info/packs"; cgit_print_http_headers(); odb_reprepare(the_repository->objects); - for (pack = packfile_store_get_packs(the_repository->objects->packfiles); pack; pack = pack->next) { - if (pack->pack_local) { - offset = strrchr(pack->pack_name, '/'); + 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 = pack->pack_name; + offset = p->pack_name; htmlf("P %s\n", offset); } } diff --git a/ui-log.c b/ui-log.c index ee2a607..31fb783 100644 --- a/ui-log.c +++ b/ui-log.c @@ -83,7 +83,7 @@ void show_commit_decorations(struct commit *commit) break; case DECORATION_REF_TAG: if (!refs_read_ref(get_main_ref_store(the_repository), deco->name, &oid_tag) && - !peel_iterated_oid(the_repository, &oid_tag, &peeled)) + !peel_object(the_repository, &oid_tag, &peeled, PEEL_OBJECT_VERIFY_TAGGED_OBJECT_TYPE)) is_annotated = !oideq(&oid_tag, &peeled); cgit_tag_link(buf, NULL, is_annotated ? "tag-annotated-deco" : "tag-deco", buf); break; diff --git a/ui-shared.c b/ui-shared.c index 4250b89..838170a 100644 --- a/ui-shared.c +++ b/ui-shared.c @@ -936,10 +936,9 @@ void cgit_add_clone_urls(void (*fn)(const char *)) add_clone_urls(fn, ctx.cfg.clone_prefix, ctx.repo->url); } -static int print_branch_option(const char *refname, const char *referent UNUSED, - const struct object_id *oid, int flags, void *cb_data) +static int print_branch_option(const struct reference *ref, void *cb_data) { - char *name = (char *)refname; + char *name = (char *)ref->name; html_option(name, name, ctx.qry.head); return 0; } diff --git a/ui-tag.c b/ui-tag.c index 3b11226..8f58f14 100644 --- a/ui-tag.c +++ b/ui-tag.c @@ -66,7 +66,7 @@ void cgit_print_tag(char *revname) struct taginfo *info; tag = lookup_tag(the_repository, &oid); - if (!tag || parse_tag(tag) || !(info = cgit_parse_tag(tag))) { + if (!tag || parse_tag(the_repository, tag) || !(info = cgit_parse_tag(tag))) { cgit_print_error_page(500, "Internal server error", "Bad tag object: %s", revname); goto cleanup; From list at eworm.de Mon Feb 2 21:09:20 2026 From: list at eworm.de (Christian Hesse) Date: Mon, 2 Feb 2026 22:09:20 +0100 Subject: [PATCH 1/1] git: update to v2.53.0 In-Reply-To: <20260202195431.34720-1-list@eworm.de> References: <20260202195431.34720-1-list@eworm.de> Message-ID: <20260202220920.7b1751cb@leda.eworm.net> Christian Hesse on Mon, 2026/02/02 20:54: > Update to git version v2.53.0, this requires changes for these > upstream commits: Another ping on this... Any chance to have pending changes committed to master? Git updates would be really great, other changes would be appreciated as well. Thanks! -- 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 Jason at zx2c4.com Tue Feb 24 01:56:55 2026 From: Jason at zx2c4.com (Jason A. Donenfeld) Date: Tue, 24 Feb 2026 02:56:55 +0100 Subject: [ANNOUNCE] CGIT v1.3 Released In-Reply-To: <20200314000336.GA997354@zx2c4.com> References: <20200314000336.GA997354@zx2c4.com> Message-ID: Hi folks, CGit 1.3 is now available. == CGit on the Web == * homepage: https://git.zx2c4.com/cgit/about/ * git repository: https://git.zx2c4.com/cgit * mailing list: cgit at lists.zx2c4.com * mailing list subscribe: https://lists.zx2c4.com/mailman/listinfo/cgit == ChangeLog v1.3 == 39 files changed, 641 insertions(+), 394 deletions(-) As the first release in 6 years, there's a lot in here: bug fixes of every which variety, git modernizations (v2.53), css updates, and even javascript for the first time, for the new dynamic aging feature. This release contains commits from: Christian Hesse, June McEnroe, John Keeping, Jason A. Donenfeld, Christian Barcenas, Andy Green, Chris Mayo, Todd Zullinger, Samuel Lid?n Borell, Peter Prohaska, Lo?c, Kian Kasad, Hristo Venev, and Denis Pronin. == Downloading == This release is available in compressed tarball form here: https://git.zx2c4.com/cgit/snapshot/cgit-1.3.tar.xz SHA2-256: 836b6edbc7f99e11037a8b928d609ce346ed77a55545e17fff8cea59b5b7aa42 A PGP signature of that file decompressed is available here: https://git.zx2c4.com/cgit/snapshot/cgit-1.3.tar.asc Signing key: AB9942E6D4A4CFC3412620A749FC7012A5DE03AE Enjoy, Jason From list at eworm.de Wed Feb 25 11:19:35 2026 From: list at eworm.de (Christian Hesse) Date: Wed, 25 Feb 2026 12:19:35 +0100 Subject: [ANNOUNCE] CGIT v1.3 Released In-Reply-To: References: <20200314000336.GA997354@zx2c4.com> Message-ID: <20260225121935.524fbeed@leda.eworm.net> "Jason A. Donenfeld" on Tue, 2026/02/24 02:56: > CGit 1.3 is now available. Thanks lot, much appreciated! I have some more commits in ch/for-jason you skipped... Any comments on these? Are changes required, or do you reject these completely? -- 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 rito at ritovision.com Wed Feb 25 23:07:24 2026 From: rito at ritovision.com (Rito Rhymes) Date: Wed, 25 Feb 2026 18:07:24 -0500 Subject: [PATCH 0/5] fix broken mobile layouts across views Message-ID: <20260225230729.8610-1-rito@ritovision.com> This patch series fixes mobile responsiveness bugs that currently break page layouts in cgit. The approach is adaptive rather than transformative: it preserves the legacy desktop layout, adds targeted mobile constraints at <=768px, and prevents content from escaping its containers and breaking layout. Rationale Software development remains largely desktop-first, but contributors increasingly browse history, read logs, review diffs, and share links from mobile devices while away from a workstation. This patch series improves day-to-day usability for contributors accessing cgit on small screens, while preserving existing desktop behavior. Before and After Mobile Screenshots For convenience, a sequenced view of the before and after screenshots can be seen at https://github.com/ritovision/cgit/pull/1 Index Before: https://github.com/user-attachments/assets/5a7c2936-d940-407d-a078-cebe845d1378 After (top, pre-scroll): https://github.com/user-attachments/assets/b7cd488b-625c-4263-9291-52a1de70d9dd After (top, post-scroll; content scrolled right): https://github.com/user-attachments/assets/9956f880-1df1-4249-a496-f9812ea1f0d1 After (bottom): https://github.com/user-attachments/assets/d940671d-a0ca-4512-b595-3a537436acc2 Summary Before: https://github.com/user-attachments/assets/87d1407d-2ad7-42dc-9f9a-d167e133f941 After (pre-scroll): https://github.com/user-attachments/assets/c652d2ba-c2b8-4d62-bcb7-714c2b6807e3 After (post-scroll; tabs row and table content scrolled right): https://github.com/user-attachments/assets/4339c0fc-c7f2-4aab-b676-32b5b0d15eb9 After (long repo name wraps): https://github.com/user-attachments/assets/1bc9dfbc-7f9b-45cf-bbe3-6fc2633dbaf7 Commit (representative of similar code element views) Before: https://github.com/user-attachments/assets/aa8dd431-90ca-461a-afa5-00c398201c21 After (pre-scroll): https://github.com/user-attachments/assets/b8850299-b9f0-414f-9b48-4ab4b0a58792 After (post-scroll): https://github.com/user-attachments/assets/1c1a501f-fdbf-411b-891d-643af609e51a Rito Rhymes (5): ui-shared: add viewport tag for baseline mobile usability css: contain horizontal page overflow to content blocks css: make tabs row horizontally scrollable on mobile css: reflow header table to prevent mobile overflow css: wrap long unbroken repo names in mobile header cgit.css | 109 ++++++++++++++++++++++++++++++++++++++++++++++++++++ ui-shared.c | 1 + 2 files changed, 110 insertions(+) -- 2.51.0 From rito at ritovision.com Wed Feb 25 23:07:25 2026 From: rito at ritovision.com (Rito Rhymes) Date: Wed, 25 Feb 2026 18:07:25 -0500 Subject: [PATCH 1/5] ui-shared: add viewport tag for baseline mobile usability In-Reply-To: <20260225230729.8610-1-rito@ritovision.com> References: <20260225230729.8610-1-rito@ritovision.com> Message-ID: <20260225230729.8610-2-rito@ritovision.com> Set the viewport so mobile browsers render at device width by default, instead of using a desktop-width initial layout. This is the first essential step in preventing the "panzoom dance" of pinch-zooming and panning just to read content. This is the baseline needed for mobile CSS fixes in follow-up commits. It does not fully fix mobile layout issues on its own; follow-up CSS patches address remaining overflow and scrolling issues. Signed-off-by: Rito Rhymes --- ui-shared.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ui-shared.c b/ui-shared.c index 6fae72d..af1ca16 100644 --- a/ui-shared.c +++ b/ui-shared.c @@ -821,6 +821,7 @@ void cgit_print_docstart(void) htmlf("\n", cgit_version); if (ctx.cfg.robots && *ctx.cfg.robots) htmlf("\n", ctx.cfg.robots); + html("\n"); if (ctx.cfg.css.items) for_each_string_list(&ctx.cfg.css, emit_css_link, NULL); -- 2.51.0 From rito at ritovision.com Wed Feb 25 23:07:26 2026 From: rito at ritovision.com (Rito Rhymes) Date: Wed, 25 Feb 2026 18:07:26 -0500 Subject: [PATCH 2/5] css: contain horizontal page overflow to content blocks In-Reply-To: <20260225230729.8610-1-rito@ritovision.com> References: <20260225230729.8610-1-rito@ritovision.com> Message-ID: <20260225230729.8610-3-rito@ritovision.com> Wide tables and long preformatted lines can force page-wide horizontal scrolling on mobile, which breaks the layout. Allow contained horizontal overflow on the main content area and preformatted blocks so scrolling stays localized to those elements instead of the entire page. Signed-off-by: Rito Rhymes --- cgit.css | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cgit.css b/cgit.css index 1b848cf..cf23c39 100644 --- a/cgit.css +++ b/cgit.css @@ -117,6 +117,13 @@ div#cgit div.content { margin: 0px; padding: 2em; border-bottom: solid 3px #ccc; + overflow-x: auto; + -webkit-overflow-scrolling: touch; +} + +div#cgit pre { + overflow-x: auto; + -webkit-overflow-scrolling: touch; } -- 2.51.0 From rito at ritovision.com Wed Feb 25 23:07:27 2026 From: rito at ritovision.com (Rito Rhymes) Date: Wed, 25 Feb 2026 18:07:27 -0500 Subject: [PATCH 3/5] css: make tabs row horizontally scrollable on mobile In-Reply-To: <20260225230729.8610-1-rito@ritovision.com> References: <20260225230729.8610-1-rito@ritovision.com> Message-ID: <20260225230729.8610-4-rito@ritovision.com> On narrow screens, the tabs row and search form can overflow and create page-wide horizontal scrolling. Add a 768px mobile breakpoint that turns the tabs table into a horizontal scroll container and keeps row content on one line. Also add bottom spacing so tab labels and search controls are less likely to be visually occluded by overlay scrollbars, keeping controls aligned and easier to read and tap. Signed-off-by: Rito Rhymes --- cgit.css | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/cgit.css b/cgit.css index cf23c39..6063f63 100644 --- a/cgit.css +++ b/cgit.css @@ -904,3 +904,37 @@ div#cgit table.ssdiff td.space { div#cgit table.ssdiff td.space div { min-height: 3em; } + + at media (max-width: 768px) { + div#cgit table.tabs { + display: block; + width: 100%; + overflow-x: auto; + -webkit-overflow-scrolling: touch; + } + + div#cgit table.tabs tr { + display: table; + width: max-content; + } + + div#cgit table.tabs td { + white-space: nowrap; + } + + div#cgit table.tabs td:not(.form) a { + display: inline-block; + padding-bottom: 8px; + } + + div#cgit table.tabs td.form { + text-align: left; + } + + div#cgit table.tabs td.form form { + display: inline-flex; + align-items: center; + white-space: nowrap; + margin-bottom: 6px; + } +} -- 2.51.0 From rito at ritovision.com Wed Feb 25 23:07:28 2026 From: rito at ritovision.com (Rito Rhymes) Date: Wed, 25 Feb 2026 18:07:28 -0500 Subject: [PATCH 4/5] css: reflow header table to prevent mobile overflow In-Reply-To: <20260225230729.8610-1-rito@ritovision.com> References: <20260225230729.8610-1-rito@ritovision.com> Message-ID: <20260225230729.8610-5-rito@ritovision.com> On narrow screens, the header table can overflow when the logo, main links, and search controls compete for one row. At 768px and below, reflow the first header row into a two-column grid, move the form below the main cell, and allow horizontal scrolling for form controls. This keeps overflow contained to the header form instead of widening the page. Signed-off-by: Rito Rhymes --- cgit.css | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/cgit.css b/cgit.css index 6063f63..e0fb696 100644 --- a/cgit.css +++ b/cgit.css @@ -906,6 +906,70 @@ div#cgit table.ssdiff td.space div { } @media (max-width: 768px) { + div#cgit table#header tr:first-child { + display: grid; + grid-template-columns: 96px minmax(0, 1fr); + column-gap: 10px; + row-gap: 0.35em; + align-items: end; + } + + div#cgit table#header td.logo { + grid-column: 1; + grid-row: 1 / span 2; + width: 96px; + margin-bottom: 0; + } + + div#cgit table#header td.main { + grid-column: 2; + grid-row: 1; + white-space: normal; + padding-left: 0; + } + + div#cgit table#header td.form { + grid-column: 2; + grid-row: 2; + text-align: left; + padding-right: 0; + padding-left: 0; + padding-top: 0.35em; + white-space: nowrap; + overflow-x: auto; + -webkit-overflow-scrolling: touch; + } + + div#cgit table#header tr:nth-child(2) { + display: block; + width: 100%; + } + + div#cgit table#header tr:nth-child(2) td.sub { + display: block; + width: 100%; + box-sizing: border-box; + padding-left: 0; + } + + div#cgit table#header td.sub.right { + text-align: left; + border-top: 0; + padding-top: 0.25em; + } + + div#cgit table#header td.form form { + display: inline-flex; + flex-wrap: nowrap; + align-items: center; + gap: 0.35em; + white-space: nowrap; + } + + div#cgit table#header td.form select { + max-width: 100%; + } + div#cgit table.tabs { display: block; width: 100%; -- 2.51.0 From rito at ritovision.com Wed Feb 25 23:07:29 2026 From: rito at ritovision.com (Rito Rhymes) Date: Wed, 25 Feb 2026 18:07:29 -0500 Subject: [PATCH 5/5] css: wrap long unbroken repo names in mobile header In-Reply-To: <20260225230729.8610-1-rito@ritovision.com> References: <20260225230729.8610-1-rito@ritovision.com> Message-ID: <20260225230729.8610-6-rito@ritovision.com> At the mobile breakpoint, target the repo-name link in the header main cell and allow wrapping for long unbroken names. This prevents horizontal overflow from long repo names on narrow screens. Signed-off-by: Rito Rhymes --- cgit.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cgit.css b/cgit.css index e0fb696..34ad5b8 100644 --- a/cgit.css +++ b/cgit.css @@ -928,6 +928,10 @@ div#cgit table.ssdiff td.space div { padding-left: 0; } + div#cgit table#header td.main a:nth-of-type(2) { + overflow-wrap: anywhere; + } + div#cgit table#header td.form { grid-column: 2; grid-row: 2; -- 2.51.0 From bwiedemann at suse.de Fri Feb 27 10:03:27 2026 From: bwiedemann at suse.de (bwiedemann at suse.de) Date: Fri, 27 Feb 2026 10:03:27 +0000 Subject: [PATCH] ui-shared: set exipry properly in cgit_print_error_page Message-ID: <20260227100327.31662-1-bwiedemann@suse.de> From: "Bernhard M. Wiedemann" according to my understanding of the code, the expiry value needs to be a UNIX timestamp while the ttl value is an offset in minutes, defaulting to 5. This patch was done while reviewing potential year-2038 issues in openSUSE. -- Note: I did not test this and don't know the codebase, so review/test carefully. E.g. is the "modified" value set there? And do we actually want to set an expiry there? --- ui-shared.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui-shared.c b/ui-shared.c index 219b830..a09a72a 100644 --- a/ui-shared.c +++ b/ui-shared.c @@ -889,7 +889,7 @@ void cgit_print_docend(void) void cgit_print_error_page(int code, const char *msg, const char *fmt, ...) { va_list ap; - ctx.page.expires = ctx.cfg.cache_dynamic_ttl; + ctx.page.expires = ctx.page.modified + 60 * ctx.cfg.cache_dynamic_ttl; ctx.page.status = code; ctx.page.statusmsg = msg; cgit_print_layout_start(); -- 2.51.1 From baptiste at bitsofnetworks.org Fri Feb 27 15:51:11 2026 From: baptiste at bitsofnetworks.org (Baptiste Jonglez) Date: Fri, 27 Feb 2026 16:51:11 +0100 Subject: [PATCH] cgit: Fix guessing default branch Message-ID: <20260227155116.744776-1-baptiste@bitsofnetworks.org> From: Baptiste Jonglez Even when HEAD is set to "main" in a repository, cgit still uses the "master" branch to detect the age of the last commit. Example: $ cat repositories/openwrt/openwrt.git/HEAD ref: refs/heads/main $ stat repositories/openwrt/openwrt.git/refs/heads/master Modify: 2024-02-22 23:00:01.285731731 +0000 $ stat repositories/openwrt/openwrt.git/refs/heads/main Modify: 2026-02-27 15:33:49.506017172 +0000 In this situation, cgit displays "25 months" for this repository on the index page. I guess the internal format for HEAD has changed at some point, so it needs to be taken into account when parsing it in cgit. Signed-off-by: Baptiste Jonglez --- cgit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cgit.c b/cgit.c index c91897a..8df32e2 100644 --- a/cgit.c +++ b/cgit.c @@ -496,7 +496,7 @@ static char *guess_defbranch(void) ref = refs_resolve_ref_unsafe(get_main_ref_store(the_repository), "HEAD", 0, &oid, NULL); - if (!ref || !skip_prefix(ref, "refs/heads/", &refname)) + if (!ref || !skip_prefix(ref, "ref: refs/heads/", &refname)) return "master"; return xstrdup(refname); } -- 2.47.3 From aiden at aidenw.net Fri Feb 27 16:47:06 2026 From: aiden at aidenw.net (Aiden Woodruff) Date: Fri, 27 Feb 2026 11:47:06 -0500 Subject: [PATCH] cgit: Fix guessing default branch In-Reply-To: <20260227155116.744776-1-baptiste@bitsofnetworks.org> References: <20260227155116.744776-1-baptiste@bitsofnetworks.org> Message-ID: <12a98e5d-89f8-4478-9057-5364044c1ee6@aidenw.net> Hi Baptiste, On 2/27/26 10:51 AM, Baptiste Jonglez wrote: > I guess the internal format for HEAD has changed at some point, so it > needs to be taken into account when parsing it in cgit. Just to add some information, the HEAD format hasn't changed since that line was added. Compare the git user manual blame: https://gitlab.com/git-scm/git/-/blame/HEAD/Documentation/user-manual.adoc#L289 And the cgit blame: https://git.zx2c4.com/cgit/blame/cgit.c#n499 -- Aiden Woodruff -------------- next part -------------- A non-text attachment was scrubbed... Name: OpenPGP_0xE954F892957A1764.asc Type: application/pgp-keys Size: 855 bytes Desc: OpenPGP public key URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: OpenPGP_signature.asc Type: application/pgp-signature Size: 236 bytes Desc: OpenPGP digital signature URL: From aiden at aidenw.net Fri Feb 27 16:47:06 2026 From: aiden at aidenw.net (Aiden Woodruff) Date: Fri, 27 Feb 2026 11:47:06 -0500 Subject: [PATCH] cgit: Fix guessing default branch In-Reply-To: <20260227155116.744776-1-baptiste@bitsofnetworks.org> References: <20260227155116.744776-1-baptiste@bitsofnetworks.org> Message-ID: <12a98e5d-89f8-4478-9057-5364044c1ee6@aidenw.net> Hi Baptiste, On 2/27/26 10:51 AM, Baptiste Jonglez wrote: > I guess the internal format for HEAD has changed at some point, so it > needs to be taken into account when parsing it in cgit. Just to add some information, the HEAD format hasn't changed since that line was added. Compare the git user manual blame: https://gitlab.com/git-scm/git/-/blame/HEAD/Documentation/user-manual.adoc#L289 And the cgit blame: https://git.zx2c4.com/cgit/blame/cgit.c#n499 -- Aiden Woodruff -------------- next part -------------- A non-text attachment was scrubbed... Name: OpenPGP_0xE954F892957A1764.asc Type: application/pgp-keys Size: 855 bytes Desc: OpenPGP public key URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: OpenPGP_signature.asc Type: application/pgp-signature Size: 236 bytes Desc: OpenPGP digital signature URL: