From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51380) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXXGf-0000Yv-QN for qemu-devel@nongnu.org; Thu, 03 Sep 2015 12:21:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZXXGc-0001ut-5a for qemu-devel@nongnu.org; Thu, 03 Sep 2015 12:21:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53596) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXXGc-0001up-0H for qemu-devel@nongnu.org; Thu, 03 Sep 2015 12:21:38 -0400 Date: Thu, 3 Sep 2015 17:21:32 +0100 From: "Daniel P. Berrange" Message-ID: <20150903162132.GR31547@redhat.com> References: <1441290623-13631-1-git-send-email-armbru@redhat.com> <1441290623-13631-8-git-send-email-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1441290623-13631-8-git-send-email-armbru@redhat.com> Subject: Re: [Qemu-devel] [PATCH RFC v4 07/32] qapi: Generate comments to simplify splitting for review Reply-To: "Daniel P. Berrange" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: qemu-devel@nongnu.org, mdroth@linux.vnet.ibm.com On Thu, Sep 03, 2015 at 04:29:58PM +0200, 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. > > 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. > > 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: > > mkdir -p o > 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" = "//" ] || t="" > mv $j o/"$i-${j#xx}-${t/ /-}" > done > done > > Splits each file F into F-NUMB-ID, where NUMB counts up from 0001, and > ID comes from the // comment. > > To check the split's sane, we can run > > for i in q*-{commands,marshal,event,types,visit}.[ch] > do cat o/$i-* | diff $i - > done > > Signed-off-by: Markus Armbruster Reviewed-by: Daniel P. Berrange Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|