flask does not document this well, but url rule converters apparently
*can* accept arguments, and one of them is for providing a limited
choice of values. Use this to restrict the formats to the list of
supported formats, which we hardcode because it must be built into the
string.
This avoids interpreting 1.0.tar.gz.asc as tag="1", format=".0.tar.gz"
which causes the server to explode.
For any available tarball {gitref}.tar.gz, attempt to see if there is a
`git notes` attachment in:
refs/signatures/tar -> {gitref}.tar.asc
refs/signatures/tar.gz -> {gitref}.tar.gz.asc
cgit supports this for any of its configurable archive compression
formats, and additionally always supports delivering the signature for an
uncompressed tarball.
This is useful in at least two cases:
- Some people may mirror to, or migrate between, multiple forges,
including cgit with lots of compression formats enabled. One notes
attachment then works for all formats.
- git-archive guarantees to be a fully stable tarball output format, but
the compressor program it pipes to may not be, depending on
implementation (GNU gzip is, busybox gzip used to not be but now is,
zstd dedicatedly breaks output reproducibility on every release).
Some people rely on this, some people don't.
Since sourcehut only supports tar.gz, only tar.gz-compatible signatures
are implemented here.
Implements https://todo.sr.ht/~sircmpwn/git.sr.ht/231
If a commit is old enough, it won't appear on the first page of the
git log, which means that the anchor in the URL won't work.
This change makes it so that the link always goes to a log page where
the commit is visible.
Note: This same change will fix the same issue for links on the log
page.
Fetch one more commit from get_log and only display a "next" link if it
exists. The current logic checks whether the last commit in the list
has a parent. This doesn't work if the log is shown for a path, because
when the first commit for the path is not the initial commit it has a
parent, but there are no more log entries for the path.
The parameter name for the template is copied from hg.sr.ht which solves
this problem with an additional return parameter from get_log.
Fixing issue on low resolutions / narrow screens where the breadcrumb
menu items overlap under the reference items to the right. This is
closer to the hg.sr.ht layout which wraps on narrow screens.