From: Phillip Wood Date: Fri, 12 Jul 2024 13:26:22 GMT Subject: Re: [PATCH 4/4] add-patch: render hunks through the pager 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 Thanks for working on this. The code changes all look good, I'm a bit confused by this test though > +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 && > + +22 > + +23 > + +24 > + 30 > + 40 > + 50 > + (1/1) Stage this hunk [y,n,q,a,d,s,e,p,?]? > + EOF > + test_write_lines P | > + ( > + GIT_PAGER="head -1" && > + export GIT_PAGER && > + test_terminal git add -p >actual > + ) && > + tail -n 7 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: > #