git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: Bagas Sanjaya <bagasdotme@gmail.com>
Cc: Edmundo Carmona Antoranz <eantoranz@gmail.com>,
	gitster@pobox.com, whydoubt@gmail.com, git@vger.kernel.org
Subject: Re: [PATCH v2] blame: report correct number of lines in progress when using ranges
Date: Tue, 05 Apr 2022 09:46:10 +0200	[thread overview]
Message-ID: <220405.86wng4km5c.gmgdl@evledraar.gmail.com> (raw)
In-Reply-To: <b2f5d6af-8da1-3a3a-cc21-848c14a8fb98@gmail.com>


On Tue, Apr 05 2022, Bagas Sanjaya wrote:

> On 05/04/22 01.21, Edmundo Carmona Antoranz wrote:
>> When using ranges, use their sizes as the limit for progress
>> instead of the size of the full file.
>> 
>
> The progress limit is defined by number of affected lines, right?
>
>> +test_expect_success 'blame progress on a full file' '
>> +	cat >progress.txt <<-\EOF &&
>> +	a simple test file
>> +
>> +	no relevant content is expected here
>> +
>> +	If the file is too short, we cannot test ranges
>> +
>> +	EOF
>> +	git add progress.txt &&
>> +	git commit -m "add a file for testing progress" &&
>> +	GIT_PROGRESS_DELAY=0 \
>> +	git blame --progress progress.txt > /dev/null 2> full_progress.txt &&
>> +	grep "Blaming lines: 100% (6/6), done." full_progress.txt
>> +'
>> +
>> +test_expect_success 'blame progress on a single range' '
>> +	GIT_PROGRESS_DELAY=0 \
>> +	git blame --progress -L 2,5 progress.txt > /dev/null 2> range_progress.txt &&
>> +	grep "Blaming lines: 100% (4/4), done." range_progress.txt
>> +'
>> +
>> +test_expect_success 'blame progress on multiple ranges' '
>> +	GIT_PROGRESS_DELAY=0 \
>> +	git blame --progress -L 1,2 -L 4,6 progress.txt > /dev/null 2> range_progress.txt &&
>> +	grep "Blaming lines: 100% (5/5), done." range_progress.txt
>> +'
>> +
>
> Why not using test_i18ngrep?

Nothing should be using test_i18ngrep nowadays, just grep is better. We
no longer test with the gettext "poison" mode which necessitated it.

  reply	other threads:[~2022-04-05  7:47 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-04 18:21 [PATCH v2] blame: report correct number of lines in progress when using ranges Edmundo Carmona Antoranz
2022-04-04 18:25 ` Edmundo Carmona Antoranz
2022-04-04 19:32   ` Junio C Hamano
2022-04-05  7:34 ` Bagas Sanjaya
2022-04-05  7:46   ` Ævar Arnfjörð Bjarmason [this message]
2022-04-05  7:55     ` Edmundo Carmona Antoranz
2022-04-05  9:42   ` Philip Oakley
2022-04-06 15:14     ` Junio C Hamano
2022-04-08  8:03       ` Philip Oakley
2022-04-08 18:16         ` Junio C Hamano
2022-04-05  9:36 ` Ævar Arnfjörð Bjarmason

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=220405.86wng4km5c.gmgdl@evledraar.gmail.com \
    --to=avarab@gmail.com \
    --cc=bagasdotme@gmail.com \
    --cc=eantoranz@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=whydoubt@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.
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 NNTP newsgroup(s).