]> git.ipfire.org Git - thirdparty/public-inbox.git/log
thirdparty/public-inbox.git
9 years agorepobrowse: snapshot support for cgit compatibility
Eric Wong [Mon, 4 Apr 2016 21:09:19 +0000 (21:09 +0000)] 
repobrowse: snapshot support for cgit compatibility

We currently do not display links to snapshots, but may in the
future (optionally, like cgit).  However, support snapshots for
compatibility reasons in case people had cached URLs or
auto-generated them somewhere.

We won't natively support xz and bzip2 just yet, but will
document (at least in comments) how to enable these expensive
compression schemes via git-config(1).  Also, support disabling
certain archive types to twart URL guessing or old cached links
from spiders burning bandwidth.

In retrospect, enabling snapshots for my own cgit views was a
bad idea since it wastes bandwidth from crawlers and is
is often not useful for users with maintainer-built files
(e.g. "configure" from "configure.ac" for autoconf, where
 only the latter is stored in git and the former is
 generated in release tarballs).

9 years agotest: disable warning for Plack::Test::Impl
Eric Wong [Tue, 5 Apr 2016 03:31:31 +0000 (03:31 +0000)] 
test: disable warning for Plack::Test::Impl

Not sure of a better way around this, but the Plack::Test
manpage documents this variable so it should be supported.

9 years agorepobrowse: avoid confusing linkification for "diff"
Eric Wong [Thu, 31 Mar 2016 03:39:06 +0000 (03:39 +0000)] 
repobrowse: avoid confusing linkification for "diff"

In /diff/ and /commit/ endpoints, making the word "diff"
a link to the top of the diff is not very useful and may
be confusing.  Avoid wasting bandwidth and overloading
the reader with potential options.

9 years agorepobrowse: git commit view uses pi-httpd.async
Eric Wong [Wed, 30 Mar 2016 18:51:27 +0000 (18:51 +0000)] 
repobrowse: git commit view uses pi-httpd.async

diff generation takes an indeterminate amount of time,
so avoid blocking our -httpd process if possible and
rely on Danga::Socket.  This falls back to synchronous
execution as does the rest of public-inbox WWW code.

9 years agorepobrowse: more consistent variable naming for /commit/
Eric Wong [Tue, 29 Mar 2016 21:45:37 +0000 (21:45 +0000)] 
repobrowse: more consistent variable naming for /commit/

We avoid creating an extra hashref to share more code
with the /diff/ view.  Furthermore, more preparation for
making the /commit/ view use Danga::Socket

9 years agorepobrowse: show roughly equivalent "diff-tree" invocation
Eric Wong [Tue, 29 Mar 2016 20:30:54 +0000 (20:30 +0000)] 
repobrowse: show roughly equivalent "diff-tree" invocation

This will make it easier to show how the diff output
was generated and hopefully teach users to use the
git command-line.

9 years agorepobrowse: reduce local variables for state management
Eric Wong [Tue, 29 Mar 2016 17:30:32 +0000 (17:30 +0000)] 
repobrowse: reduce local variables for state management

Hopefully this makes it easier to reuse code.

9 years agorepobrowse: summary handles multiple README types
Eric Wong [Mon, 14 Mar 2016 21:23:28 +0000 (21:23 +0000)] 
repobrowse: summary handles multiple README types

git.git uses README.md, nowadays, but older revisions
used plain old README.  Handle both out-of-the box.

9 years agorepobrowse: remove bold decorations from diff view
Eric Wong [Mon, 14 Mar 2016 20:59:08 +0000 (20:59 +0000)] 
repobrowse: remove bold decorations from diff view

It is too noisy and still hurts readability on some
displays.

9 years agorepobrowse: common git diff parsing code
Eric Wong [Mon, 14 Mar 2016 18:20:16 +0000 (18:20 +0000)] 
repobrowse: common git diff parsing code

This reduces the amount of duplicated code between the
"diff" and "commit" views of repobrowse.

9 years agorepobrowse: implement diff view for compatibility
Eric Wong [Sat, 12 Mar 2016 03:41:29 +0000 (03:41 +0000)] 
repobrowse: implement diff view for compatibility

This needs to be cleaned up, but we shall support the
(potentially very expensive) diff view between arbitrary
revisions to avoid breaking existing URLs.

The diff parsing code will need to be consolidated
between this and the commit view.

