git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [RFC] column: show auto columns when pager is active

From
Kevin Daudt <me@ikke.info>
Date
Oct 10, 2017, 18:32 UTC
Message-ID
<20171010183247.GA16800@alpha.vpn.ikke.info>
In-Reply-To
<CAN0heSr5EN2Ls5Xd-Sg6b-z9WsJM9s1xB7ZczDkRgv79hxhsaA@mail.gmail.com>
On Tue, Oct 10, 2017 at 07:04:42PM +0200, Martin Ågren wrote:
Show 48 quoted lines
> 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.

Thanks Jeff and Martin, I will use your tips to build a test based on git tag instead.

Previous: Martin ÅgrenNext: Kevin Daudt
Message 11 of 21 in “[RFC] column: show auto columns when pager is active”
  1. Kevin DaudtOct 9, 2017
  2. Eric SunshineOct 9, 2017
  3. Martin ÅgrenOct 10, 2017
  4. Jeff KingOct 10, 2017
  5. Martin ÅgrenOct 10, 2017
  6. Kevin DaudtOct 11, 2017
  7. Jeff KingOct 12, 2017
  8. Jeff KingOct 10, 2017
  9. Jeff KingOct 10, 2017
  10. Martin ÅgrenOct 10, 2017
  11. Kevin DaudtOct 10, 2017
  12. column: show auto columns when pager is activeKevin Daudt, Oct 11, 2017
  13. Martin ÅgrenOct 11, 2017
  14. Kevin DaudtOct 11, 2017
  15. Martin ÅgrenOct 11, 2017
  16. column: show auto columns when pager is activeKevin Daudt, Oct 16, 2017
  17. Junio C HamanoOct 17, 2017
  18. Jonathan NiederOct 23, 2017
  19. Junio C HamanoOct 24, 2017
  20. Jonathan NiederOct 24, 2017
  21. Kevin DaudtOct 24, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.