* [PATCH 5/5] viewdiff: document constants
2019-04-05 20:04 6% [PATCH 0/5] a few more cgit compatibility updates Eric Wong
@ 2019-04-05 20:04 7% ` Eric Wong
0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2019-04-05 20:04 UTC (permalink / raw)
To: meta
We'll be building off of this for showing diffs in
the coderepo views.
---
lib/PublicInbox/ViewDiff.pm | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/lib/PublicInbox/ViewDiff.pm b/lib/PublicInbox/ViewDiff.pm
index a773e38..0cce952 100644
--- a/lib/PublicInbox/ViewDiff.pm
+++ b/lib/PublicInbox/ViewDiff.pm
@@ -15,12 +15,16 @@ use URI::Escape qw(uri_escape_utf8);
use PublicInbox::Hval qw(ascii_html to_attr from_attr);
use PublicInbox::Git qw(git_unquote);
+# keep track of state so we can avoid redundant HTML tags for
+# identically-classed lines
sub DSTATE_INIT () { 0 }
sub DSTATE_STAT () { 1 }
sub DSTATE_HEAD () { 2 } # /^diff --git /, /^index /, /^--- /, /^\+\+\+ /
sub DSTATE_CTX () { 3 } # /^ /
sub DSTATE_ADD () { 4 } # /^\+/
sub DSTATE_DEL () { 5 } # /^\-/
+
+# maps the DSTATE_* to CSS class names compatible with what cgit uses:
my @state2class = (
'', # init
'', # stat
--
EW
^ permalink raw reply related [relevance 7%]
* [PATCH 0/5] a few more cgit compatibility updates
@ 2019-04-05 20:04 6% Eric Wong
2019-04-05 20:04 7% ` [PATCH 5/5] viewdiff: document constants Eric Wong
0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2019-04-05 20:04 UTC (permalink / raw)
To: meta
This all needs tests, but Works For Me right now...
Eric Wong (5):
config: support cgit scan-path and scan-hidden-path
cgit: serve static css, logo, favicon directly
config: support more cgit directives for project lists
doc/config: update cgit.cgi scan location
viewdiff: document constants
Documentation/public-inbox-config.pod | 2 +-
lib/PublicInbox/Cgit.pm | 41 ++++++++++++-
lib/PublicInbox/Config.pm | 107 +++++++++++++++++++++++++++++++---
lib/PublicInbox/GitHTTPBackend.pm | 62 +++++++++++---------
lib/PublicInbox/ViewDiff.pm | 4 ++
5 files changed, 174 insertions(+), 42 deletions(-)
--
EW
^ permalink raw reply [relevance 6%]
Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2019-04-05 20:04 6% [PATCH 0/5] a few more cgit compatibility updates Eric Wong
2019-04-05 20:04 7% ` [PATCH 5/5] viewdiff: document constants Eric Wong
Code repositories for project(s) associated with this public inbox
https://80x24.org/public-inbox.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).