From: Phil Sutter <phil@nwl.cc>
To: Thomas Haller <thaller@redhat.com>
Cc: NetFilter <netfilter-devel@vger.kernel.org>,
Florian Westphal <fw@strlen.de>,
Pablo Neira Ayuso <pablo@netfilter.org>
Subject: Re: [PATCH nft 2/2 v2] tests/shell: have .json-nft dumps prettified to wrap lines
Date: Thu, 8 Feb 2024 18:31:01 +0100 [thread overview]
Message-ID: <ZcUP1XPfrGtH4Mm5@orbyte.nwl.cc> (raw)
In-Reply-To: <20231207091226.562439-1-thaller@redhat.com>
On Thu, Dec 07, 2023 at 10:08:50AM +0100, Thomas Haller wrote:
> Previously, the .json-nft file in git contains the output of `nft -j
> list ruleset`. This is one long line and makes diffs harder to review.
>
> Instead, have the prettified .json-nft file committed to git.
>
> - the diff now operates on the prettified version. That means, it
> compares essentially
>
> - `nft -j list ruleset | json-sanitize-ruleset.sh | json-pretty.sh`
> - `cat "$TEST.json-nft" | json-pretty.sh`
>
> The script "json-diff-pretty.sh" is no longer used. It is kept
> however, because it might be a useful for manual comparing files.
>
> Note that "json-sanitize-ruleset.sh" and "json-pretty.sh" are still
> two separate scripts and called at different times. They also do
> something different. The former mangles the JSON to account for changes
> that are not stable (in the JSON data itself), while the latter only
> pretty prints it.
>
> - when generating a new .json-nft dump file, the file will be updated to
> use the new, prettified format, unless the file is in the old format
> and needs no update. This means, with DUMPGEN=y, old style is preserved
> unless an update becomes necessary.
>
> This requires "json-pretty.sh" having stable output, as those files are
> committed to git. This is probably fine.
>
> Signed-off-by: Thomas Haller <thaller@redhat.com>
Patch applied and pushed along with a bulk dump file conversion to
pretty format.
Thanks, Phil
prev parent reply other threads:[~2024-02-08 17:31 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-24 12:45 [PATCH nft 0/2] pretty print .json-nft files Thomas Haller
2023-11-24 12:45 ` [PATCH nft 1/2] tests/shell: use generated ruleset for `nft --check` Thomas Haller
2023-11-24 12:45 ` [PATCH nft 2/2] tests/shell: have .json-nft dumps prettified to wrap lines Thomas Haller
2023-12-07 9:08 ` [PATCH nft 2/2 v2] " Thomas Haller
2024-02-08 17:31 ` Phil Sutter [this message]
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=ZcUP1XPfrGtH4Mm5@orbyte.nwl.cc \
--to=phil@nwl.cc \
--cc=fw@strlen.de \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.org \
--cc=thaller@redhat.com \
/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 NNTP newsgroup(s).