2
0
mirror of https://git.zx2c4.com/cgit synced 2025-08-22 01:50:26 +00:00

Compare commits

...

10 Commits

Author SHA1 Message Date
Kian Kasad
0be190ca5a scan-tree: fix error caused by missing parameter name
This fixes an error which was introduced by
2f50b47c72cbc4270bbd12ae7f520486d5f42736. Git 2.42.0 added a new argument
to config_fn_t, and it was added to gitconfig_config(), but not named.
This causes compile warnings/errors. This commit fixes that by naming the
new parameter, and marking it unused.
2025-07-08 20:00:23 +02:00
Jason A. Donenfeld
7fe1597a2a steal kernel.org's libravatar lua 2025-07-08 20:00:23 +02:00
Christian Hesse
1fae1a2c33 ui-tree: add about link in tree view list
Signed-off-by: Christian Hesse <mail@eworm.de>
2025-07-08 20:00:23 +02:00
Christian Hesse
42bee9ae69 ui-tree: provide link to about page for pretty formatting
We have an ongoing discussion about display filters and pretty
formatting in tree view. How about providing a link to about page
for pretty formatting?

Signed-off-by: Christian Hesse <mail@eworm.de>
2025-07-08 20:00:23 +02:00
Christian Hesse
707746ce09 ui-log: build ellipsis from bullets
These look cleaner... IMHO. 😜

Signed-off-by: Christian Hesse <mail@eworm.de>
2025-07-08 20:00:23 +02:00
Christian Hesse
3b2ad50785 ui-log: show commit message in tooltip
... now that we have the ellipsis to indicate it is available.

Signed-off-by: Christian Hesse <mail@eworm.de>
2025-07-08 20:00:23 +02:00
Christian Hesse
d296ca41ad ui-log: show ellipsis if detailed commit message is available
The existence of a detailed commit message may be of interst even
if only the subject is shown by default.

Signed-off-by: Christian Hesse <mail@eworm.de>
2025-07-08 20:00:23 +02:00
Christian Hesse
243843502d css: round border edges for deco
Signed-off-by: Christian Hesse <mail@eworm.de>
2025-07-08 20:00:23 +02:00
Loïc
89dd3df705 css: highlight line in diff...
... specified in the URL, with a curved arrow ahead of the line number.

Signed-off-by: Loïc <lagiraudiere+cgit@free.fr>
Signed-off-by: Christian Hesse <mail@eworm.de>
2025-07-08 20:00:23 +02:00
Christian Hesse
20ac8f55d4 git: update to v2.50.1
Update to git version v2.50.1, no additional changes required.

Signed-off-by: Christian Hesse <mail@eworm.de>
2025-07-08 20:00:23 +02:00
9 changed files with 114 additions and 3 deletions

View File

@ -14,7 +14,7 @@ htmldir = $(docdir)
pdfdir = $(docdir)
mandir = $(prefix)/share/man
SHA1_HEADER = <openssl/sha.h>
GIT_VER = 2.50.0
GIT_VER = 2.50.1
GIT_URL = https://www.kernel.org/pub/software/scm/git/git-$(GIT_VER).tar.xz
INSTALL = install
COPYTREE = cp -r

View File

@ -330,6 +330,11 @@ div#cgit table.ssdiff td.lineno a:hover {
color: black;
}
div#cgit table.blob td.linenumbers a:target:before {
color: red;
content: "\2BA9";
}
div#cgit table.blame td.hashes,
div#cgit table.blame td.lines,
div#cgit table.blame td.linenumbers {
@ -673,12 +678,40 @@ div#cgit div.footer a:hover {
text-decoration: underline;
}
div#cgit span.msg-avail {
color: #000;
margin: 0px 0.5em;
padding: 0px 0.25em;
background-color: #f0f0f0;
border: solid 1px #777777;
border-radius: 5px;
}
div#cgit span.msg-avail span.msg-tooltip {
color: #000;
margin: 0px 0.5em;
padding: 0px 0.25em;
background-color: #f0f0f0;
border: solid 1px #777777;
border-radius: 5px;
box-shadow: 2px 2px 7px rgba(100,100,100,0.75);
visibility: hidden;
position: absolute;
white-space: pre;
z-index: 1;
}
div#cgit span.msg-avail:hover span.msg-tooltip {
visibility: visible;
}
div#cgit a.branch-deco {
color: #000;
margin: 0px 0.5em;
padding: 0px 0.25em;
background-color: #88ff88;
border: solid 1px #007700;
border-radius: 2px;
}
div#cgit a.tag-deco {
@ -687,6 +720,7 @@ div#cgit a.tag-deco {
padding: 0px 0.25em;
background-color: #ffff88;
border: solid 1px #777700;
border-radius: 2px;
}
div#cgit a.tag-annotated-deco {
@ -695,6 +729,7 @@ div#cgit a.tag-annotated-deco {
padding: 0px 0.25em;
background-color: #ffcc88;
border: solid 1px #777700;
border-radius: 2px;
}
div#cgit a.remote-deco {
@ -703,6 +738,7 @@ div#cgit a.remote-deco {
padding: 0px 0.25em;
background-color: #ccccff;
border: solid 1px #000077;
border-radius: 2px;
}
div#cgit a.deco {
@ -711,6 +747,7 @@ div#cgit a.deco {
padding: 0px 0.25em;
background-color: #ff8888;
border: solid 1px #770000;
border-radius: 2px;
}
div#cgit div.commit-subject a.branch-deco,
@ -897,3 +934,31 @@ div#cgit table.ssdiff td.space {
div#cgit table.ssdiff td.space div {
min-height: 3em;
}
div#cgit span.libravatar img.onhover {
display: none;
border: 1px solid gray;
padding: 0px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
width: 128px;
height: 128px;
}
div#cgit span.libravatar img.inline {
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
width: 13px;
height: 13px;
margin-right: 0.2em;
opacity: 0.6;
}
div#cgit span.libravatar:hover > img.onhover {
display: block;
position: absolute;
margin-left: 1.5em;
background-color: #eeeeee;
box-shadow: 2px 2px 7px rgba(100,100,100,0.75);
}

