git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Martin Ågren" <martin.agren@gmail.com>
To: Jeff King <peff@peff.net>
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 19:04:42 +0200	[thread overview]
Message-ID: <CAN0heSr5EN2Ls5Xd-Sg6b-z9WsJM9s1xB7ZczDkRgv79hxhsaA@mail.gmail.com> (raw)
In-Reply-To: <20171010142930.vao2nqg4pv7f2znk@sigill.intra.peff.net>

On 10 October 2017 at 16:29, Jeff King <peff@peff.net> wrote:
> On Tue, Oct 10, 2017 at 10:10:19AM -0400, Jeff King wrote:
>
> it will randomly succeed or fail, depending on whether sed manages to
> read the input before the stdin terminal is closed.
>
> I'm not sure of an easy way to fix test-terminal, but we could work
> around it like this (which also uses "-p" to actually invoke the pager,
> and uses a pager that makes it clear when it's being run):
>
> diff --git a/t/t9002-column.sh b/t/t9002-column.sh
> index 9441145bf0..d322c3b745 100755
> --- a/t/t9002-column.sh
> +++ b/t/t9002-column.sh
> @@ -180,14 +180,14 @@ EOF
>
>  test_expect_success TTY '20 columns, mode auto, pager' '
>         cat >expected <<\EOF &&
> -one    seven
> -two    eight
> -three  nine
> -four   ten
> -five   eleven
> -six
> +paged:one    seven
> +paged:two    eight
> +paged:three  nine
> +paged:four   ten
> +paged:five   eleven
> +paged:six
>  EOF
> -       test_terminal env PAGER="cat|cat" git column --mode=auto <lista >actual &&
> +       test_terminal env PAGER="sed s/^/paged:/" sh -c "git -p column --mode=auto <lista" >actual &&
>         test_cmp expected actual
>  '
>  test_done

Makes sense. FWIW, I don't see the flakyness with this.

> All that said, I think I'd just as soon test a real command like "git
> tag", which doesn't care about reading from stdin.

For reference for Kevin, in case you consider testing, e.g., git tag,
the main reason I referred to the test I posted as "hacky", was that I
just inserted it at a more-or-less random place in t7006. So it had to
play with `git reset` to avoid upsetting the later tests. It could
obviously go to the end instead, but I was too lazy to move it and
define a pager.

  reply	other threads:[~2017-10-10 17:04 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
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 [this message]
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=CAN0heSr5EN2Ls5Xd-Sg6b-z9WsJM9s1xB7ZczDkRgv79hxhsaA@mail.gmail.com \
    --to=martin.agren@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=me@ikke.info \
    --cc=pclouds@gmail.com \
    --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.
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).