qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH RFC v3 07/32] qapi: Generate comments to simplif


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH RFC v3 07/32] qapi: Generate comments to simplify splitting for review
Date: Tue, 4 Aug 2015 16:54:08 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0

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.
> 
> 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:
> 

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" == "//" ] || t=""

[ == ] is not portable shell (hi, dash users!); = works fine.

>             mv $j "$i-${j#xx}-${t/ /-}"

...and modify this line to mv $j "o/$i-..." if you want...

>         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 -

...this to work out of the box. (will come in handy later when creating
'n/' for comparing 'o/*' and 'n/*').

>     done
> 
> Signed-off-by: Markus Armbruster <address@hidden>
> ---

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!

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]