<feed xmlns='http://www.w3.org/2005/Atom'>
<title>cgitext.git/cgit.c, branch develop</title>
<subtitle>cgitext – CGI for Git extension</subtitle>
<id>https://sayag.it/cgitext.git/atom/cgit.c?h=develop</id>
<link rel='self' href='https://sayag.it/cgitext.git/atom/cgit.c?h=develop'/>
<link rel='alternate' type='text/html' href='https://sayag.it/cgitext.git/'/>
<updated>2026-08-01T06:15:38Z</updated>
<entry>
<title>logo: include svg variant for both favicon and logo</title>
<updated>2026-08-01T06:15:38Z</updated>
<author>
<name>Saya Andy</name>
<email>saya.andy@posteo.com</email>
</author>
<published>2026-08-01T06:15:38Z</published>
<link rel='alternate' type='text/html' href='https://sayag.it/cgitext.git/commit/?id=8a90bca75c8d8755016b46747ca943bb7b37140c'/>
<id>urn:sha1:8a90bca75c8d8755016b46747ca943bb7b37140c</id>
<content type='text'>
The reasoning behind using svg as primary defaults is simple – at
close-up it is much neater, plus svg favicon is supported since 2015 in
Firefox, 2020 in Chromium, 2025 in Safari. For old browsers ico is still
kept as a fallback.

The svg was auto-generated using a Python script and then simplified to
a path, but kept close to an original.
</content>
</entry>
<entry>
<title>licensing: add author preambles where changes were done</title>
<updated>2026-07-31T04:38:28Z</updated>
<author>
<name>Saya Andy</name>
<email>saya.andy@posteo.com</email>
</author>
<published>2026-07-30T05:49:23Z</published>
<link rel='alternate' type='text/html' href='https://sayag.it/cgitext.git/commit/?id=306fafc1d1d19c51d7ac24479f49c76272934ce5'/>
<id>urn:sha1:306fafc1d1d19c51d7ac24479f49c76272934ce5</id>
<content type='text'>
Add a copyright for changes done by me, also note in README the nature
of this repo
</content>
</entry>
<entry>
<title>ui-ci: let a ci-filter decide whether the tab is shown</title>
<updated>2026-07-30T05:27:31Z</updated>
<author>
<name>Saya Andy</name>
<email>saya.andy@posteo.com</email>
</author>
<published>2026-07-30T05:27:31Z</published>
<link rel='alternate' type='text/html' href='https://sayag.it/cgitext.git/commit/?id=7162aef3344a4f4f2d7edd2f214d805bd744c20c'/>
<id>urn:sha1:7162aef3344a4f4f2d7edd2f214d805bd744c20c</id>
<content type='text'>
cgit cannot know whether the ref being viewed actually has a pipeline, so
the "ci" tab is offered for every ref and only reveals a missing one once
followed. Probing the ci system from cgit is not an option: the tab is
part of the page header, so it would mean a blocking request for every
page of every repository, cgit links no http client, and job pages are
usually not readable anonymously.

Add a ci filter instead, which receives the ref, whether it is a branch or
a tag, and the expanded url, and answers with its exit status. This keeps
credentials, timeouts and caching in a script, where they belong;
filters/ci-jenkins.sh demonstrates all three against Jenkins' REST API.

The verdict is memoized, so the filter runs once per request rather than
once for the tab and again for the redirect, and it governs the page as
well as the tab, so a hidden tab cannot be reached by typing the url.

Signed-off-by: Saya Andy &lt;saya.andy@posteo.com&gt;
</content>
</entry>
<entry>
<title>ui-ci: add a "ci" tab which redirects to an external ci system</title>
<updated>2026-07-30T05:26:52Z</updated>
<author>
<name>Saya Andy</name>
<email>saya.andy@posteo.com</email>
</author>
<published>2026-07-30T05:26:52Z</published>
<link rel='alternate' type='text/html' href='https://sayag.it/cgitext.git/commit/?id=b4b4f2325db71041f38902143b28bae94762b111'/>
<id>urn:sha1:b4b4f2325db71041f38902143b28bae94762b111</id>
<content type='text'>
Add a "ci" page which redirects to an external ci system for the ref
being viewed, along with a tab for it in the repository header.

