Re: [PATCH 4/4] add-patch: render hunks through the pager
- From
- Phillip Wood <phillip.wood123@gmail.com>
- Date
- Jul 12, 2024, 13:26 UTC
- Message-ID
- <803b10ed-1cb3-4314-82c9-cf48d5d0bb90@gmail.com>
- In-Reply-To
- <5effca4d-536c-4e51-a024-5f1e90583176@gmail.com>
Hi Rubén
On 12/07/2024 02:00, Rubén Justo wrote:
> Make the print command to trigger the pager when invoked using a capital
s/to//
> 'P', to make it easier for the user to review long hunks. > > Signed-off-by: Rubén Justo <rjusto@gmail.com>
Thanks for working on this. The code changes all look good, I'm a bit confused by this test though
Show 22 quoted lines
> +test_expect_success TTY 'P does not break if pager ends unexpectly' ' > + test_when_finished "rm -f huge_file; git reset" && > + printf "%2500000s" Y >huge_file && > + git add -N huge_file && > + cat >expect <<-EOF && > + <GREEN>+<RESET><GREEN>22<RESET> > + <GREEN>+<RESET><GREEN>23<RESET> > + <GREEN>+<RESET><GREEN>24<RESET> > + 30<RESET> > + 40<RESET> > + 50<RESET> > + <BOLD;BLUE>(1/1) Stage this hunk [y,n,q,a,d,s,e,p,?]? <RESET> > + EOF > + test_write_lines P | > + ( > + GIT_PAGER="head -1" && > + export GIT_PAGER && > + test_terminal git add -p >actual > + ) && > + tail -n 7 <actual | test_decode_color >actual.trimmed && > + test_cmp expect actual.trimmed > +'
What is huge_file doing and what happens to the single line of pager output?
Thanks
Phillip
> test_expect_success 'split hunk "add -p (edit)"' ' > # Split, say Edit and do nothing. Then: > #