git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Martin Ågren" <martin.agren@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: "Git Mailing List" <git@vger.kernel.org>,
	"Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
Subject: Re: [PATCH 1/3] t7006: add tests for how git config paginates
Date: Mon, 12 Feb 2018 23:41:37 +0100	[thread overview]
Message-ID: <CAN0heSr5bRx7Lrzu4mfeHx3SuZ75bgpXUA75kM1HJ-h=+8dgPQ@mail.gmail.com> (raw)
In-Reply-To: <xmqq4lmlsvhr.fsf@gitster-ct.c.googlers.com>

On 12 February 2018 at 23:17, Junio C Hamano <gitster@pobox.com> wrote:
> Martin Ågren <martin.agren@gmail.com> writes:
>
>> +test_expect_success TTY 'git config respects pager.config when setting' '
>> +     rm -f paginated.out &&
>> +     test_terminal git -c pager.config config foo.bar bar &&
>> +     test -e paginated.out
>> +'
>
> I am debating myself if this test should instead spell out what we
> eventually want from the above test and make it expect_failure, just
> like the next one.

That's a valid point. I was coming at it from the point of view of "the
current behavior is well-defined and non-broken -- we'll soon change it,
but that's more a redefinition, not a bugfix (as with --edit)". But I
could go either way.

There is some prior art in ma/branch-list-paginate, where I handled `git
branch --set-upstream-to` similar to here, cf. d74b541e0b (branch:
respect `pager.branch` in list-mode only, 2017-11-19).

> In addition to setting (which will start ignoring pager in later
> steps), unsetting, replacing of a variable and renaming/removing a
> section in a configuration should not page, I would suspect.  Should
> we test them all?

I actually had several more tests in an early draft, including --unset.
Similarly, testing all the --get-* would be possible but feels like
overkill.  From the implementation, it's "obvious enough" (famous last
words) that there are two classes of arguments, and by testing a few
from each class we should be home free.

This now comes to `git config` after `git tag` and `git branch`, where
the "complexity" of the problem has been steadily increasing. (Off the
top of my head, tag has two modes, branch has three, config has lots.)
That the tests don't get more complex might be bad, or good. But all of
these use the same basic API (DELAY_PAGER_CONFIG) in the same rather
simple way. I actually almost had the feeling that these tests here were
too much, considering that DELAY_PAGER_CONFIG gets tested quite a few
times by now.

Thanks for your comments. I'll ponder this, and see what I come up with.
Maybe a changed approach, or maybe an extended commit message. Any
further input welcome, as always.

Martin

  reply	other threads:[~2018-02-12 22:41 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-11 16:40 [PATCH 1/3] t7006: add tests for how git config paginates Martin Ågren
2018-02-11 16:40 ` [PATCH 2/3] config: respect `pager.config` in list/get-mode only Martin Ågren
2018-02-13 10:25   ` Duy Nguyen
2018-02-13 11:19     ` Martin Ågren
2018-02-11 16:40 ` [PATCH 3/3] config: change default of `pager.config` to "on" Martin Ågren
2018-02-12 22:17 ` [PATCH 1/3] t7006: add tests for how git config paginates Junio C Hamano
2018-02-12 22:41   ` Martin Ågren [this message]
2018-02-21 18:51 ` [PATCH v2 0/3] " Martin Ågren
2018-02-21 18:51   ` [PATCH v2 1/3] " Martin Ågren
2018-02-21 18:51   ` [PATCH v2 2/3] config: respect `pager.config` in list/get-mode only Martin Ågren
2018-02-21 18:51   ` [PATCH v2 3/3] config: change default of `pager.config` to "on" Martin Ågren
2018-02-21 22:35   ` [PATCH v2 0/3] Re: t7006: add tests for how git config paginates Junio C Hamano

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to='CAN0heSr5bRx7Lrzu4mfeHx3SuZ75bgpXUA75kM1HJ-h=+8dgPQ@mail.gmail.com' \
    --to=martin.agren@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=pclouds@gmail.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).