git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2] blame: report correct number of lines in progress when using ranges

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Apr 5, 2022, 07:46 UTC
Message-ID
<220405.86wng4km5c.gmgdl@evledraar.gmail.com>
In-Reply-To
<b2f5d6af-8da1-3a3a-cc21-848c14a8fb98@gmail.com>
On Tue, Apr 05 2022, Bagas Sanjaya wrote:
Show 37 quoted lines
> 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.

Previous: Bagas SanjayaNext: Edmundo Carmona Antoranz
Message 5 of 11 in “blame: report correct number of lines in progress when using ranges”
  1. blame: report correct number of lines in progress when using rangesEdmundo Carmona Antoranz, Apr 4, 2022
  2. Edmundo Carmona AntoranzApr 4, 2022
  3. Junio C HamanoApr 4, 2022
  4. Bagas SanjayaApr 5, 2022
  5. Ævar Arnfjörð BjarmasonApr 5, 2022
  6. Edmundo Carmona AntoranzApr 5, 2022
  7. Philip OakleyApr 5, 2022
  8. Junio C HamanoApr 6, 2022
  9. Philip OakleyApr 8, 2022
  10. Junio C HamanoApr 8, 2022
  11. Ævar Arnfjörð BjarmasonApr 5, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.