9 years agoexamples/repobrowse.psgi: disable Chunked response by default
Eric Wong [Sat, 12 Mar 2016 03:41:12 +0000 (03:41 +0000)] 
examples/repobrowse.psgi: disable Chunked response by default

It seems incompatible with Starman and probably confuses other
HTTP/1.0-only servers, too.  Our -httpd will respect it and
requires it for persistent connections.

Followup-to: dca2724e0aeb ("examples: disable Chunked response in PSGI example")
9 years agoexamples/repobrowse.psgi: consistent variable naming
Eric Wong [Sat, 12 Mar 2016 03:41:11 +0000 (03:41 +0000)] 
examples/repobrowse.psgi: consistent variable naming

We've been trying to avoid the underscore in "repobrowse"
to shorten things.

9 years agorepobrowse: remove unused params in git commit view
Eric Wong [Sat, 12 Mar 2016 00:23:33 +0000 (00:23 +0000)] 
repobrowse: remove unused params in git commit view

No point in wasting stack space for that.

9 years agotests: consolidate repobrowse + httpd integration
Eric Wong [Tue, 8 Mar 2016 04:36:17 +0000 (04:36 +0000)] 
tests: consolidate repobrowse + httpd integration

Use Plack::Test::ExternalServer to simplify our test code
and prepare to add more tests for future changes.

Add a check for patch generation while we're at it, since
patch generation may use our internal "pi.async" API.

9 years agogit-http-backend: check EINTR as well as EAGAIN
Eric Wong [Mon, 7 Mar 2016 19:10:33 +0000 (19:10 +0000)] 
git-http-backend: check EINTR as well as EAGAIN

The blocking PSGI server may cause EINTR to be hit, here.

9 years agorepobrowse: stream git patch output with Danga::Socket
Eric Wong [Mon, 7 Mar 2016 08:10:59 +0000 (08:10 +0000)] 
repobrowse: stream git patch output with Danga::Socket

This should allow better concurrency in case git-format-patch
needs to take a long time for merge commits.

9 years agorepobrowse: improve API consistency, harder
Eric Wong [Mon, 7 Mar 2016 08:10:58 +0000 (08:10 +0000)] 
repobrowse: improve API consistency, harder

This allows RepobrowseConfig objects to passed directly
to Repobrowse initialization, similar to the way the normal
Config can be passed to WWW at initialization.

9 years agoexamples/repobrowse.psgi: modernize w.r.t public-inbox.psgi
Eric Wong [Mon, 7 Mar 2016 08:10:57 +0000 (08:10 +0000)] 
examples/repobrowse.psgi: modernize w.r.t public-inbox.psgi

We want to be consistent between the standard PSGI examples
to lower the learning curve.

9 years agorepobrowse: standardize interface a bit
Eric Wong [Mon, 7 Mar 2016 08:10:56 +0000 (08:10 +0000)] 
repobrowse: standardize interface a bit

Make it closer to what the existing WWW interface is since
we no longer rely on CGI.pm

9 years agorepobrowse: git fallback allows smart cloning
Eric Wong [Mon, 7 Mar 2016 08:10:55 +0000 (08:10 +0000)] 
repobrowse: git fallback allows smart cloning

We can reuse the existing code for cloning ssoma repositories
to serve normal git repos for repobrowse.

Also, this finally adds a test to fallback to dumb cloning when
http.uploadPack is disabled for the git repository to save
CPU/memory on the host machine.

9 years agogit-http-backend: fallback to dumb when smart is disabled
Eric Wong [Mon, 7 Mar 2016 08:10:54 +0000 (08:10 +0000)] 
git-http-backend: fallback to dumb when smart is disabled

We broke this fallback when we became more callback driven
and a test will come in the next commit.

However, our dumb cloning is still subject to scheduling
monopolization when serving gigantic packs.  Scheduling
will be fixed at a later time.

Fixes: b44af5d8f2fb ("git-http-backend: start refactoring to use callback")
9 years agorepobrowse: shorten env name to REPOBROWSE_CONFIG
Eric Wong [Sat, 5 Mar 2016 07:47:10 +0000 (07:47 +0000)] 
repobrowse: shorten env name to REPOBROWSE_CONFIG

...From PI_REPOBROWSE_CONFIG.  The "PI_" prefix is
a bit too long and "repobrowse" is nearly an independent
project at this point from a user-perspective.

