[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH RFC v2 37/47] qapi: De-duplicate parameter list
From: |
Markus Armbruster |
Subject: |
Re: [Qemu-devel] [PATCH RFC v2 37/47] qapi: De-duplicate parameter list generation |
Date: |
Wed, 29 Jul 2015 10:36:10 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) |
Eric Blake <address@hidden> writes:
> On 07/28/2015 05:15 AM, Markus Armbruster wrote:
>
>>> Yeah, avoiding line wraps consumes fewer source bytes (fewer runs of
>>> spaces), but the space isn't being wasted by storing generated files in
>>> git, nor does the C compiler care which layout we use. And honestly,
>>> it's easier to spot changes in a vertical list than it is on a long
>>> horizontal line, if a parameter gets added (or removed, although adding
>>> is the more likely action with qapi).
>>
>> Number of source bytes is not an issue.
>>
>> The generators make no effort to wrap source lines, except in the
>> qapi_event_send_FOO()'s parameter lists.
>>
>> We could preserve that one-off. We could extend it to more places that
>> can generate long lines, saddling the generation code with indentation
>> concerns. I don't want to write such code, and I don't want to maintain
>> it.
>>
>> Instead, why not keep the generators straightforward, and feed their
>> result to indent when "pretty" is wanted? Requires an indent profile
>> matching QEMU style.
>
> Long lines aren't the end of the world. They may be harder to read when
> diffing pre- and post-patch generated output to see if a generator
> change makes sense, but you have a point that line wrapping is more
> maintenance. So you win; keep the long lines, and if someone wants
> wrapping, they can (re-)add it as a later patch series.
Settled.
Aside: diff-mode can color the parts of the changed lines that actually
differ. Indispensable, and not just for long lines.
- Re: [Qemu-devel] [PATCH RFC v2 26/47] qapi-types: Convert to QAPISchemaVisitor, fixing flat unions, (continued)
[Qemu-devel] [PATCH RFC v2 32/47] qapi-event: Convert to QAPISchemaVisitor, fixing data with base, Markus Armbruster, 2015/07/01
[Qemu-devel] [PATCH RFC v2 37/47] qapi: De-duplicate parameter list generation, Markus Armbruster, 2015/07/01
[Qemu-devel] [PATCH RFC v2 38/47] qapi-commands: De-duplicate output marshaling functions, Markus Armbruster, 2015/07/01
[Qemu-devel] [PATCH RFC v2 28/47] qapi-commands: Convert to QAPISchemaVisitor, Markus Armbruster, 2015/07/01
[Qemu-devel] [PATCH RFC v2 43/47] qmp: Improve netdev_add usage example in the manual, Markus Armbruster, 2015/07/01
[Qemu-devel] [PATCH RFC v2 42/47] qapi-schema: Fix up misleading specification of netdev_add, Markus Armbruster, 2015/07/01