qemu-devel
[Top][All Lists]
Advanced

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

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


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

On 08/04/2015 09:58 AM, Markus Armbruster wrote:
> The effect of the previous 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:
> 

As in 7/32, a tip to other reviewers:

mkdir -p n

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

=, not ==

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

mv directly into n/$i-... here

>         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 $i-* | diff $i -

and test cat n/$i-* here.

>     done
> 
> We got a commit similar to this one right before the patches we want
> to check.  If you have that commit's split files in directory o, and
> this commit's split files in directory n, you can diff them with this
> loop:
> 
>     for i in `(ls o; ls n) | sed -n 's/-[0-9][0-9][0-9][0-9]-/-*-/p' | sort | 
> uniq`

Then o/* and n/* are populated correctly for this to work.

>     do
>         diff -uBp o/$i n/$i
>     done
> 
> Complete annotated output:

Explanations are sound. (I may have more comments later after reviewing
the intermediate patches; this email was just my early reminder hint on
how I made your comparison easier to reproduce)

Thanks again for doing this; it makes it a lot easier to be confident on
the rest of the series.

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