git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: "Martin Ågren" <martin.agren@gmail.com>
Cc: "Kevin Daudt" <me@ikke.info>,
	"Git Mailing List" <git@vger.kernel.org>,
	"Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
Subject: Re: [RFC] column: show auto columns when pager is active
Date: Tue, 10 Oct 2017 10:01:18 -0400	[thread overview]
Message-ID: <20171010140118.quyesljvz44wvfx6@sigill.intra.peff.net> (raw)
In-Reply-To: <CAN0heSoWTpVZXmJkoEQtc_rjFj3PdPWV_37B9LukxxsYy5ox1w@mail.gmail.com>

On Tue, Oct 10, 2017 at 12:30:49PM +0200, Martin Ågren wrote:

> On 9 October 2017 at 23:45, Kevin Daudt <me@ikke.info> wrote:
> > When columns are set to automatic for git tag and the output is
> > paginated by git, the output is a single column instead of multiple
> > columns.
> >
> > Standard behaviour in git is to honor auto values when the pager is
> > active, which happens for example with commands like git log showing
> > colors when being paged.
> >
> > Since ff1e72483 (tag: change default of `pager.tag` to "on",
> > 2017-08-02), the pager has been enabled by default, exposing this
> > problem to more people.
> 
> Oh. :( I didn't know about "column" to be honest.

Yeah, I didn't think of that with respect to the pager. This is a
regression in v2.14.2, I think.

I agree that anything that is "auto" on stdout probably ought to kick in
when the pager is in effect (since that only kicks in when stdout _was_
a tty before we stuck a pager in front of it).

> I had slightly more success with PAGER="cat >actual", but the test is
> flaky for some reason.

The test in t9002 should be immune to this, but the one you suggest in
t7006 would need to set COLUMNS to get consistent output, I think.

> In any case, it might make sense to test an
> actual use-case also. Of course, the code should be largely the same,
> but in builtin/tag.c, it's quite important that `setup_auto_pager()`
> and `finalize_colopts()` are called in the right order.

I think it might work out either way. If we have started the pager when
we finalize_colopts(), then the pager_in_use() bit will kick in. If we
haven't, then either:

  1. stdout is a tty, and we'll kick in the auto behavior for columns,
     and then later for the pager.

  2. stdout isn't a tty, in which case we also won't kick in the pager.

-Peff

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

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-09 21:45 [RFC] column: show auto columns when pager is active Kevin Daudt
2017-10-09 23:27 ` Eric Sunshine
2017-10-10 10:30 ` Martin Ågren
2017-10-10 14:01   ` Jeff King [this message]
2017-10-10 17:02     ` Martin Ågren
2017-10-11  4:54       ` Kevin Daudt
2017-10-12 14:24         ` Jeff King
2017-10-10 14:10 ` Jeff King
2017-10-10 14:29   ` Jeff King
2017-10-10 17:04     ` Martin Ågren
2017-10-10 18:32       ` Kevin Daudt
2017-10-11 17:23 ` [PATCH] " Kevin Daudt
2017-10-11 18:12   ` Martin Ågren
2017-10-11 18:36     ` Kevin Daudt
2017-10-11 19:02       ` Martin Ågren
2017-10-16 18:35   ` [PATCH v2] " Kevin Daudt
2017-10-17  3:19     ` Junio C Hamano
2017-10-23 21:52     ` Jonathan Nieder
2017-10-24  1:11       ` Junio C Hamano
2017-10-24  1:18         ` Jonathan Nieder
2017-10-24  6:58       ` Kevin Daudt

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=20171010140118.quyesljvz44wvfx6@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=martin.agren@gmail.com \
    --cc=me@ikke.info \
    --cc=pclouds@gmail.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).