From: Junio C Hamano <gitster@pobox.com>
To: Prathamesh Chavan <pc44800@gmail.com>
Cc: christian.couder@gmail.com, git@vger.kernel.org, jdl@jdl.com
Subject: Re: [Patch v2] t2027: avoid using pipes
Date: Sun, 12 Mar 2017 20:10:19 -0700 [thread overview]
Message-ID: <xmqqk27tub1g.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <20170310083611.7374-1-pc44800@gmail.com> (Prathamesh Chavan's message of "Fri, 10 Mar 2017 14:06:11 +0530")
Prathamesh Chavan <pc44800@gmail.com> writes:
> From: Prathamesh <pc44800@gmail.com>
Your e-mail header says
From: Prathamesh Chavan <pc44800@gmail.com>
and you probably have "[user] name = Prathamesh" somewhere in your
config, and I think that is why we see the above line in format-patch
output and on your sign-off. If you really prefer to be known as a
person with a single name (without Chavan) to the community, that is
fine, but if that is not the case, perhaps you'd want to review your
config and fix this.
> Whenever a git command is present in the upstream of a pipe, its failure
> gets masked by piping and hence it should be avoided for testing the
> upstream git command. By writing out the output of the git command to
> a file, we can test the exit codes of both the commands as a failure exit
> code in any command is able to stop the && chain.
OK.
> Signed-off-by: Prathamesh <pc44800@gmail.com>
> diff --git a/t/t2027-worktree-list.sh b/t/t2027-worktree-list.sh
> index 848da5f36..a3e77fee5 100755
> --- a/t/t2027-worktree-list.sh
> +++ b/t/t2027-worktree-list.sh
> @@ -31,7 +31,8 @@ test_expect_success '"list" all worktrees from main' '
> test_when_finished "rm -rf here && git worktree prune" &&
> git worktree add --detach here master &&
> echo "$(git -C here rev-parse --show-toplevel) $(git rev-parse --short HEAD) (detached HEAD)" >>expect &&
> - git worktree list | sed "s/ */ /g" >actual &&
> + git worktree list >out &&
> + sed "s/ */ /g" <out >actual &&
> test_cmp expect actual
> '
We'll have "out" as a new leftover file, but it probably would not
make too much of a difference. We already leave 'expect' and 'actual'
in the working tree as known crufts.
Just FYI, if you want to clean them, there is already when_finished
in this piece (and others) so you could do
-test_when_finished "rm -rf here && git worktree prune" &&
-test_when_finished "rm -rf here out actual expect && git worktree prune" &&
When a test fails, when_finished is not run, so this will not
interfere with necessary debugging effort when/if somebody breaks
"git worktree" and this test starts failing.
next prev parent reply other threads:[~2017-03-13 3:10 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-09 19:03 [PATCH] t2027: avoid using pipes Prathamesh Chavan
2017-03-09 20:15 ` Christian Couder
2017-03-10 8:36 ` [Patch v2] " Prathamesh Chavan
2017-03-13 3:10 ` Junio C Hamano [this message]
2017-03-13 6:36 ` [PATCH v3] " pc44800
2017-03-13 6:51 ` Prathamesh
2017-03-22 5:03 ` Prathamesh
2017-03-23 10:15 ` Christian Couder
2017-03-24 8:27 ` [GSoC][PATCH v4] " Prathamesh Chavan
2017-03-24 11:58 ` Torsten Bögershausen
2017-03-24 12:04 ` Prathamesh Chavan
2017-04-03 19:40 ` Stefan Beller
2017-04-03 21:35 ` [GSoC][PATCH v5] " Prathamesh Chavan
-- strict thread matches above, loose matches on Subject: below --
2017-03-08 15:13 [PATCH] " Prathamesh Chavan
2017-03-09 9:39 ` [PATCH v2] " Prathamesh Chavan
2017-03-09 9:53 ` Prathamesh Chavan
2017-03-09 12:30 ` Christian Couder
2017-03-10 13:34 ` Prathamesh Chavan
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqk27tub1g.fsf@gitster.mtv.corp.google.com \
--to=gitster@pobox.com \
--cc=christian.couder@gmail.com \
--cc=git@vger.kernel.org \
--cc=jdl@jdl.com \
--cc=pc44800@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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).