9 years agorepobrowse: git commit is more callback driven
Eric Wong [Sun, 28 Feb 2016 03:35:07 +0000 (03:35 +0000)] 
repobrowse: git commit is more callback driven

We'll be moving to Danga::Socket for giant diff generation in
future commits.  So this is a step towards being more
callback-driven...

9 years agogit: support an error tmpfile for stashing stderr output
Eric Wong [Thu, 3 Mar 2016 03:12:12 +0000 (03:12 +0000)] 
git: support an error tmpfile for stashing stderr output

This should allow us to avoid polluting stderr output when
HTTP clients inevitably request broken revisions.

9 years agogit: support arbitrary redirects and env settings on popen
Eric Wong [Sun, 28 Feb 2016 04:23:53 +0000 (04:23 +0000)] 
git: support arbitrary redirects and env settings on popen

We want to be able to redirect stderr to a temporary file
while using the normal popen interface in our Git.pm.

9 years agorepobrowse: implement Atom feed
Eric Wong [Fri, 29 Jan 2016 03:23:39 +0000 (03:23 +0000)] 
repobrowse: implement Atom feed

Mostly following cgit, except we do not serve redundant
text-only output which wastes bandwidth and doesn't preserve
pre-formatting layout which is critical to some messages.

9 years agorepobrowse: drop CGI support
Eric Wong [Fri, 26 Feb 2016 10:38:41 +0000 (10:38 +0000)] 
repobrowse: drop CGI support

We already dropped CGI from the master branch, drop it from
repobrowse as well to simplify code.

9 years agorepobrowse: commits with path redirect to root with anchor
Eric Wong [Wed, 20 Jan 2016 22:35:23 +0000 (22:35 +0000)] 
repobrowse: commits with path redirect to root with anchor

We shall save clients the overhead of making extra HTTP requests
to follow partial paths.  This ought to improve cache hit
effectiveness on both the server and client side by reducing
the potential different pages we may set.

9 years agorepobrowse: fix redirects with query string
Eric Wong [Wed, 20 Jan 2016 22:17:37 +0000 (22:17 +0000)] 
repobrowse: fix redirects with query string

We need to preserve the query string to avoid breakage.

9 years agorepobrowse: nofollow and noindex tree links
Eric Wong [Tue, 19 Jan 2016 01:16:19 +0000 (01:16 +0000)] 
repobrowse: nofollow and noindex tree links

It is expensive and of dubious usefulness to have tree content
auto-followed and indexed by search engines.  Reduce the
links we recommend to crawlers so they don't waste resources
of users running our code or waste the time of search engine
users finding low-value content.

We will allow indexing blobs, however, as they may contain
useful information for others to refer to.

Of course, I definitely want search engines to index commit
messages; as I consider those to be the most important data
served.

9 years agorepobrowse: use filename anchors for commit views
Eric Wong [Mon, 18 Jan 2016 23:23:42 +0000 (23:23 +0000)] 
repobrowse: use filename anchors for commit views

Having too many potential links is damaging to cacheability
and hurts performance.

9 years agorepobrowse: display text/plain as UTF-8
Eric Wong [Mon, 18 Jan 2016 23:44:40 +0000 (23:44 +0000)] 
repobrowse: display text/plain as UTF-8

We'll be UTF-8 imperialists for now and assume all of our
textual output is UTF-8 for the benefit of browsers.

9 years agohval: routines for attribute escaping
Eric Wong [Mon, 18 Jan 2016 21:16:14 +0000 (21:16 +0000)] 
hval: routines for attribute escaping

We'll use HTML attributes + anchor links to link to filenames
in coming commits.

9 years agorepobrowse: use symbolic-ref instead of ugly rev-parse match
Eric Wong [Mon, 18 Jan 2016 07:29:04 +0000 (07:29 +0000)] 
repobrowse: use symbolic-ref instead of ugly rev-parse match

Oops, forgot about this old command :x

9 years agorepobrowse: italicize removed lines in diffs
Eric Wong [Sun, 17 Jan 2016 01:13:36 +0000 (01:13 +0000)] 
repobrowse: italicize removed lines in diffs

This doesn't look too horrible on displays which render italics
and even degrades gracefully in text-only displays to underline
or colors in other terminals (lynx).  Do not italicize leading
whitespace, since the fallback to underlines looks too noisy.

