From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41242) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZMl6E-0008CX-2d for qemu-devel@nongnu.org; Tue, 04 Aug 2015 18:54:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZMl6A-0004Me-A9 for qemu-devel@nongnu.org; Tue, 04 Aug 2015 18:54:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35447) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZMl6A-0004MO-1x for qemu-devel@nongnu.org; Tue, 04 Aug 2015 18:54:18 -0400 References: <1438703896-12553-1-git-send-email-armbru@redhat.com> <1438703896-12553-8-git-send-email-armbru@redhat.com> From: Eric Blake Message-ID: <55C14290.3030500@redhat.com> Date: Tue, 4 Aug 2015 16:54:08 -0600 MIME-Version: 1.0 In-Reply-To: <1438703896-12553-8-git-send-email-armbru@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="wwM6JGtR5IxpNp6Ip7RW0uLRFmTjqNb5A" Subject: Re: [Qemu-devel] [PATCH RFC v3 07/32] qapi: Generate comments to simplify splitting for review List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster , qemu-devel@nongnu.org Cc: kwolf@redhat.com, berto@igalia.com, mdroth@linux.vnet.ibm.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --wwM6JGtR5IxpNp6Ip7RW0uLRFmTjqNb5A Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 08/04/2015 09:57 AM, Markus Armbruster wrote: > The effect of the next few patches on generated files is hard to > review, because stuff gets generated in different order, which renders > diffs of the generated files useless. >=20 > To get reviewable diffs, we need to split the generated files into > suitable parts: put every top-level declaration in a file named like > the thing declared, so we can diff top-level declarations regardless > of their order in the generated files. >=20 > Since I don't feel like parsing C, simply generate a // comment > identifying the declaration right before each top-level declaration. > This lets us split with a simple shell loop: >=20 Helpful notes to any other reviewer: Add 'mkdir -p o' here... > for i in q*-{commands,marshal,event,types,visit}.[ch] > do > csplit -n 4 -s "$i" '/^\/\//' '{*}' > for j in xx* > do > read h t <$j > [ "$h" =3D=3D "//" ] || t=3D"" [ =3D=3D ] is not portable shell (hi, dash users!); =3D works fine. > mv $j "$i-${j#xx}-${t/ /-}" =2E..and modify this line to mv $j "o/$i-..." if you want... > done > done >=20 > Splits each file F into F-NUMB-ID, where NUMB counts up from 0001, and > ID comes from the // comment. >=20 > To check the split's sane, we can run >=20 > for i in q*-{commands,marshal,event,types,visit}.[ch] > do cat o/$i-* | diff $i - =2E..this to work out of the box. (will come in handy later when creating= 'n/' for comparing 'o/*' and 'n/*'). > done >=20 > Signed-off-by: Markus Armbruster > --- Since this patch gets reverted and won't be in v4, it doesn't need R-b. But it definitely helps my review, so thanks for providing it! --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --wwM6JGtR5IxpNp6Ip7RW0uLRFmTjqNb5A 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/ iQEcBAEBCAAGBQJVwUKQAAoJEKeha0olJ0NqQZsIAKPjcG6IpyAo3LZIh/Bo88VM 2Dh3m+1+8+1AjGAfH3aYurdQLGhimySj0/ybN828vsHd7BRgQpBX617bX+J4Nq1z U/kwGziwtpTiHxEObhkLlxN0vV4VnVcaHZjicrnaEvs8UYyVBATiwUGYffTMk+GV Zr+2Ug5vSN+30JxCDrWAxMD8DZIZwYd/CKfm8PPveOXqrL8CIFjTcnmvJRlJ9fwi WpOXp/GuZOdEIws0386OkB854ECJdnzeyDX0j4NxxDz/9t6gXVqUeq6k33pDH71p RRicvKBVE7cvJS7sih0h2mR0D98fOctdZPEdbWrozn4d6AbCgAYsu5W+SkTopIM= =lq83 -----END PGP SIGNATURE----- --wwM6JGtR5IxpNp6Ip7RW0uLRFmTjqNb5A--