mbox series

[0/6] Change <non-empty?> GIT_TEST_* variables to <boolean>

Message ID 20190619233046.27503-1-avarab@gmail.com (mailing list archive)
Headers show
Series Change <non-empty?> GIT_TEST_* variables to <boolean> | expand

Message

Ævar Arnfjörð Bjarmason June 19, 2019, 11:30 p.m. UTC
This changes the remaining <non-empty?> special snowflake test modes
to <boolean> and gets rid of test_tristate() in favor of the now
standard "boolea" test.

I'm replying to my "gc: run more pre-detach operations under lock"
thread because one of the things my WIP patches to make gc locking
less sucky depends on is new GIT_TEST_GC_* test modes to test its
racyness, which in turn depends on these cleanups.

Ævar Arnfjörð Bjarmason (6):
  env--helper: new undocumented builtin wrapping git_env_*()
  t6040 test: stop using global "script" variable
  tests: make GIT_TEST_GETTEXT_POISON a boolean
  tests README: re-flow a previously changed paragraph
  tests: replace test_tristate with "git env--helper"
  tests: make GIT_TEST_FAIL_PREREQS a boolean

 .gitignore                |  1 +
 Makefile                  |  1 +
 builtin.h                 |  1 +
 builtin/env--helper.c     | 74 +++++++++++++++++++++++++++++++++++++++
 ci/lib.sh                 |  2 +-
 gettext.c                 |  6 ++--
 git-sh-i18n.sh            |  4 ++-
 git.c                     |  1 +
 po/README                 |  2 +-
 t/README                  | 12 +++----
 t/lib-git-daemon.sh       |  7 ++--
 t/lib-git-svn.sh          | 11 +++---
 t/lib-httpd.sh            | 15 ++++----
 t/t0000-basic.sh          | 10 +++---
 t/t0016-env-helper.sh     | 70 ++++++++++++++++++++++++++++++++++++
 t/t0205-gettext-poison.sh |  2 +-
 t/t5512-ls-remote.sh      |  3 +-
 t/t6040-tracking-info.sh  |  6 ++--
 t/t7201-co.sh             |  2 +-
 t/t9902-completion.sh     |  2 +-
 t/test-lib-functions.sh   | 58 +++++-------------------------
 t/test-lib.sh             | 29 ++++++++++++---
 22 files changed, 220 insertions(+), 99 deletions(-)
 create mode 100644 builtin/env--helper.c
 create mode 100755 t/t0016-env-helper.sh

Comments

Junio C Hamano June 20, 2019, 6:13 p.m. UTC | #1
Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:

> This changes the remaining <non-empty?> special snowflake test modes
> to <boolean> and gets rid of test_tristate() in favor of the now
> standard "boolea" test.
>
> I'm replying to my "gc: run more pre-detach operations under lock"
> thread because one of the things my WIP patches to make gc locking
> less sucky depends on is new GIT_TEST_GC_* test modes to test its
> racyness, which in turn depends on these cleanups.

That sounds like the "gc: run more ..." depends on these (iow, that
should be the reply to these, not the other way around)?

I am asking because I see obvious value in these "uniformly require
<boolean>" consistency change (which could be backward incompatible,
but as long as these are GIT_TEST_*, we do not mind too much forcing
developers to adjust), but not yet in the "gc: run more ..." one,
and do not want these to be taken hostage.

Thanks.

>
> Ævar Arnfjörð Bjarmason (6):
>   env--helper: new undocumented builtin wrapping git_env_*()
>   t6040 test: stop using global "script" variable
>   tests: make GIT_TEST_GETTEXT_POISON a boolean
>   tests README: re-flow a previously changed paragraph
>   tests: replace test_tristate with "git env--helper"
>   tests: make GIT_TEST_FAIL_PREREQS a boolean
>
>  .gitignore                |  1 +
>  Makefile                  |  1 +
>  builtin.h                 |  1 +
>  builtin/env--helper.c     | 74 +++++++++++++++++++++++++++++++++++++++
>  ci/lib.sh                 |  2 +-
>  gettext.c                 |  6 ++--
>  git-sh-i18n.sh            |  4 ++-
>  git.c                     |  1 +
>  po/README                 |  2 +-
>  t/README                  | 12 +++----
>  t/lib-git-daemon.sh       |  7 ++--
>  t/lib-git-svn.sh          | 11 +++---
>  t/lib-httpd.sh            | 15 ++++----
>  t/t0000-basic.sh          | 10 +++---
>  t/t0016-env-helper.sh     | 70 ++++++++++++++++++++++++++++++++++++
>  t/t0205-gettext-poison.sh |  2 +-
>  t/t5512-ls-remote.sh      |  3 +-
>  t/t6040-tracking-info.sh  |  6 ++--
>  t/t7201-co.sh             |  2 +-
>  t/t9902-completion.sh     |  2 +-
>  t/test-lib-functions.sh   | 58 +++++-------------------------
>  t/test-lib.sh             | 29 ++++++++++++---
>  22 files changed, 220 insertions(+), 99 deletions(-)
>  create mode 100644 builtin/env--helper.c
>  create mode 100755 t/t0016-env-helper.sh
Junio C Hamano June 20, 2019, 8:03 p.m. UTC | #2
Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:

> This changes the remaining <non-empty?> special snowflake test modes
> to <boolean> and gets rid of test_tristate() in favor of the now
> standard "boolea" test.

Is that "boolean" test?

I had a lot of trouble with the external interface to "env--helper",
but I kind of liked the changes to the tests that makes the use of
these environment variables uniform and consistent.  One fewer
things to remember.

In addition to the other review on 1/6, t0016 is taken at the tip of
'pu'; we would want to renumber to avoid test-lint complaints.
Ævar Arnfjörð Bjarmason June 20, 2019, 9 p.m. UTC | #3
On Thu, Jun 20 2019, Junio C Hamano wrote:

> Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:
>
>> This changes the remaining <non-empty?> special snowflake test modes
>> to <boolean> and gets rid of test_tristate() in favor of the now
>> standard "boolea" test.
>>
>> I'm replying to my "gc: run more pre-detach operations under lock"
>> thread because one of the things my WIP patches to make gc locking
>> less sucky depends on is new GIT_TEST_GC_* test modes to test its
>> racyness, which in turn depends on these cleanups.
>
> That sounds like the "gc: run more ..." depends on these (iow, that
> should be the reply to these, not the other way around)?

Yeah the tests in that otherwise unrelated series loosely depends on
this, so I figured I'd try to get this in first.

> I am asking because I see obvious value in these "uniformly require
> <boolean>" consistency change (which could be backward incompatible,
> but as long as these are GIT_TEST_*, we do not mind too much forcing
> developers to adjust), but not yet in the "gc: run more ..." one,
> and do not want these to be taken hostage.

Yeah these should be viewed independently. Perhaps I shouldn't have
filled that In-Reply-To...

>>
>> Ævar Arnfjörð Bjarmason (6):
>>   env--helper: new undocumented builtin wrapping git_env_*()
>>   t6040 test: stop using global "script" variable
>>   tests: make GIT_TEST_GETTEXT_POISON a boolean
>>   tests README: re-flow a previously changed paragraph
>>   tests: replace test_tristate with "git env--helper"
>>   tests: make GIT_TEST_FAIL_PREREQS a boolean
>>
>>  .gitignore                |  1 +
>>  Makefile                  |  1 +
>>  builtin.h                 |  1 +
>>  builtin/env--helper.c     | 74 +++++++++++++++++++++++++++++++++++++++
>>  ci/lib.sh                 |  2 +-
>>  gettext.c                 |  6 ++--
>>  git-sh-i18n.sh            |  4 ++-
>>  git.c                     |  1 +
>>  po/README                 |  2 +-
>>  t/README                  | 12 +++----
>>  t/lib-git-daemon.sh       |  7 ++--
>>  t/lib-git-svn.sh          | 11 +++---
>>  t/lib-httpd.sh            | 15 ++++----
>>  t/t0000-basic.sh          | 10 +++---
>>  t/t0016-env-helper.sh     | 70 ++++++++++++++++++++++++++++++++++++
>>  t/t0205-gettext-poison.sh |  2 +-
>>  t/t5512-ls-remote.sh      |  3 +-
>>  t/t6040-tracking-info.sh  |  6 ++--
>>  t/t7201-co.sh             |  2 +-
>>  t/t9902-completion.sh     |  2 +-
>>  t/test-lib-functions.sh   | 58 +++++-------------------------
>>  t/test-lib.sh             | 29 ++++++++++++---
>>  22 files changed, 220 insertions(+), 99 deletions(-)
>>  create mode 100644 builtin/env--helper.c
>>  create mode 100755 t/t0016-env-helper.sh