9 years agorepobrowse: use 'raw' to link to the /plain/ endpoint
Eric Wong [Sun, 17 Jan 2016 00:32:24 +0000 (00:32 +0000)] 
repobrowse: use 'raw' to link to the /plain/ endpoint

We use 'raw' in the rest of public-inbox to resolve the raw,
unformatted message (as does gmane and gitweb), so don't expose
the word 'plain' to users which only cgit seems to use.

9 years agorepobrowse: allow serving PDF files from the 'plain' endpoint
Eric Wong [Sun, 17 Jan 2016 00:18:02 +0000 (00:18 +0000)] 
repobrowse: allow serving PDF files from the 'plain' endpoint

PDFs are no more harmful than images or audio files
(they're not innocuous, but they're more difficult to use as an
 XSS vector).

This prepares us to allow access the MIME_TYPE_WHITELIST for
serving random file types.  But perhaps this will become
object-local to allow serving multiple, independent repobrowse
instances within one process...

9 years agorepobrowse: show repository index
Eric Wong [Sat, 16 Jan 2016 22:22:42 +0000 (22:22 +0000)] 
repobrowse: show repository index

Sometimes; people like to advertise projects and group them.
Of course, "-hidden" is a valid group for projects which do
not want to be advertised.

9 years agorename PI_REPO_CONFIG => PI_REPOBROWSE_CONFIG
Eric Wong [Sat, 16 Jan 2016 05:52:34 +0000 (05:52 +0000)] 
rename PI_REPO_CONFIG => PI_REPOBROWSE_CONFIG

We want to use 'repobrowse' terminology consistently despite
it being longer.  Furthermore, "repo-config" is an old git
command (nowadays git-config(1)) which may confuse some old
git users.

9 years agohonor core.abbrev from git-config(1)
Eric Wong [Sat, 16 Jan 2016 03:21:06 +0000 (03:21 +0000)] 
honor core.abbrev from git-config(1)

We will use core.abbrev=12 by default if unset, as the git
default of 7 is too low for long-term usability of links.
Some of our callers used 16, which was probably excessive.

9 years agorepobrowse: eliminate oneline log view
Eric Wong [Sat, 16 Jan 2016 02:29:23 +0000 (02:29 +0000)] 
repobrowse: eliminate oneline log view

The oneline view lacks sufficient information at times.
Reduce the number of options presented and always show
the full log message to avoid making the user follow more
links.

9 years agorepobrowse: redirect w/o trailing slashes for humans
Eric Wong [Fri, 15 Jan 2016 22:04:30 +0000 (22:04 +0000)] 
repobrowse: redirect w/o trailing slashes for humans

For human-visible HTML pages, avoid the trailing slash as that
can reduce cache hits in both the server (using varnish) and
clients.  Typical web browsers are all capable of following
301 redirects without difficulty or human interaction.

We do not redirect for endpoints which may be consumed by
automated tools as that may cause compatibility problems.  For
example, curl(1) does not automatically follow redirects and
needs the "-L" flag to do so.

9 years agorepobrowse: implement preliminary summary page
Eric Wong [Fri, 15 Jan 2016 03:00:13 +0000 (03:00 +0000)] 
repobrowse: implement preliminary summary page

This should provide a decent landing page for projects.
Alternative README files may be configured with the per-repo
"readme" directive.

9 years agorepobrowse: queries are VCS-specific
Eric Wong [Thu, 14 Jan 2016 00:47:28 +0000 (00:47 +0000)] 
repobrowse: queries are VCS-specific

While we want to keep a consistent set of parameters across
different VCSes, we cannot expect users of non-git VCSes to
use the same parameter names which make sense for git users.

9 years agorepobrowse: change Perl capitalization to "Repobrowse"
Eric Wong [Tue, 12 Jan 2016 21:32:33 +0000 (21:32 +0000)] 
repobrowse: change Perl capitalization to "Repobrowse"

We mainly call it "repobrowse" (all lowercase), so do not imply
it is two separate words by capitalizing "Browse".

9 years agorepobrowse: start supporting a "tag" endpoint
Eric Wong [Tue, 12 Jan 2016 21:25:17 +0000 (21:25 +0000)] 
repobrowse: start supporting a "tag" endpoint

We'll need this for displaying both annotated and lightweight
tags.

