From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48021) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ztd4D-000281-Oa for qemu-devel@nongnu.org; Tue, 03 Nov 2015 10:00:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ztd47-0006JT-Ot for qemu-devel@nongnu.org; Tue, 03 Nov 2015 10:00:09 -0500 Received: from mx1.redhat.com ([209.132.183.28]:40829) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ztd47-0006JF-Hj for qemu-devel@nongnu.org; Tue, 03 Nov 2015 10:00:03 -0500 References: <1446189186-23104-1-git-send-email-tubo@linux.vnet.ibm.com> <5633AAB3.50606@redhat.com> <56385746.90404@linux.vnet.ibm.com> From: Eric Blake Message-ID: <5638CBEE.3010605@redhat.com> Date: Tue, 3 Nov 2015 07:59:58 -0700 MIME-Version: 1.0 In-Reply-To: <56385746.90404@linux.vnet.ibm.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="wD4hNh9mo2shHlQUuCGlI4Utt2Taaf9eh" Subject: Re: [Qemu-devel] [PATCH v1 1/4] qemu-iotests: refine common.config List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: tu bo , qemu-devel@nongnu.org Cc: kwolf@redhat.com, mreitz@redhat.com, mimu@linux.vnet.ibm.com, armbru@redhat.com, silbe@linux.vnet.ibm.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --wD4hNh9mo2shHlQUuCGlI4Utt2Taaf9eh Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 11/02/2015 11:42 PM, tu bo wrote: > I agree with you. Adding more details as below, > Replacing sed with awk, then it's easier to read. Subjective opinion, but yes, I tend to agree that awk can be a pain to learn when another tool can do the same job. > Replacing "[ ! -z "$default_alias_machine" ]" with "[[ > $default_alias_machine ]]", > then it's slightly shorter. >=20 >> >> [meta-comment] >> >> When sending a series, please include a 0/4 cover letter. You may wan= t >> to do: >> git config format.coverLetter auto >> to make it automatic when using git format-patch/send-email. >=20 > My understanding is that cover letter is needed if the patch set is a > little bit complicated. > Cover letter is not needed if patch set just has minor change and > comment is already in the > git message for every patch. > If my understanding above is wrong, please correct me. I just hope to b= e > more clear about process :-) No, the rule is: if there is more than one patch, you need a cover letter, regardless of how complicated or simple the patches are. If there is only one patch, you don't need a cover letter, but it also doesn't hurt if you have one. When documenting the changes between patch versions, you can either do it all in the cover letter, or on a patch-by-patch basis. Or both. > The goal is not to avoid awk. The line of default_machine is easy to > read, but the > line of default_alias_machine as below is not easy to read, that's why > Sascha > suggest me to change it for the line of default_alias_machine. >=20 > /-default_alias_machine=3D$($QEMU -machine \? |\ - awk -v > var_default_machine=3D"$default_machine"\)\ - '{if > ($(NF-2)=3D=3D"(alias"&&$(NF-1)=3D=3D"of"&&$(NF)=3D=3Dvar_default_machi= ne){print > $1}}')/ >=20 Your mailer botched the quoting here. >> >> default_machine=3D$($QEMU -machine help | sed -n '/(default)/ s/ .*//p= ') >> default_alias_machine=3D$($QEMU -machine help | \ >> sed -n "/(alias of $default_machine)"' { s/ .*//p; q; }') >> >> (which happens to work even if $default_machine contains '.', but migh= t >> get a bit dicey if the machine names could ever contain ?, [, *, or >> other regex metacharacters) >=20 > I like the single sed process. However, I got error message as below > after running it, > /sed: -e expression #1, char 38: unknown command: `.' /I guess you > missed a '/' which is marked as red as below, I intentionally don't read html mail, so I can't see anything marked red. But yes, I missed a close /; it should have been: sed -n "/(alias of $default_machine)/"' { s/ .*//p; q; }' for the sed command inside $() > So I change it as below, > /default_machine=3D$($QEMU -machine help | sed -n '/(default)/ s/ .*//p= ') > default_alias_machine=3D$($QEMU -machine help | \ sed -n "/(alias of > $default_machine)"/' { s/ .*//p; q; }') / Again, quoting is botched, but it looks like you came up with the same fi= x. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --wD4hNh9mo2shHlQUuCGlI4Utt2Taaf9eh Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJWOMvuAAoJEKeha0olJ0NqvrwIAI3vv4x2R81jKvM9ow11wgPh +RZfANdU1h85o52o5beRHDUW/9ROQhnSlOilMd9oIU1eBe3tu/zJuRqnbkG+V4vL yyDlfSm2WYesVvmVOA4vz76lF0UAewwIytQnD2SMw4VrmmNCkFJWwvh800P+e0a+ foy0TDNvOqK6UmLTWco7j4qqfUBTKnUV4f6F00t/rC3o0shgpFqJM/6X0bLtVwqa 8ZO4vjeqK08wODqzGlnUfnqzrKeILsAYhKctzwkrUMRhjGNL7vwytkjx+7k2Hy6z ZPGH6KVL0gBY+lrrqkSSE7CIocj2oCn9I/9tSzLfr3gCi8Rja4zB9p6HhYaH0eY= =wALH -----END PGP SIGNATURE----- --wD4hNh9mo2shHlQUuCGlI4Utt2Taaf9eh--