From: Shanthanu <shanthanu.s.rai9@gmail.com>
To: Christian Couder <christian.couder@gmail.com>
Cc: git <git@vger.kernel.org>, "Torsten Bögershausen" <tboegi@web.de>
Subject: Re: [PATCH v2] t9116: avoid using pipes
Date: Wed, 25 Mar 2020 19:30:45 +0530 [thread overview]
Message-ID: <4b40a756-c32f-64ad-1e1d-4e31804d8295@gmail.com> (raw)
In-Reply-To: <CAP8UFD2Uu-dPJcZB--T7k0tMuXc0iVeqnMUn3Y_x+3iaFf9xFQ@mail.gmail.com>
On 25/03/20 12:04 am, Christian Couder wrote:
> On Tue, Mar 24, 2020 at 10:36 AM Shanthanu <shanthanu.s.rai9@gmail.com> wrote:
>> Commit c6f44e1da5 (t9813: avoid using pipes, 2017-01-04) recommends to
>> avoid using pipes, since the exit code of upstream in the pipe is
>> ignored. Hence, redirect the output to a file and parse that file.
>>
>> Commit de26f02db1 (t9001, t9116: avoid pipes, 2020-02-14) noted that
>> this also allows easy debugging in case the test fails, since the file
>> will be left on disk and can be manually inspected.
>>
>> Signed-off-by: Shanthanu <shanthanu.s.rai9@gmail.com>
> We usually ask for a legal name in a format similar to "<Firstname>
> <MaybeMiddleNameInitial> <Lastname>" where <MaybeMiddleNameInitial>
> can be omitted. The name should also match what is in the "From:"
> field of the emails you send.
Okay, I will keep that in mind.
>> ---
>> t/t9116-git-svn-log.sh | 53 +++++++++++++++++++++++++++++++-----------
>> 1 file changed, 39 insertions(+), 14 deletions(-)
>>
>> diff --git a/t/t9116-git-svn-log.sh b/t/t9116-git-svn-log.sh
>> index 0a9f1ef366..56d68e4aed 100755
>> --- a/t/t9116-git-svn-log.sh
>> +++ b/t/t9116-git-svn-log.sh
>> @@ -61,12 +61,16 @@ printf 'r1 \nr2 \nr4 \n' > expected-range-r1-r2-r4
>>
>> test_expect_success 'test ascending revision range' "
>> git reset --hard origin/trunk &&
>> - git svn log -r 1:4 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r1-r2-r4 -
>> + git svn log -r 1:4 >out &&
>> + grep '^r[0-9]' out | cut -d'|' -f1 >actual &&
>> + test_cmp expected-range-r1-r2-r4 actual
>> "
> It seems that the code that your patch changes is repeated a lot in
> this test script. I wonder if it would be better to write a shell
> function to avoid those repetitions.
Oh yeah, that would be better. I will add a function. Just clarifying,
the function should run the git, grep, cut and test_cmp commands?
Also, could you suggest an appropriate name for this function?
prev parent reply other threads:[~2020-03-25 14:00 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-22 12:46 [GSoC][PATCH 0/1] Microproject Submission Shanthanu
2020-03-22 12:46 ` [GSoC][PATCH 1/1] t9116: avoid using pipes Shanthanu
2020-03-22 17:36 ` Torsten Bögershausen
2020-03-23 7:04 ` Shanthanu
2020-03-24 9:35 ` [PATCH v2] " Shanthanu
2020-03-24 18:34 ` Christian Couder
2020-03-25 14:00 ` Shanthanu [this message]
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=4b40a756-c32f-64ad-1e1d-4e31804d8295@gmail.com \
--to=shanthanu.s.rai9@gmail.com \
--cc=christian.couder@gmail.com \
--cc=git@vger.kernel.org \
--cc=tboegi@web.de \
/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).