From: Steffen Daode Nurpmeso <sdaoden@googlemail.com>
To: Nicolas Pitre <nico@fluxnic.net>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>,
Jeff King <peff@peff.net>, Johannes Sixt <j6t@kdbg.org>
Subject: Re: [PATCH/RFC] sideband: remove line padding (was: Re: [PATCH] progress: use \r as EOL only if isatty(stderr) is true)
Date: Thu, 30 Jun 2011 23:13:29 +0200 [thread overview]
Message-ID: <20110630211329.GC63317@sherwood.local> (raw)
In-Reply-To: <alpine.LFD.2.00.1106291414140.2142@xanadu.home>
@ Nicolas Pitre <nico@fluxnic.net> wrote (2011-06-29 20:15+0200):
> Why?
Ok, they don't. (Your initial patch was from 2008, and since
git(1) is evolving very fast, it might have been that padding is
no longer of any use at all.)
So, then, i'm the right person to turn the big wheel:
- Move color.* and even progress.* stuff into new visual.[hc].
- Add a vis[ual]_init() which does check isatty() for [012] and
does the TERM check (i.e. "dumb" or otherwise).
There could also be flags which could be used to restrict what
is checked ...
- Replace calls to isatty(xy) by std{in,out,err}_is_tty(), defined
in visual.h.
Calling vis[ual]_init() would not be needed for these.
(But they could be inline if it would be.)
- Add a series of vis_print functions in equal spirit to the
color series which use detected terminal capabilities to ensure
that a line consists only of the printed data.
I (almost) had that state hour ago, but it's ... (The problem with
that print series is that in the dumb case the data is to be injected
before a possibly contained NL/CR sequence, so that already inspected
data is to be reinspected. Or data has to be copied around. Or
writes have to be splitted, but here i'm talking about stderr, and
that's unbuffered, and so each invocation goes through the OS.)
So what else could be done to remove TERM and ANSI escape sequence
knowledge from a nice multiband stream splitter, and to avoid that
it writes the escape sequence if output is stupidly redirected to a
file? Well, visual.h could consist of a single function only:
const char *ansi_el_if_tty_and_termok_else_null(void);
--
Ciao, Steffen
sdaoden(*)(gmail.com)
() ascii ribbon campaign - against html e-mail
/\ www.asciiribbon.org - against proprietary attachments
next prev parent reply other threads:[~2011-06-30 21:13 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-28 14:40 [PATCH] progress: use \r as EOL only if isatty(stderr) is true Steffen Daode Nurpmeso
[not found] ` <BANLkTinRe=pA=_obCmPKBjJMXH_pDfwCtw@mail.gmail.com>
2011-06-28 16:51 ` Steffen Daode Nurpmeso
2011-06-28 18:04 ` Steffen Daode Nurpmeso
2011-06-28 18:33 ` Junio C Hamano
2011-06-28 18:48 ` Steffen Daode Nurpmeso
2011-06-28 18:55 ` Steffen Daode Nurpmeso
2011-06-28 22:45 ` Jeff King
2011-06-29 21:36 ` Junio C Hamano
2011-06-30 4:33 ` Miles Bader
2011-06-29 17:42 ` [PATCH/RFC] sideband: remove line padding (was: Re: [PATCH] progress: use \r as EOL only if isatty(stderr) is true) Steffen Daode Nurpmeso
2011-06-29 18:15 ` Nicolas Pitre
2011-06-30 21:13 ` Steffen Daode Nurpmeso [this message]
2011-07-01 3:46 ` Nicolas Pitre
2011-08-27 19:45 ` [PATCH] checkout: be quiet if not on isatty() Steffen Daode Nurpmeso
2011-08-27 19:45 ` Steffen Daode Nurpmeso
2011-08-28 6:22 ` Junio C Hamano
2011-08-28 6:28 ` martin f krafft
2011-08-28 17:37 ` [PATCH] checkout: add --verbose, and restrict progress reporting (was: Re: [PATCH] checkout: be quiet if not on isatty()) Steffen Daode Nurpmeso
2011-08-29 20:14 ` [PATCH 0/2 RFC] Add update_progress(), divert checkout messages sdaoden
2011-08-29 20:17 ` [PATCH 1/2] progress: add update_progress() sdaoden
2011-08-29 20:17 ` [PATCH 2/2] unpack-trees: divert check_updates() output via update_progress() sdaoden
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=20110630211329.GC63317@sherwood.local \
--to=sdaoden@googlemail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=j6t@kdbg.org \
--cc=nico@fluxnic.net \
--cc=peff@peff.net \
/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).