qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Kevin Wolf <kwolf@redhat.com>, qemu-block@nongnu.org
Cc: mreitz@redhat.com, quintela@redhat.com, dgilbert@redhat.com,
	stefanha@redhat.com, qemu-devel@nongnu.org, lvivier@redhat.com
Subject: Re: [Qemu-devel] [PATCH v2 2/3] qemu-iotests: Filter HMP readline escape characters
Date: Wed, 19 Apr 2017 10:31:06 -0500	[thread overview]
Message-ID: <e0d041b3-033e-b260-f680-90aec1f9e00c@redhat.com> (raw)
In-Reply-To: <1492614962-20946-3-git-send-email-kwolf@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1977 bytes --]

On 04/19/2017 10:16 AM, Kevin Wolf wrote:
> The only thing the escape characters achieve is making the reference
> output unreadable and lines that are potentially so long that git
> doesn't want to put them into an email any more. Let's filter them out.
> 
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
>  tests/qemu-iotests/028.out       |   2 +-
>  tests/qemu-iotests/051           |   3 +-
>  tests/qemu-iotests/051.out       | 106 +++++++++++++++----------------
>  tests/qemu-iotests/051.pc.out    | 132 +++++++++++++++++++--------------------
>  tests/qemu-iotests/068           |   4 +-
>  tests/qemu-iotests/068.out       |   6 +-
>  tests/qemu-iotests/130.out       |   4 +-
>  tests/qemu-iotests/142           |   2 +-
>  tests/qemu-iotests/142.out       |  10 +--
>  tests/qemu-iotests/145           |   3 +-
>  tests/qemu-iotests/145.out       |   2 +-
>  tests/qemu-iotests/common.filter |   7 +++
>  tests/qemu-iotests/common.qemu   |   4 +-
>  13 files changed, 147 insertions(+), 138 deletions(-)

> +++ b/tests/qemu-iotests/common.filter
> @@ -86,6 +86,13 @@ _filter_qmp()
>          -e '    QMP_VERSION'
>  }
>  
> +# readline makes HMP command strings so long that git complains
> +_filter_hmp()
> +{
> +    sed -e $'s/^\((qemu) \)\\?.*\e\\[D/\\1/g' \

Inside $'', \ must be escaped to guarantee defined behavior in cases
where you want literal \ in the result (the fact that bash lets \( pass
through literally for now is not good to rely on).

sed -e $'s/^\\((qemu) \\)\\?.*\e\\[D/\\1/g' \

The other way is to use token concatenation, using '' for the bulk of
the string and $'' only for \e, although I don't know if it reads any
better:

sed -e 's/^\((qemu) \)\?.*'$'\e''\[D/\1/g' \

With that line fixed (by either style),
Reviewed-by: Eric Blake <eblake@redhat.com>

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

  reply	other threads:[~2017-04-19 15:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-19 15:15 [Qemu-devel] [PATCH v2 0/3] migration: Call blk_resume_after_migration() for postcopy Kevin Wolf
2017-04-19 15:16 ` [Qemu-devel] [PATCH v2 1/3] " Kevin Wolf
2017-04-19 15:16 ` [Qemu-devel] [PATCH v2 2/3] qemu-iotests: Filter HMP readline escape characters Kevin Wolf
2017-04-19 15:31   ` Eric Blake [this message]
2017-04-19 15:16 ` [Qemu-devel] [PATCH v2 3/3] qemu-iotests: Test postcopy migration Kevin Wolf
2017-04-20 14:18   ` Fam Zheng
2017-04-20 14:39     ` Daniel P. Berrange
2017-05-03 13:33 ` [Qemu-devel] [PATCH v2 0/3] migration: Call blk_resume_after_migration() for postcopy Stefan Hajnoczi

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=e0d041b3-033e-b260-f680-90aec1f9e00c@redhat.com \
    --to=eblake@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=lvivier@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=stefanha@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).