9 years agorepobrowse: common html_start method
Eric Wong [Tue, 12 Jan 2016 20:45:58 +0000 (20:45 +0000)] 
repobrowse: common html_start method

We will want a common UI/UX for all repobrowse HTML pages.

9 years agot/git.t: add tests for detecting failures
Eric Wong [Tue, 5 Jan 2016 11:09:38 +0000 (11:09 +0000)] 
t/git.t: add tests for detecting failures

We need to ensure failure detection works.

9 years agorepobrowse: only show --combined diff for merges
Eric Wong [Tue, 5 Jan 2016 00:37:39 +0000 (00:37 +0000)] 
repobrowse: only show --combined diff for merges

--cc diffs are less useful out-of-context to a casual reader,
and showing too many options is confusing and bloats the page.

9 years agoview: use inline style directly for feed display
Eric Wong [Tue, 5 Jan 2016 00:16:41 +0000 (00:16 +0000)] 
view: use inline style directly for feed display

And remove the legacy constant from PublicInbox::Hval.
Relying on the short <style> section should simplify our code.

9 years agorepobrowse: use style for whitespace wrapping
Eric Wong [Tue, 5 Jan 2016 00:14:48 +0000 (00:14 +0000)] 
repobrowse: use style for whitespace wrapping

This lets us use multiple <pre> sections without redundant
attributes.

9 years agorepobrowse: log: trim down unnecessary links
Eric Wong [Mon, 4 Jan 2016 21:31:56 +0000 (21:31 +0000)] 
repobrowse: log: trim down unnecessary links

We do not need to show links to follow a commit if its parents
exist, since we will show unfollowed parents at the end of the
commit.

9 years agorepobrowse: commit view handles lack of commas in hunk headers
Eric Wong [Mon, 4 Jan 2016 21:30:07 +0000 (21:30 +0000)] 
repobrowse: commit view handles lack of commas in hunk headers

Hunk headers in diffs may not have a comma in them for symlinks.

9 years agorepobrowse: tree: handle lack of trailing newline
Eric Wong [Mon, 4 Jan 2016 21:20:29 +0000 (21:20 +0000)] 
repobrowse: tree: handle lack of trailing newline

This fixes a bug where the trailing newline was not shown
correctly and tells the reader the file is missing a trailing
newline.

9 years agorepobrowse: tree view omits plain and log links
Eric Wong [Sun, 3 Jan 2016 11:22:54 +0000 (11:22 +0000)] 
repobrowse: tree view omits plain and log links

No need to clutter up the page with more senseless links few
people will follow.  The blob view now has plain links for
people who want to save a single file, and will have log links
added, later.

9 years agorepobrowse: tree nav is consistent between blobs/trees
Eric Wong [Sun, 3 Jan 2016 11:19:32 +0000 (11:19 +0000)] 
repobrowse: tree nav is consistent between blobs/trees

We use the same path: header at the top and allow jumping
back to the tree when displaying blobs.

9 years agorepobrowse: add "plain" endpoint for cgit URI compat
Eric Wong [Sun, 3 Jan 2016 04:18:58 +0000 (04:18 +0000)] 
repobrowse: add "plain" endpoint for cgit URI compat

This is similar to the "blob" endpoint, except it shows
trees as a directory.

9 years agogit: add support for qx wrapper
Eric Wong [Thu, 31 Dec 2015 21:16:39 +0000 (21:16 +0000)] 
git: add support for qx wrapper

This lets us one-line git commands easily like ``, but without
having to remember --git-dir or escape arguments.

9 years agorepobrowse: log display for parents includes commit link
Eric Wong [Thu, 31 Dec 2015 03:22:33 +0000 (03:22 +0000)] 
repobrowse: log display for parents includes commit link

For consistency, it probably makes sense to include the
extra link to each of the parent commits for the user
to follow.

9 years agorepobrowse: git commit allows expanding combined diffs
Eric Wong [Thu, 31 Dec 2015 03:15:26 +0000 (03:15 +0000)] 
repobrowse: git commit allows expanding combined diffs

Being able to view a merge commit as -c (--combined) may be
helpful; allow it as it's usually not too insane.

9 years agorepobrowse: log display tweaks
Eric Wong [Tue, 29 Dec 2015 09:20:01 +0000 (09:20 +0000)] 
repobrowse: log display tweaks

--graph is probably not supportable, but we'll make due with
being able to have links to follow arbitrary parents.

