about summary refs log tree commit homepage
path: root/lib/PublicInbox/Git.pm
DateCommit message (Collapse)
2017-03-04repoobrowse: explicit EOF handling for git async callback
We need to ensure we've fully-drained the pipe before signalling EOF to the callback, since pipelining may not be the best choice with detachable processes in the future.
2017-03-04repobrowse: stop abbreviating object names
Ending up with potentially ambiguous identifiers in the future is not worth saving some bytes, in this case.
2017-03-02repobrowse: rework source view to use async cat-file API
This will allow most source files to be displayed without blocking public-inbox-httpd on slow disk access. However, we no longer support displaying source files larger than 65536 bytes (the size of a pipe on current Linux).
2017-02-24git: move async detection to runtime
We don't actually know what context we'll be called under, so detecting the mere use-ability of Danga::Socket is not sufficient.
2017-01-26repobrowse: simplify command generation for git commands
This shortens the code quite a bit at a negligible performance cost, and the diffstat agrees.
2017-01-13rename "GitAsyncRd" to "GitAsync"
This wrapper class actually does both reading and writing, and a shorter name is nicer.
2017-01-07initial git async work
This will allow us to handle network operations while waiting on "git cat-file" to seek and unpack things.
2016-12-26git: lazy initialization of error output
We may not keep this feature after all, but for now we'll hold off on creating it to cheapen instantiation.
2016-12-14Merge remote-tracking branch 'origin/repobrowse' into repobrowse
* origin/repobrowse: (98 commits) t/repobrowse_git_httpd.t: ensure signature exists for split t/repobrowse_git_tree.t: fix test for lack of bold repobrowse: fix alignment of gitlink entries repobrowse: show invalid type for tree views repobrowse: do not bold directory names in tree view repobrowse: reduce checks for response fh repobrowse: larger, short-lived buffer for reading patches repobrowse: reduce risk of callback reference cycles repobrowse: snapshot support for cgit compatibility test: disable warning for Plack::Test::Impl repobrowse: avoid confusing linkification for "diff" repobrowse: git commit view uses pi-httpd.async repobrowse: more consistent variable naming for /commit/ repobrowse: show roughly equivalent "diff-tree" invocation repobrowse: reduce local variables for state management repobrowse: summary handles multiple README types repobrowse: remove bold decorations from diff view repobrowse: common git diff parsing code repobrowse: implement diff view for compatibility examples/repobrowse.psgi: disable Chunked response by default ...
2016-08-09searchidx: avoid holding Xapian lock in cat-file
We must ensure cat-file process is launched before Xapian grabs lock, too. Our use of "git cat-file --batch" has the same problem as "git log" did, (which was fixed in commit 3713c727cda431a0dc2865a7878c13ecf9f21851) "searchidx: release Xapian FDs before spawning git log"
2016-06-21spawn: improve error checking for fork failures
fork failures are unfortunately common when Xapian has gigabytes and gigabytes mmapped.
2016-05-21localize $/ in more places to avoid potential problems
This hopefully makes the intent of the code clearer, too. The the HTTP use of the numeric reference for getline caused problems in Git.pm, already.
2016-05-21mbox: switch generation over to pull model
This allows us to easily provide gigantic inboxes with proper backpressure handling for slow clients. It also eliminates public-inbox-httpd and Danga::Socket-specific knowledge from this class, making it easier to follow for those used to generic PSGI applications.
2016-04-27import: document API for public consumption
This is probably trivial enough to be final?
2016-04-11git: add support for qx wrapper
This lets us one-line git commands easily like ``, but without having to remember --git-dir or escape arguments.
2016-04-05git: support an error tmpfile for stashing stderr output
This should allow us to avoid polluting stderr output when HTTP clients inevitably request broken revisions.
2016-04-05git: 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.
2016-04-05honor 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.
2016-04-05git: add support for qx wrapper
This lets us one-line git commands easily like ``, but without having to remember --git-dir or escape arguments.
2016-04-05git: local $/ for getline
We may be setting $/ elsewhere, so do not let our callers inadvertantly break us.
2016-04-05git: 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.
2016-04-05git: 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.
2016-02-28reduce calls to close unless error checks are needed
We can rely on timely auto-destruction based on reference counting; reducing the chance of redundant close(2) calls which may hit the wront FD. We do care about certain close calls (e.g. writing to a buffered IO handle) if we require error-checking for write-integrity. In other cases, let things go out-of-scope so it can be freed automatically after use.
2016-02-27git: use built-in spawn implementation for vfork
This should reduce overhead of spawning git processes from our long-running httpd and nntpd servers.
2015-12-22rename 'GitCatFile' package to 'Git'
We'll be using it for more than just cat-file. Adding a `popen' API for internal use allows us to save a bunch of code in other places.