From: Jeff King <peff@peff.net>
To: Matthew DeVore <matvore@comcast.net>
Cc: Andreas Gruenbacher <agruenba@redhat.com>,
git@vger.kernel.org, rpeterso@redhat.com,
Junio C Hamano <gitster@pobox.com>
Subject: Re: [RFC] revision: Add --sticky-default option
Date: Wed, 17 Oct 2018 14:11:56 -0400 [thread overview]
Message-ID: <20181017181156.GA28326@sigill.intra.peff.net> (raw)
In-Reply-To: <alpine.DEB.2.21.1810170620260.166761@matvore-linux.svl.corp.google.com>
On Wed, Oct 17, 2018 at 06:24:05AM -0700, Matthew DeVore wrote:
> > Yuck, t4202 is a mix of older and newer styles. I'm OK with this as-is
> > because you've matched the surrounding code, but these days I'd probably
> > write:
> >
> > test_expect_success '--sticky-default ^<rev>' '
> > {
> > echo sixth
> > echo fifth
> > } >expect &&
> > git log --format=%s --sticky-default ^HEAD~2 >actual &&
> > test_cmp expect actual
> > '
> >
>
> How about test_write_lines? That is a little more readable to me than
> the echos in a subshell. A patch was recently queued with a usage of
> that function:
Ah, yeah, that would be fine. I was trying to avoid a cat/here-doc combo
since it incurs a process, but test_write_lines is readable and fast.
The main style things I wanted to show are:
- setting up the expect file should go in the test_expect block
- no space between ">" and the filename
Those are both present in the surrounding code, but we're slowly
cleaning them up.
-Peff
next prev parent reply other threads:[~2018-10-17 18:12 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-16 21:24 [RFC] revision: Add --sticky-default option Andreas Gruenbacher
2018-10-17 9:12 ` Jeff King
2018-10-17 13:24 ` Matthew DeVore
2018-10-17 18:11 ` Jeff King [this message]
2018-10-17 13:53 ` Andreas Gruenbacher
2018-10-17 18:13 ` Jeff King
2018-10-18 3:23 ` Junio C Hamano
2018-10-18 6:48 ` Jeff King
2018-10-18 6:59 ` Junio C Hamano
2018-10-18 12:17 ` Andreas Gruenbacher
2018-10-18 12:26 ` Junio C Hamano
2018-10-18 12:23 ` Andreas Gruenbacher
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=20181017181156.GA28326@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=agruenba@redhat.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=matvore@comcast.net \
--cc=rpeterso@redhat.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.
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).