Re: RFE: commit git-patch-id lookup links

2022-10-07 Thread Eric Wong
Konstantin Ryabitsev wrote: > Hi, all: > > One of the recent additions to public-inbox was auto-indexing of patches by > their patch-id (see git-patch-id.1). This allows to see a history of many > commits through public-inbox discussions. Using a random commit as an example: > >

[PATCH (resend)] use buffered stdio

2021-03-19 Thread Eric Wong
=/mirrors/git.git/diff export QUERY_STRING PATH_INFO time ./cgit >/dev/null Before: real0m1.585s user0m0.904s sys 0m0.658s After: real0m0.750s user0m0.666s sys 0m0.076s Signed-off-by: Eric Wong --- I've been running this with Lua commit filter for the past two ye

[PATCH 3/5] ui-log: improve decoration display for browsers without CSS

2021-03-19 Thread Eric Wong
Text-based browsers without CSS support show all the decorations bunched together without spacing. Rely on a whitespace instead of CSS support. Signed-off-by: Eric Wong --- cgit.css | 1 - ui-log.c | 5 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/cgit.css b/cgit.css

[PATCH (resend) 0/5] improve rendering w/o CSS reliance

2021-03-19 Thread Eric Wong
mplete CSS support. The only incompatible (with existing CSS customisations) change might be the one to use instead of for commit-msg. I'm not sure how much of a stable interface the CSS styles are expected to be for this project. Eric Wong (5): ui-shared: improve pageheader display on

[PULL (resend)] improve rendering w/o CSS reliance

2021-03-19 Thread Eric Wong
ss for you to fetch changes up to ab8ff5295cfed27f6c827600fed28376b4540bb4: ui-{tree,repolist}: improve button spacing for browsers w/o CSS (2021-03-19 20:17:01 +) ---- Eric Wong (5): ui-shared: improve pageheader display on

[PATCH 4/5] ui-diff: preserve spaces w/o CSS on context lines

2021-03-19 Thread Eric Wong
We need to use a non-breaking space entity to preserve spacing for browsers without CSS support. Signed-off-by: Eric Wong --- html.c| 46 ++ html.h| 1 + ui-diff.c | 5 + 3 files changed, 48 insertions(+), 4 deletions(-) diff --git

[PATCH 5/5] ui-{tree, repolist}: improve button spacing for browsers w/o CSS

2021-03-19 Thread Eric Wong
For browsers on low-end machines running browsers without CSS support, the default tree view displayed "logplain" when it should be "log plain". Stop relying on CSS and add a space in between elements to improve accessibility. Signed-off-by: Eric Wong --- cgit.css |

[PATCH (resend)] ui-stats.c: fix warning on 32-bit

2021-03-19 Thread Eric Wong
has type ‘unsigned int’ [-Wformat=] > htmlf("%lu", (uintptr_t)date->util); > ^ Signed-off-by: Eric Wong --- ui-stats.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ui-stats.c b/ui-stats.c index 09b3625..ad22dae 100644 --- a

Re: [PATCH 0/4] improve rendering w/o CSS reliance

2020-02-08 Thread Eric Wong
Eric Wong wrote: > Here are a few changes to improve rendering for people with > low-end machines using text-based browsers (w3m, lynx) or > lightweight GUI browsers such as dillo, which has incomplete CSS > support. Ping. Any feedback on this ser

[PATCH v2] ui-ssdiff: get rid of strncat

2019-04-21 Thread Eric Wong
strncat is slow and error-prone, use the git strbuf API instead. We can steal much of our logic from git/pretty.c::strbuf_add_tabexpand, but maybe keep the invalid characters for now *shrug*. --- v2: call "strbuf_add(, line, linelen);" at the end to ensure tab-less lines are shown. ui-ssdiff.c

Re: [PATCH] ui-repolist, ui-shared: remove redundant title on repo anchors

2019-04-02 Thread Eric Wong
Chris Mayo wrote: > The title attribute was being set to the same value as the anchor > element text. > > Signed-off-by: Chris Mayo I am not an HTML expert; but it looks like a reasonable change to avoid the redundant tooltip. Acked-b

[RFC] remove "diff" link at top bar?

2019-04-02 Thread Eric Wong
I've been running this for a few months, now, but forgot to send it out for review. Perhaps I'm missing something obvious, but I've never understood the purpose exposing the "diff" endpoint at the top navigation bar... The following applies on top of my: "ui-shared: improve pageheader display on

Re: [PATCH v2 1/1] ui-ssdiff: ban strncat()

2019-02-13 Thread Eric Wong
Christian Hesse wrote: > From: Christian Hesse > > Git version v2.21.0 marks strncat() as banned (commit > ace5707a803eda0f1dde3d776dc3729d3bc7759a), so replace it. Btw, I posted a similar-in-spirit patch to replace strncat in ui-ssdiff.c back in January: <20190102073710.580-...@80x24.org> It

Re: [RFC] use buffered stdio (lightly tested)

2019-01-05 Thread Eric Wong
In the future, I think it could be even more beneficial to buffer to zlib (if the client accepts gzip) and bypass stdio buffering in those cases. Smaller responses via gzip means less IPC overhead and wakeups for the reader. cgit is linked against zlib anyways because of git, so no extra

[PATCH 5/4] ui-{tree,repolist}: improve button spacing for browsers w/o CSS

2019-01-04 Thread Eric Wong
For browsers on low-end machines running browsers without CSS support, the default tree view displayed "logplain" when it should be "log plain". Stop relying on CSS and add a space in between elements to improve accessibility. --- cgit.css | 1 - ui-repolist.c | 2 ++ ui-tree.c | 12

Re: [PATCH 4/4] ui-diff: preserve spaces w/o CSS on context lines

