git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Phillip Wood <phillip.wood123@gmail.com>
Cc: Eric Sunshine <sunshine@sunshineco.com>,
	 emilyshaffer@google.com, git@vger.kernel.org,
	 Emily Shaffer <nasamuffin@google.com>,
	 Sheik <sahibzone@gmail.com>,  Dragan Simic <dsimic@manjaro.org>
Subject: Re: [PATCH v3] bugreport: reject positional arguments
Date: Mon, 30 Oct 2023 10:59:13 +0900	[thread overview]
Message-ID: <xmqqcywwg9am.fsf@gitster.g> (raw)
In-Reply-To: <xmqqpm0xeyp9.fsf@gitster.g> (Junio C. Hamano's message of "Mon, 30 Oct 2023 09:33:22 +0900")

Junio C Hamano <gitster@pobox.com> writes:

> Junio C Hamano <gitster@pobox.com> writes:
>
>> Phillip Wood <phillip.wood123@gmail.com> writes:
>>
>>> It is rather unfortunate that test_i18ngrep was deprecated without
>>> providing an alternative that offers the same debugging
>>> experience.
>> ...
>> We could rename test_i18ngrep to test_grep (and make test_i18ngrep
>> into a thin wrapper with warnings).
>>
>> 	test_grep -e must-exist file &&
>> 	test_grep ! -e must-not-exist file
>
> ... as the only remaining part in test_18ngrep has no hack to work
> around the tainted localization tests, so "was deprecated without"
> is a bit too strong.  There is nothing we have lost yet.

Having said all that, when re-reading the test_i18ngrep with a fresh
pair of eyes, I somehow doubt there was much upside in "debugging
experience" with test_i18ngrep in the first place, and I doubt if
retaining it with a new name test_grep has much value.

Given that test_i18ngrep (hence test_grep) requires you to have the
haystack in a file, between

    test_i18ngrep must-exist file &&
    test_i18ngrep ! must-not-exist file

and

    grep must-exist file &&
    ! grep must-not-exist file

I do not see any difference in "debugging experience" when you run
the test with "-i [-v] -d".   The two cases you care about are

 (1) the test expects the string "must-exist" in the file "file" but
     the string is not there.

 (2) the test expects the string "must-not-exist" missing from the
     file "file", but the string is there.

The latter can clearly be seen in output from "-i -v -d" (the "grep"
outputs a line with "must-not-exist" on it).  The former will show
silence but since you are debugging with "-d", and your haystack is
in a file, after such a step fails, the test stops, and without
removing the "file" even if the test piece had test_when_finished
to remove it (i.e. running tests in debugging mode "-d" and
immediately stopping upon failure "-i" behaves this way exactly to
help you debugging), so you can go there to the TRASH_DIRECTORY
yourself and inspect "file" to see what is going on anyway.

So, I dunno.  Surely with a long &&-chain of steps, where a grep
that expects lack of something is in the middle, it is hard to see
if the lack of hit is because an earlier step failed (and the
control did not reach "grep must-exist file") or because the
haystack lacked the "must-exist" needle, so from that point of view,
it may be nicer that "did not find an expected match" is explicitly
stated.


  reply	other threads:[~2023-10-30  1:59 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-25 20:59 git bugreport with invalid CLI argument does not report error Sheik
2023-10-25 22:53 ` Emily Shaffer
2023-10-25 23:11   ` Eric Sunshine
2023-10-26  0:55     ` [PATCH v2] bugreport: reject positional arguments emilyshaffer
2023-10-26  3:43       ` Eric Sunshine
2023-10-26  3:52         ` Dragan Simic
2023-10-26  4:03           ` Eric Sunshine
2023-10-26  4:06             ` Dragan Simic
2023-10-26 15:54       ` [PATCH v3] " emilyshaffer
2023-10-26 17:18         ` Eric Sunshine
2023-10-27 14:41           ` Phillip Wood
2023-10-30  0:15             ` Junio C Hamano
2023-10-30  0:26             ` Junio C Hamano
2023-10-30  0:33               ` Junio C Hamano
2023-10-30  1:59                 ` Junio C Hamano [this message]
2023-10-30 14:11                   ` Phillip Wood
2023-10-30 23:31                     ` Junio C Hamano
2023-10-31  2:17                       ` Junio C Hamano
2023-10-31  5:23                     ` [PATCH 0/2] Deprecate test_i18ngrep further Junio C Hamano
2023-10-31  5:23                       ` [PATCH 1/2] test framework: further deprecate test_i18ngrep Junio C Hamano
2023-10-31  5:23                       ` [PATCH 2/2] tests: teach callers of test_i18ngrep to use test_grep Junio C Hamano
2023-11-01 14:44                         ` Phillip Wood
2023-11-01 23:19                           ` Junio C Hamano
2023-10-26 18:22         ` [PATCH v4 0/2] bugreport: reject positional arguments emilyshaffer
2023-10-26 20:13           ` Eric Sunshine
2023-10-26 18:22         ` [PATCH v4 1/2] t0091-bugreport: stop using i18ngrep emilyshaffer
2023-10-29 23:59           ` Junio C Hamano
2023-10-26 18:22         ` [PATCH v4 2/2] bugreport: reject positional arguments emilyshaffer

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=xmqqcywwg9am.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=dsimic@manjaro.org \
    --cc=emilyshaffer@google.com \
    --cc=git@vger.kernel.org \
    --cc=nasamuffin@google.com \
    --cc=phillip.wood123@gmail.com \
    --cc=sahibzone@gmail.com \
    --cc=sunshine@sunshineco.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).