Merge branch 'kd/auto-col-with-pager-fix'
authorJunio C Hamano <gitster@pobox.com>
Mon, 6 Nov 2017 04:11:22 +0000 (13:11 +0900)
committerJunio C Hamano <gitster@pobox.com>
Mon, 6 Nov 2017 04:11:22 +0000 (13:11 +0900)
"auto" as a value for the columnar output configuration ought to
judge "is the output consumed by humans?" with the same criteria as
"auto" for coloured output configuration, i.e. either the standard
output stream is going to tty, or a pager is in use. We forgot the
latter, which has been fixed.

* kd/auto-col-with-pager-fix:
column: do not include pager.c
column: show auto columns when pager is active

1  2 
t/t7006-pager.sh
diff --combined t/t7006-pager.sh
index f0f1abd1c23d4303a686310d7325cd523d6c921b,f630fe0f2bd825fd696a2a40c1d25377cde314e7..865168ec6a7be7fc7778419f2dd1066e9c80c1bc
@@@ -201,7 -201,7 +201,7 @@@ test_expect_success TTY 'git tag -a res
        test -e paginated.out
  '
  
 -test_expect_failure TTY 'git tag as alias ignores pager.tag with -a' '
 +test_expect_success TTY 'git tag as alias ignores pager.tag with -a' '
        test_when_finished "git tag -d newtag" &&
        rm -f paginated.out &&
        test_terminal git -c pager.tag -c alias.t=tag t -am message newtag &&
@@@ -239,7 -239,7 +239,7 @@@ test_expect_success 'no color when stdo
  test_expect_success TTY 'color when writing to a pager' '
        rm -f paginated.out &&
        test_config color.ui auto &&
 -      test_terminal env TERM=vt100 git log &&
 +      test_terminal git log &&
        colorful paginated.out
  '
  
@@@ -247,7 -247,7 +247,7 @@@ test_expect_success TTY 'colors are sup
        rm -f paginated.out &&
        test_config color.ui auto &&
        test_config color.pager false &&
 -      test_terminal env TERM=vt100 git log &&
 +      test_terminal git log &&
        ! colorful paginated.out
  '
  
@@@ -266,7 -266,7 +266,7 @@@ test_expect_success 'color when writin
  test_expect_success TTY 'colors are sent to pager for external commands' '
        test_config alias.externallog "!git log" &&
        test_config color.ui auto &&
 -      test_terminal env TERM=vt100 git -p externallog &&
 +      test_terminal git -p externallog &&
        colorful paginated.out
  '
  
@@@ -570,4 -570,18 +570,18 @@@ test_expect_success 'command with under
        test_cmp expect actual
  '
  
+ test_expect_success TTY 'git tag with auto-columns ' '
+       test_commit one &&
+       test_commit two &&
+       test_commit three &&
+       test_commit four &&
+       test_commit five &&
+       cat >expect <<-\EOF &&
+       initial  one      two      three    four     five
+       EOF
+       test_terminal env PAGER="cat >actual" COLUMNS=80 \
+               git -c column.ui=auto tag --sort=authordate &&
+       test_cmp expect actual
+ '
  test_done