[PATCH 0/4] adding color to ui-blame

John Keeping john at keeping.me.uk
Sat Oct 14 18:14:21 CEST 2017


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.


More information about the CGit mailing list