All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: Eric Sunshine <sunshine@sunshineco.com>
Cc: William Hubbs <williamh@gentoo.org>,
	Git List <git@vger.kernel.org>,
	chutzpah@gentoo.org
Subject: Re: [PATCH v2 2/2] tests: add test for separate author and committer idents
Date: Mon, 28 Jan 2019 20:05:53 +0100	[thread overview]
Message-ID: <8736pc4n72.fsf@evledraar.gmail.com> (raw)
In-Reply-To: <CAPig+cQKKqL7QD_nwy8tvHaxuGqBXATVt2Mo+gELpif9aULc6A@mail.gmail.com>


On Sun, Jan 27 2019, Eric Sunshine wrote:

> On Sat, Jan 26, 2019 at 3:53 AM Ævar Arnfjörð Bjarmason
> <avarab@gmail.com> wrote:
>> Which, looking at this again, you'd only want if a previous test in the
>> file was leaking its state. That's not the case, so this isn't needed
>> and you can just apply this on top:
>>
>>      test_expect_success \
>>             'author and committer config settings override user config settings' '
>>     -       sane_unset GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL &&
>>     -       sane_unset GIT_COMMITTER_NAME GIT_COMMITTER_EMAIL &&
>>             git config user.name user &&
>>             git config user.email user@example.com &&
>>             git config author.name author &&
>
> Aside from future-proofing against a test being inserted before this
> one which does set those environment variables, these invocations of
> sane_unset() serve the additional purpose of documenting the interplay
> of configuration and environment, and further indicate to readers that
> the test author took this into consideration (rather than merely
> slapping together the test without thought). As a reviewer and reader
> of the test, I appreciate the additional context the sane_unset()
> calls provide, thus think it makes sense to retain them.

As noted in <875zuc49uj.fsf@evledraar.gmail.com> ("various override
interactions") there should definitely be more tests where the
combination of config & env is tested for.

But I don't see how it makes things clearer to unset a bunch of
variables previous tests didn't set. If we applied that to our test
suite much of it would be pointlessly unsetting various GIT_*
variables.

Better to assume other tests have cleaned up their own state, and when
it's not the case fix it.

      reply	other threads:[~2019-01-28 19:05 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-25 21:59 Add author and committer configuration settings William Hubbs
2019-01-25 21:59 ` [PATCH v2 1/2] config: allow giving separate author and committer idents William Hubbs
2019-01-25 22:58   ` Ævar Arnfjörð Bjarmason
2019-01-28 18:58     ` William Hubbs
2019-01-28 19:00       ` Junio C Hamano
2019-01-28 20:04       ` Ævar Arnfjörð Bjarmason
2019-01-28 21:33         ` Junio C Hamano
2019-01-28 23:30         ` William Hubbs
2019-01-29 22:42     ` William Hubbs
2019-01-25 21:59 ` [PATCH v2 2/2] tests: add test for " William Hubbs
2019-01-25 23:05   ` Ævar Arnfjörð Bjarmason
2019-01-26  1:06     ` William Hubbs
2019-01-26  8:53       ` Ævar Arnfjörð Bjarmason
2019-01-27  4:48         ` Eric Sunshine
2019-01-28 19:05           ` Ævar Arnfjörð Bjarmason [this message]

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8736pc4n72.fsf@evledraar.gmail.com \
    --to=avarab@gmail.com \
    --cc=chutzpah@gentoo.org \
    --cc=git@vger.kernel.org \
    --cc=sunshine@sunshineco.com \
    --cc=williamh@gentoo.org \
    /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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.