From: Dodji Seketeli <dodji@seketeli.org>
To: Giuliano Procida <gprocida@google.com>
Cc: libabigail@sourceware.org, kernel-team@android.com
Subject: Re: [PATCH 3/5 v2] [abidiff] Eliminate some unnecessary blank lines in diff output.
Date: Mon, 16 Mar 2020 17:10:15 +0100 [thread overview]
Message-ID: <87y2s0uvq0.fsf@seketeli.org> (raw)
In-Reply-To: <20200316131025.261522-1-gprocida@google.com> (Giuliano Procida's message of "Mon, 16 Mar 2020 13:10:25 +0000")
Hello Giuliano,
Giuliano Procida <gprocida@google.com> a écrit:
> v2: More code simplification. Tests unchanged.
>
> There is distributed responsibility for horizontal and vertical
> whitespace in the reporting code with indent and new line control
> information being manipulated by and passed in and out of functions.
> Occasionally, this information is ignored or incorrect and the code
> tends to err on the side of more rather than fewer new lines.
>
> The outcome is that abidiff output sometimes contains extra blank
> lines which can be confusing.
>
> This patch eliminates some of the more obvious cases:
>
> - after data member deletions
> - in enumerator change lists
> - after "type size hasn't changed"
> - before listing impacted interfaces
>
> A lot of passing of "new line needed" booleans between functions has
> been eliminated in the process.
>
> The patch cleans up the reporting of data members. The code will
> either emit indentation, a short description and a new line or do
> nothing at all.
>
> The patch also removes some stray location reporting code for array
> diffs which would have produced some oddly placed output. I could not
> get this code to trigger as loc = decl->get_location() was never
> present on the array decls in question.
>
> * src/abg-default-reporter.cc (report): In the type_decl_diff,
> enum_diff, array_diff, class_diff, union_diff and var_diff
> overrides, simplify new line logic which no longer needs to be
> threaded through report_name_size_and_alignment_changes. In
> the distinct_diff override, simplify new line logic which no
> longer needs to be threaded through
> report_size_and_alignment_changes. In the enum_diff override,
> emit just one blank line after each enum. In the array_diff
> override, remove stray location reporting which doesn't appear
> to ever trigger; fix new line logic. In the
> class_or_union_diff override, simplify new line logic for
> deleted members; pass indentation to represent_data_member.
> * src/abg-leaf-reporter.cc (report): In the array_diff,
> class_diff, union_diff and var_diff overrides, simplify new
> line logic which no longer needs to be threaded through
> report_name_size_and_alignment_changes. In the distinct_diff
> override, simplify new line logic which no longer needs to be
> threaded through report_size_and_alignment_changes. In the
> array_diff override, remove stray location reporting which
> doesn't appear to ever trigger; fix new line handling. In the
> class_or_union_diff override, simplify new line logic for
> deleted members; pass indentation to represent_data_member.
> In the corpus_diff override, tabify source indentation.
> * src/abg-reporter-priv.cc (represent_data_member): Handle
> indentation; fix new line logic.
> (report_size_and_alignment_changes): Fix new line logic
> for "type size hasn't changed" message; simplify new line
> logic and replace local bool n with argument bool nl for
> clarity.
> (report_size_and_alignment_changes): Remove bool nl argument
> and associated code as it had become always false; take
> responsibility for emitting terminating new lines and change
> return type to void.
> (report_name_size_and_alignment_changes): Fix new line logic;
> remove bool nl argument and associated code as it had become
> always false; take responsibility for emitting terminating new
> lines and change return type to void.
> (maybe_report_interfaces_impacted_by_diff) In both overrides,
> remove new line prefix code and new_line_prefix argument.
> * src/abg-reporter-priv.h (represent_data_member): Add indent
> argument.
> (report_size_and_alignment_changes) Remove bool nl argument;
> change return type to void.
> (report_name_size_and_alignment_changes) Remove bool nl
> argument; change return type to void.
> (maybe_report_interfaces_impacted_by_diff) In both overrides,
> remove new_line_prefix argument.
> * tests/data/test-*/*report*.txt: Remove some blank lines.
Whoah, thanks a lot for this great work. And many thanks to Matthias
for the review.
What can I say other than, Well, applied to master.
Thanks!
--
Dodji
next prev parent reply other threads:[~2020-03-16 16:10 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-12 6:30 [PATCH 0/5] More whitespace and leaf-changes-only fixes Giuliano Procida
2020-03-12 6:30 ` [PATCH 1/5] Fix interaction of --redundant and --leaf-changes-only options Giuliano Procida
2020-03-13 17:30 ` Dodji Seketeli
2020-03-12 6:30 ` [PATCH 2/5] abg-leaf-reporter.cc: Fix indentation of function parameter diffs Giuliano Procida
2020-03-13 17:37 ` Dodji Seketeli
2020-03-12 6:30 ` [PATCH 3/5] [abidiff] Eliminate some unnecessary blank lines in diff output Giuliano Procida
2020-03-14 20:09 ` Matthias Maennich
2020-03-16 10:51 ` Giuliano Procida
2020-03-16 12:29 ` Matthias Maennich
2020-03-16 13:04 ` Giuliano Procida
2020-03-16 13:44 ` Matthias Maennich
2020-03-16 14:32 ` Giuliano Procida
2020-03-16 13:10 ` [PATCH 3/5 v2] " Giuliano Procida
2020-03-16 16:10 ` Dodji Seketeli [this message]
2020-03-12 6:30 ` [PATCH 4/5] [abidiff] Output 2-space indentation consistently Giuliano Procida
2020-03-13 15:38 ` [PATCH 4/5 v2] " Giuliano Procida
2020-03-17 12:31 ` Dodji Seketeli
2020-03-14 20:12 ` [PATCH 4/5] " Matthias Maennich
2020-03-12 6:30 ` [PATCH 5/5] [abidiff] Treat function type changes as local Giuliano Procida
2020-03-14 20:45 ` Matthias Maennich
2020-03-17 16:15 ` Dodji Seketeli
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87y2s0uvq0.fsf@seketeli.org \
--to=dodji@seketeli.org \
--cc=gprocida@google.com \
--cc=kernel-team@android.com \
--cc=libabigail@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).