The target is a url template, configurable globally or per repository,
with separate settings for branches and tags because pipelines for the
two commonly live at different locations: on a Jenkins multibranch
pipeline a branch is at job/&lt;name&gt;/job/&lt;ref&gt; while a tag is at
job/&lt;name&gt;/view/tags/job/&lt;ref&gt;. $ref, $repo and $slug are substituted,
$slug being the repository url with any ".git" suffix removed and slashes
replaced by dashes, which is the shape job names usually take.

An explicit repo.ci-url drops the branch and tag urls the repository
would otherwise inherit from the global settings, as it could never take
effect otherwise.

The expansion is written to the Location header verbatim rather than
through cgit_redirect(), which percent-encodes '?', '=' and '%' and would
corrupt any url carrying a query string. An expansion containing CR or LF
is refused so that it cannot smuggle in further headers.

Signed-off-by: Saya Andy &lt;saya.andy@posteo.com&gt;
</content>
</entry>
<entry>
<title>cgit: don't initialize notes when there is no repository</title>
<updated>2026-07-30T05:23:33Z</updated>
<author>
<name>Saya Andy</name>
<email>saya.andy@posteo.com</email>
</author>
<published>2026-07-30T05:23:33Z</published>
<link rel='alternate' type='text/html' href='https://sayag.it/cgitext.git/commit/?id=26fbed3bc58600adc092ab41e094e0fcae60f3b2'/>
<id>urn:sha1:26fbed3bc58600adc092ab41e094e0fcae60f3b2</id>
<content type='text'>
prepare_repo_env() calls load_display_notes() unconditionally, even when
setup_git_directory_gently() has just reported that repo.path is not a
repository. init_notes() then resolves the default notes ref and
dereferences the repository's hash algorithm, which is still NULL:

    EXC_BAD_ACCESS (code=1, address=0x18)
    get_oid_basic(str="refs/notes/commits", len=18) at object-name.c:688
    -&gt; if (len == r-&gt;hash_algo-&gt;hexsz &amp;&amp; !get_oid_hex(str, oid)) {

A typo in repo.path therefore took out the request. On Linux this
segfaults; on macOS nothing consumes the Mach exception, so the faulting
instruction is retried forever and the worker process spins at 100% CPU
instead of dying.

Only load the notes once a repository has been opened. prepare_repo_cmd()
reports the failure immediately afterwards, so such a request now renders
"Failed to open &lt;repo&gt;: No such file or directory".

Signed-off-by: Saya Andy &lt;saya.andy@posteo.com&gt;
</content>
</entry>
<entry>
<title>cgit: truncate all config values at the newline</title>
<updated>2026-05-04T16:28:27Z</updated>
<author>
<name>Jason A. Donenfeld</name>
<email>Jason@zx2c4.com</email>
</author>
<published>2026-05-04T16:13:13Z</published>
<link rel='alternate' type='text/html' href='https://sayag.it/cgitext.git/commit/?id=ed05b1054df10a2fbc68000cfdd429daec03a456'/>
<id>urn:sha1:ed05b1054df10a2fbc68000cfdd429daec03a456</id>
<content type='text'>
These would be largely invalid anyway (save, I suppose, for Linux file
paths that technically can contain new lines).

The actual problem is that these get printed back out into cached -- and
trusted -- cgitrc files, and if the fields have newlines, the git-config
way of less trusted users configuring repos on a shared system can be
abused to inject newlines, which then can be used to smuggle global
options (including filters, which execute code) into the cached cgitrc.

So now, only ever duplicate up to the newline, when dealing with these
inputs.

Reported-by: Adrian Denkiewicz &lt;adrian@doyensec.com&gt;
Signed-off-by: Jason A. Donenfeld &lt;Jason@zx2c4.com&gt;
</content>
</entry>
<entry>
<title>cgit: use strchrnul instead of open coding</title>
<updated>2026-05-04T16:28:27Z</updated>
<author>
<name>Jason A. Donenfeld</name>
<email>Jason@zx2c4.com</email>
</author>
<published>2026-05-04T16:02:57Z</published>
<link rel='alternate' type='text/html' href='https://sayag.it/cgitext.git/commit/?id=e7e8cf1801b06a9f7f5092671b0413689a765fe7'/>
<id>urn:sha1:e7e8cf1801b06a9f7f5092671b0413689a765fe7</id>
<content type='text'>
Signed-off-by: Jason A. Donenfeld &lt;Jason@zx2c4.com&gt;
</content>
</entry>
<entry>
<title>cgit: devirtualize repo_config</title>
<updated>2026-05-04T16:28:27Z</updated>
<author>
<name>Jason A. Donenfeld</name>
<email>Jason@zx2c4.com</email>
</author>
<published>2026-05-04T15:50:43Z</published>
<link rel='alternate' type='text/html' href='https://sayag.it/cgitext.git/commit/?id=5b4e73c203f5f4484d66f043f1e9114daefeb632'/>
<id>urn:sha1:5b4e73c203f5f4484d66f043f1e9114daefeb632</id>
<content type='text'>
There's no reason to pass around function pointers. It was never used
for anything beyond one function.

Signed-off-by: Jason A. Donenfeld &lt;Jason@zx2c4.com&gt;
</content>
</entry>
<entry>
<title>cgit: override die routine globally</title>
<updated>2026-03-10T21:19:00Z</updated>
<author>
<name>Jason A. Donenfeld</name>
<email>Jason@zx2c4.com</email>
</author>
<published>2026-03-10T20:26:55Z</published>
<link rel='alternate' type='text/html' href='https://sayag.it/cgitext.git/commit/?id=0d8e5fbc31e1082063bfb5155c35b7869721152b'/>
<id>urn:sha1:0d8e5fbc31e1082063bfb5155c35b7869721152b</id>
<content type='text'>
We don't get any return value from compile_grep_patterns calling
compile_regexp_failed, causing the default die routine to print to
stderr and then for cgit to exit ungracefully.

Instead override the default die routine to show a normal error page.

Perhaps compile_grep_patterns ought to change upstream to return an
error. But this commit here will handle future issues as well, so
perhaps not a bad idea to do anyway.

Link: https://lists.zx2c4.com/pipermail/cgit/2026-March/004982.html
Link: https://lists.zx2c4.com/pipermail/cgit/2026-March/004983.html
Reported-by: Adrian C. &lt;anrxc@sysphere.org&gt;
Reported-by: Aiden Woodruff &lt;aiden@aidenw.net&gt;
Signed-off-by: Jason A. Donenfeld &lt;Jason@zx2c4.com&gt;
</content>
</entry>
<entry>
<title>ui-log: allow link following to be disabled per-repo</title>
<updated>2026-02-24T10:49:35Z</updated>
<author>
<name>Jason A. Donenfeld</name>
<email>Jason@zx2c4.com</email>
</author>
<published>2026-02-24T10:48:54Z</published>
<link rel='alternate' type='text/html' href='https://sayag.it/cgitext.git/commit/?id=0d28d54f0a287ee3e5a12d14ffd2ee23b5e22d76'/>
<id>urn:sha1:0d28d54f0a287ee3e5a12d14ffd2ee23b5e22d76</id>
<content type='text'>
This exists for other CPU heavy operations like blame, but doesn't for
the follow functionality. Add it for that.

Signed-off-by: Jason A. Donenfeld &lt;Jason@zx2c4.com&gt;
</content>
</entry>
</feed>