View File

@ -0,0 +1,25 @@
local digest = require("openssl.digest")
function md5_hex(input)
local b = digest.new("md5"):final(input)
local x = ""
for i = 1, #b do
x = x .. string.format("%.2x", string.byte(b, i))
end
return x
end
function filter_open(email, page)
buffer = ""
hexdigest = md5_hex(email:sub(2, -2):lower())
end
function filter_close()
baseurl = os.getenv("HTTPS") and "https://seccdn.libravatar.org/" or "http://cdn.libravatar.org/"
html("<span class='libravatar'><img class='inline' src='" .. baseurl .. "avatar/" .. hexdigest .. "?s=13&amp;d=retro' /><img class='onhover' src='" .. baseurl .. "avatar/" .. hexdigest .. "?s=128&amp;d=retro' /></span>" .. buffer)
return 0
end
function filter_write(str)
buffer = buffer .. str
end

2
git

@ -1 +1 @@
Subproject commit 16bd9f20a403117f2e0d9bcda6c6e621d3763e77
Subproject commit d82adb61ba2fd11d8f2587fca1b6bd7925ce4044

View File

@ -54,7 +54,8 @@ static void scan_tree_repo_config(const char *name, const char *value)
config_fn(repo, name, value);
}
static int gitconfig_config(const char *key, const char *value, const struct config_context *, void *cb)
static int gitconfig_config(const char *key, const char *value,
const __attribute__((unused)) struct config_context *ctx, void *cb)
{
const char *name;

View File

@ -243,6 +243,11 @@ static void print_commit(struct commit *commit, struct rev_info *revs)
}
cgit_commit_link(info->subject, NULL, NULL, ctx.qry.head,
oid_to_hex(&commit->object.oid), ctx.qry.vpath);
if (!ctx.qry.showmsg && info->msg && *(info->msg)) {
html("<span class='msg-avail'>&bull;&bull;&bull;<span class='msg-tooltip'>");
html_txt(info->msg);
html("</span></span>");
}
show_commit_decorations(commit);
html("</td><td>");
cgit_open_filter(ctx.repo->email_filter, info->author_email, "log");

View File

@ -348,6 +348,12 @@ void cgit_tree_link(const char *name, const char *title, const char *class,
reporevlink("tree", name, title, class, head, rev, path);
}
void cgit_about_link(const char *name, const char *title, const char *class,
const char *head, const char *rev, const char *path)
{
reporevlink("about", name, title, class, head, rev, path);
}
void cgit_plain_link(const char *name, const char *title, const char *class,
const char *head, const char *rev, const char *path)
{

View File

@ -24,6 +24,9 @@ extern void cgit_tag_link(const char *name, const char *title,
extern void cgit_tree_link(const char *name, const char *title,
const char *class, const char *head,
const char *rev, const char *path);
extern void cgit_about_link(const char *name, const char *title,
const char *class, const char *head,
const char *rev, const char *path);
extern void cgit_plain_link(const char *name, const char *title,
const char *class, const char *head,
const char *rev, const char *path);

View File

@ -112,6 +112,9 @@ static void print_object(const struct object_id *oid, const char *path, const ch
cgit_print_layout_start();
htmlf("blob: %s (", oid_to_hex(oid));
cgit_about_link("about", NULL, NULL, ctx.qry.head,
rev, path);
html(") (");
cgit_plain_link("plain", NULL, NULL, ctx.qry.head,
rev, path);
if (ctx.repo->enable_blame && !is_binary) {
@ -269,6 +272,9 @@ static int ls_item(const struct object_id *oid, struct strbuf *base,
if (!S_ISGITLINK(mode))
cgit_plain_link("plain", NULL, "button", ctx.qry.head,
walk_tree_ctx->curr_rev, fullpath.buf);
if (!S_ISDIR(mode))
cgit_about_link("about", NULL, "button", ctx.qry.head,
walk_tree_ctx->curr_rev, fullpath.buf);
if (!S_ISDIR(mode) && ctx.repo->enable_blame)
cgit_blame_link("blame", NULL, "button", ctx.qry.head,
walk_tree_ctx->curr_rev, fullpath.buf);