--skip and ref~<n> do not scale to large repositories, either.

9 years agocommit: stop using ins/del tags
Eric Wong [Mon, 28 Dec 2015 05:08:23 +0000 (05:08 +0000)] 
commit: stop using ins/del tags

They're too difficult to read by default on various
browsers.  Only bold added text and leave removed text
alone.

9 years agogit: local $/ for getline
Eric Wong [Mon, 28 Dec 2015 00:04:03 +0000 (00:04 +0000)] 
git: local $/ for getline

We may be setting $/ elsewhere, so do not let our callers
inadvertantly break us.

9 years agorepobrowse: log: create links for decorations
Eric Wong [Sun, 27 Dec 2015 22:35:43 +0000 (22:35 +0000)] 
repobrowse: log: create links for decorations

Decorations are helpful elements for showing relationships
between branches and tags.

9 years agorepobrowse: support --graph output in log
Eric Wong [Sat, 26 Dec 2015 12:17:14 +0000 (12:17 +0000)] 
repobrowse: support --graph output in log

This may be reverted if it turns out to be unsupportable
due to performance problems.  However it certainly looks
useful for understanding commit history.

I'm keeping it off by default for now since taking over
500ms to render a page is not acceptable.

Even "git log --graph -50 554f6e41067b9e >/dev/null" on
git://git.kernel.org/pub/scm/git/git.git
takes around 700ms on my system.

9 years agohval: rename new_bin => utf8
Eric Wong [Sat, 26 Dec 2015 04:35:22 +0000 (04:35 +0000)] 
hval: rename new_bin => utf8

This shorter name is more descriptive of what the method
actually does.

9 years agorepobrowse: add fallback module for git to serve static files
Eric Wong [Fri, 25 Dec 2015 08:37:45 +0000 (08:37 +0000)] 
repobrowse: add fallback module for git to serve static files

This will eventually be expanded to support git-http-backend(1)

9 years agorepobrowse: support raw blob display
Eric Wong [Thu, 24 Dec 2015 23:14:59 +0000 (23:14 +0000)] 
repobrowse: support raw blob display

This allows displaying blob objects, including trees, as is in
"bit perfect" fashion.

9 years agogit: factor out cat_file_begin and cat_file_finish
Eric Wong [Thu, 24 Dec 2015 21:58:00 +0000 (21:58 +0000)] 
git: factor out cat_file_begin and cat_file_finish

Unfortunately, it seems being able to handle callbacks is
insufficient; and these methods will allow us to avoid making
an extra $git->check call.

9 years agorepobrowse: patch generation improvements
Eric Wong [Thu, 24 Dec 2015 20:46:48 +0000 (20:46 +0000)] 
repobrowse: patch generation improvements

It now works more or less correctly for merges (at least it does
what cgit does).  It also supports path-limiting and the
signature line shows information on how the patch was generated
in an effort to educate git users.

9 years agorepobrowse: consolidate trailing slash handling
Eric Wong [Thu, 24 Dec 2015 20:07:30 +0000 (20:07 +0000)] 
repobrowse: consolidate trailing slash handling

And apply this to the git tree viewing code and allow navigating
upwards from the tree listing view.

9 years agogit: expand callback to support object ID and type
Eric Wong [Thu, 24 Dec 2015 11:36:33 +0000 (11:36 +0000)] 
git: expand callback to support object ID and type

This metadata can be useful on an optional basis; allowing
calls to $git->check to be skipped.

9 years agorepobrowse: simplify merge display code
Eric Wong [Thu, 24 Dec 2015 11:35:41 +0000 (11:35 +0000)] 
repobrowse: simplify merge display code

9 years agorepobrowse: consolidate PublicInbox::Git initalization
Eric Wong [Thu, 24 Dec 2015 09:32:29 +0000 (09:32 +0000)] 
repobrowse: consolidate PublicInbox::Git initalization

We should've done this earlier, but second time's a charm
and this forces us to think about other VCSes early.

9 years agorepobrowse: blob view no longer displays line numbers
Eric Wong [Thu, 24 Dec 2015 02:32:08 +0000 (02:32 +0000)] 
repobrowse: blob view no longer displays line numbers

We will always support links to them, but they're a waste of
space and render poorly on small screens.  Perhaps in the future
we may support linking to function context headers based on
.gitattributes, instead.

