List for cgit developers and users
 help / color / mirror / Atom feed
From: john at keeping.me.uk (John Keeping)
Subject: [PATCH 0/4] adding color to ui-blame
Date: Sat, 14 Oct 2017 17:14:21 +0100	[thread overview]
Message-ID: <20171014161421.GJ25019@john.keeping.me.uk> (raw)
In-Reply-To: <20171014141750.14013-1-Jason@zx2c4.com>

On Sat, Oct 14, 2017 at 04:17:46PM +0200, Jason A. Donenfeld wrote:
> This patch set is currently broken, because in the exec filter,
> processes like to buffer their output. The result is that the text winds
> up at the bottom:
> 
> 	https://git.zx2c4.com/cgit/blame/cache.c
> 
> If anybody has some ideas on how we might enact a flush operation, please
> pipe up (hah).

The only thing I can think of is stdbuf, but that uses LD_PRELOAD
internally and only works if the filter only uses the default stdio
buffering and processing the input incrementally; our
syntax-highlighting.py slurps the entire input stream before outputting
anything.

I wonder if it would be more reliable to split the output of the filter
on the assumption that there is a one-to-one mapping from input lines to
output lines.  Both of the filters we ship do this, although the Python
version dumps out a stylesheet before starting the document.

Having thought about this a bit, I can't see any way to make this work
reliably with our current filter protocol.  Maybe we should consider
introducing a more capable protocol for source filters that is designed
to be usable in this scenario.


  parent reply	other threads:[~2017-10-14 16:14 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-14 14:17 Jason
2017-10-14 14:17 ` [PATCH 1/4] filter: add generic scafolding for temporarily disabling filter Jason
2017-10-14 14:17 ` [PATCH 2/4] filter: wire up exec_filter to enable function Jason
2017-10-14 14:17 ` [PATCH 3/4] filter: wire up lua_filter " Jason
2017-10-14 14:17 ` [PATCH 4/4] ui-blame: put source lines through filter Jason
2017-10-14 16:14 ` john [this message]
2017-10-15 16:47   ` [PATCH 0/4] adding color to ui-blame Jason
2017-10-15 17:04     ` whydoubt
2017-10-15 17:11       ` Jason

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171014161421.GJ25019@john.keeping.me.uk \
    --to=cgit@lists.zx2c4.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).