2019-01-04 Thread Eric Wong
Eric Wong wrote: > We need to use a non-breaking space entity to preserve > spacing for browsers without CSS support. Btw, an alternative patch which could save bandwidth but possibly break compatibility with existing CSS would be to wrap the whole diff area in a , and use i

Re: [RFC] use buffered stdio (lightly tested)

2019-01-02 Thread Eric Wong
> index 70f5b74..2c387c1 100644 > --- a/filter.c > +++ b/filter.c > @@ -143,22 +145,22 @@ void cgit_init_filters(void) > #endif > > #ifndef NO_LUA > -static ssize_t (*libc_write)(int fd, const void *buf, size_t count); > +static ssize_t (*libc_fwrite)(const void *buf, size_t size, size_t n,

[PATCH] ui-ssdiff: get rid of strncat

2019-01-01 Thread Eric Wong
strncat is slow and error-prone, use the git strbuf API instead. We can steal much of our logic from git/pretty.c::strbuf_add_tabexpand, but maybe keep the invalid characters for now *shrug*. --- ui-ssdiff.c | 58 +++-- 1 file changed, 25

[PATCH] ui-shared: fix segfault in cgit_set_title_from_path

2019-01-01 Thread Eric Wong
The following invocation of strncat uses a bogus size and caused segfaults on my system: strncat(new_title, ctx.page.title, sizeof(new_title) - strlen(new_title) - 1); Since str*cat functions are all bug-prone and slow (need to search for '\0' at every invocation), switch to the safer and

[PATCH 4/4] ui-diff: preserve spaces w/o CSS on context lines

2019-01-01 Thread Eric Wong
We need to use a non-breaking space entity to preserve spacing for browsers without CSS support. --- html.c| 46 ++ html.h| 1 + ui-diff.c | 5 + 3 files changed, 48 insertions(+), 4 deletions(-) diff --git a/html.c b/html.c index

[PATCH 3/4] ui-log: improve decoration display for browsers without CSS

2019-01-01 Thread Eric Wong
Text-based browsers without CSS support show all the decorations bunched together without spacing. Rely on a whitespace instead of CSS support. --- cgit.css | 1 - ui-log.c | 5 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/cgit.css b/cgit.css index 9f70d14..6fcd984 100644

[PATCH 1/4] ui-shared: improve pageheader display on text-based browsers

2019-01-01 Thread Eric Wong
Text-based browsers (and some GUI browsers such as dillo) display the pageheader as: "summaryrefslogtreecommitdiff" This is difficult-to-read. Improve accessibility for users who cannot run memory-hungry browsers by using whitespace instead of relying on CSS. --- cgit.css| 1 -

[PATCH 0/4] improve rendering w/o CSS reliance

2019-01-01 Thread Eric Wong
and uniform font-size all around to make it easier for people who need to use gigantic fonts). Eric Wong (4): ui-shared: improve pageheader display on text-based browsers ui-{commit,tag}: use for commit-msg ui-log: improve decoration display for browsers without CSS ui-diff: preserve spaces w/o

[PATCH] ui-stats.c: fix warning on 32-bit

2018-12-31 Thread Eric Wong
gcc 6.3.0-18 on Debian stable emits the following warning, despite uintptr_t and "unsigned long" having the same size: > ../ui-stats.c: In function ‘print_authors’: > ../ui-stats.c:340:18: warning: format ‘%lu’ expects argument of type ‘long > unsigned int’, but argument 2 has type ‘unsigned

[PATCH] ui-patch: fix segfault when a path prefix is passed

2017-01-22 Thread Eric Wong
From: Eric Wong <e...@80x24.org> pathspec.c::parse_pathspec in git assumes the `argv' array is terminated with a NULL entry, so do not let it iterate past the end of the array. Signed-off-by: Eric Wong <e...@80x24.org> --- ui-patch.c | 2 +- 1 file changed, 1 insertion(+), 1 delet

[PATCH] ui-shared: fix segfault when defbranch is NULL

2016-07-06 Thread Eric Wong
Not sure if there's a better fix for this. defbranch is NULL here on my setup when a crawler hit an invalid URL, causing strcmp to segfault. Signed-off-by: Eric Wong <normalper...@yhbt.net> --- ui-shared.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui-shared.

Re: trailing slash page canonicalization

2016-05-15 Thread Eric Wong
"Jason A. Donenfeld" wrote: > We have another potential issue, however. git.zx2c4.com/cgit and > git.zx2c4.com/cgit/ have the same content, yet different URLs. This > might be looked upon unfavorably by search engines. One rectification > is to add a meta tag. Another, and one

Re: Killing plaintext git:// in favor of https:// cloning

2016-02-22 Thread Eric Wong
"Jason A. Donenfeld" <ja...@zx2c4.com> wrote: > On Tue, Feb 23, 2016 at 2:19 AM, Eric Wong <normalper...@yhbt.net> wrote: > > git already has plenty of integrity checking built-in and > > getting the proper hashes for the heads/tags over a > > trusted-e

Re: Policy on global variables

2014-01-16 Thread Eric Wong
Lars Hjemli hje...@gmail.com wrote: On Thu, Jan 16, 2014 at 2:00 AM, Jason A. Donenfeld ja...@zx2c4.com wrote: On Thu, Jan 16, 2014 at 1:59 AM, Eric Wong normalper...@yhbt.net wrote: This. I prefer we keep passing around the ctx variable to keep the code more flexible for future reuse

Re: Policy on global variables

2014-01-15 Thread Eric Wong
Jason A. Donenfeld ja...@zx2c4.com wrote: In theory, passing around the variable, and not relying on a global, is better. It allows us at somepoint to have multiple contexts, for, say, implementing FastCGI or an event loop single-process multi response model. This. I prefer we keep passing