Subject: Re: [PATCH v6 11/11] test-lib: split up and deprecate test_create_repo()

From: Ævar Arnfjörð Bjarmason <[email-masked]>
Date: Thu, 13 May 2021 14:05:36 +0200

On Thu, May 13 2021, Felipe Contreras wrote:

> Ævar Arnfjörð Bjarmason wrote:
>> 
>> On Thu, May 13 2021, Felipe Contreras wrote:
>> 
>> > Ævar Arnfjörð Bjarmason wrote:
>> >> --- a/t/test-lib-functions.sh
>> >> +++ b/t/test-lib-functions.sh
>> >> @@ -1243,21 +1243,10 @@ test_atexit () {
>> >>  		} && (exit \"\$eval_ret\"); eval_ret=\$?; $test_atexit_cleanup"
>> >>  }
>> >>  
>> >> -# Most tests can use the created repository, but some may need to create more.
>> >> +# Deprecated wrapper for "git init", use "git init" directly instead
>> >>  # Usage: test_create_repo <directory>
>> >>  test_create_repo () {
>> >
>> > If this is deprecated why not add a warning?
>> >
>> >   echo "warning: test_create_repo is deprecated in favor of git init" >&2
>> 
>> Because like test_i18ncmp, test_i18ngrep or whatever this is in the
>> state of "don't use this for new code", but annoying everyone who runs
>> the test suite with loads of this output under -v would be too
>> distracting.
>> 
>> The attention of the developer community is much better spent on one
>> person doing a s/test_create_repo/git init/ patch than having everyone
>> see this warning until somebody does that.
>
> Then it's not really deprecated; it's merely disfavored.
>
> To deprecate means to express disapproval of. If we are not going to
> express disapproval (i.e. annoy the users of the test suite), then it's
> not really deprecated. You can't eat your cake and have it too.
>
> I agree we shouldn't throw a warning right now, but at some point in the
> future we should, *then* it will be deprecated.

I don't feel strongly about either term, as long as it's consistent.

I do think that "deprecated" is consistent in the way I'm using it
within the git project. If you grep various things we've "deprecated" we
usually just do so by noting so in the docs. In this case the docs are
the comments in test-lib.sh.

We do also have things like git rebase --preserve-merges which emit a
warning, but we use "deprecated" for both. By contrast we don't have a
single git for "git grep -i disfavor".

Anyway, for now I'd prefer to just have this land as-is and sort out
such minor things later, given the v6 and having two other topics
waiting on this...