9 years agorepobrowse: /commit/ forces everything to UTF-8
Eric Wong [Thu, 24 Dec 2015 01:56:22 +0000 (01:56 +0000)] 
repobrowse: /commit/ forces everything to UTF-8

Hopefully we'll show some names properly in our pages now,
as well as simplify our code when escaping text for HTML
display.

Additionally, tweak our diff display by using <ins> and
<del> tags for added/removed text, respectively.  This should
allow users to choose their own styles when viewing diffs
in their browser while being meaningful to people who cannot
differentiate colors.

9 years agorepobrowse: DRY-up query class and support id2
Eric Wong [Thu, 24 Dec 2015 01:39:45 +0000 (01:39 +0000)] 
repobrowse: DRY-up query class and support id2

We'll be adding diff support against arbitrary objects, soon
(which could cause us to be OOM-ed easily if we're not careful
 with big objects).

9 years agorepobrowse: add /patch/ endpoint
Eric Wong [Thu, 24 Dec 2015 01:26:44 +0000 (01:26 +0000)] 
repobrowse: add /patch/ endpoint

This is trivial for generating patches so users can run:
"curl $URL | git am" against any instance of this.

9 years agorepobrowse: git tree API modernizations
Eric Wong [Wed, 23 Dec 2015 21:46:57 +0000 (21:46 +0000)] 
repobrowse: git tree API modernizations

Rely on Hval more since that is stateful and hopefully makes it
easier-to-manage pathnames with weird characters.  Additionally,
prefix individual function names to improve searchability
when/if we support additional VCSes.

9 years agorepobrowse: commit message page enhancements
Eric Wong [Wed, 23 Dec 2015 21:26:52 +0000 (21:26 +0000)] 
repobrowse: commit message page enhancements

Commit parent titles are shown next to the parent commit ID,
as the SHA-1 commit ID is entirely non-sensical.

diffstats now link to per-path limits, similar to cgit
behavior (cgit goes to the "diff" endpoint, which we don't
have, yet...).

9 years agoexamples/repobrowse.psgi: rename to eliminate the dash
Eric Wong [Wed, 23 Dec 2015 10:03:30 +0000 (10:03 +0000)] 
examples/repobrowse.psgi: rename to eliminate the dash

We've been refering to this as "repobrowse", so drop the '-'.
While we're at it, enable chunking since we stream a good chunk
of our responses to avoid having too much in memory at once.

9 years agorepobrowse: linkify hunk headers
Eric Wong [Wed, 23 Dec 2015 10:00:20 +0000 (10:00 +0000)] 
repobrowse: linkify hunk headers

A work-in-progress, but this provides useful links to the
exact line number of modified lines instead of blindly linking
to the top-of-the-file.  Avoid flooding the user with links
but give hints by bolding the final resulting file or SHA-1
object ID.

Do other repository viewers do this?

9 years agorepobrowse: add git helper for unquoting
Eric Wong [Tue, 22 Dec 2015 21:56:36 +0000 (21:56 +0000)] 
repobrowse: add git helper for unquoting

We need to parse diffs with all manner of funky file names :<

9 years agohval: introduce new_bin for raw data
Eric Wong [Tue, 22 Dec 2015 02:30:28 +0000 (02:30 +0000)] 
hval: introduce new_bin for raw data

Since we no longer get our data from Email::MIME when reading
non-email, we need to explicitly specify it as such.

9 years agorepobrowse: prefix VCS-specific modules
Eric Wong [Tue, 22 Dec 2015 01:36:45 +0000 (01:36 +0000)] 
repobrowse: prefix VCS-specific modules

Currently we only support git, but this should make it easier
to handle other VCS-es in the future.

9 years agorepobrowse: tree links mostly working
Eric Wong [Tue, 22 Dec 2015 00:15:33 +0000 (00:15 +0000)] 
repobrowse: tree links mostly working

Now we can navigate trees and pretend we have a filesystem...

9 years agorepobrowse: log: simplify by avoiding tables
Eric Wong [Tue, 15 Dec 2015 21:53:58 +0000 (21:53 +0000)] 
repobrowse: log: simplify by avoiding tables

We remain mostly URL-compatible with cgit, but we do not use
tables unnecessary markup and needlessly increase our page
weight.

9 years agorepobrowse: convert to using PublicInbox::Hval::PRE
Eric Wong [Tue, 15 Dec 2015 21:04:20 +0000 (21:04 +0000)] 
repobrowse: convert to using PublicInbox::Hval::PRE

Avoiding nested quoting.

9 years agorepobrowse: log + commit viewing working for git
Eric Wong [Sat, 12 Dec 2015 04:15:48 +0000 (04:15 +0000)] 
repobrowse: log + commit viewing working for git

Basically stealing URLs and parameters from cgit as much
as we can.  This could get get interesting...

9 years agoview: link restructuring for index view
Eric Wong [Tue, 5 Apr 2016 06:26:35 +0000 (06:26 +0000)] 
view: link restructuring for index view

The "next/prev" links seem a bit awkward and I don't use them as
much as I expected to.  However, move the "raw" message link
near the top since it's most useful for checking or reinforcing
the validity of the message via GPG or just reading headers.

Turn the Subject line into a permalink to the message, since
that's probably the common behavior anyways for other messaging
systems.  Make the "[threaded|flat]" view links to always
visible for bookmark-ability despite the lack of a "permalink"
label.

9 years agohttp: fix condition for detecting persistence
Eric Wong [Mon, 4 Apr 2016 21:15:26 +0000 (21:15 +0000)] 
http: fix condition for detecting persistence

Oops, we need to watch out for how we handle operator
precedence and ensure responses without a Content-Length
or "Transfer-Encoding: chunked" header will always
disconnect after writing.

9 years agowww: more explicit "git clone" usage
Eric Wong [Sat, 2 Apr 2016 22:32:13 +0000 (22:32 +0000)] 
www: more explicit "git clone" usage

Little harm in having the entire command-line for users and
avoiding the cognitive overhead of figuring out $URL.

9 years agowww: various style changes and comment updates
Eric Wong [Sat, 2 Apr 2016 22:32:01 +0000 (22:32 +0000)] 
www: various style changes and comment updates

Reduce stack depth of arguments and rely more on state hashref
to store response state.  We may end up shoving everything
in ctx eventually.

9 years agohttpd: remove reference to callback during close
Eric Wong [Thu, 31 Mar 2016 03:33:59 +0000 (03:33 +0000)] 
httpd: remove reference to callback during close

Avoid wasting memory and the risk of a potential reference
cycles by dropping the callback ASAP.

9 years agodaemon: expand @ARGV paths for running in '/'
Eric Wong [Thu, 17 Mar 2016 01:50:07 +0000 (01:50 +0000)] 
daemon: expand @ARGV paths for running in '/'

We also require --stdout/--stderr/--pid-file to be absolute
paths for USR2 usage.  However, allow PSGI files for -httpd
to be relative paths for ease-of-use.

9 years agofeed: fix brain farts in new_oneline removal
Eric Wong [Sat, 12 Mar 2016 07:34:20 +0000 (07:34 +0000)] 
feed: fix brain farts in new_oneline removal

Ugh...

Fixes: 476fc666c223 (reduce "PublicInbox::Hval->new_oneline" use)
9 years agosearchmsg: preserve hard tabs, but drop CR (\r)
Eric Wong [Sat, 12 Mar 2016 06:51:22 +0000 (06:51 +0000)] 
searchmsg: preserve hard tabs, but drop CR (\r)

Hard tabs *may* be searchable, so preserve them since they do
not take up any more space than a normal space.  However, CR
(carriage return) is worthless and likely a sign of a buggy mail
(or spam) client anyways.

9 years agoreduce "PublicInbox::Hval->new_oneline" use
Eric Wong [Sat, 12 Mar 2016 06:42:04 +0000 (06:42 +0000)] 
reduce "PublicInbox::Hval->new_oneline" use

It's probably a bad idea to strip extraneous whitespace
from some headers as an extra space may convey useful
information.

Newlines don't seem to be preserved by Email::MIME or
Email::Simple anyways, so there's no danger in breaking
formatting.

9 years agohttp: use Plack::HTTPParser for HTTP parsing
Eric Wong [Sat, 12 Mar 2016 03:55:20 +0000 (03:55 +0000)] 
http: use Plack::HTTPParser for HTTP parsing

This allows us to reduce installation dependencies while
retaining performance as it favors HTTP::Parser::XS when
it is installed and available.

PLACK_HTTP_PARSER_PP may be set to 1 to force a pure Perl
parser for testing.