From cd19d89e58b8c9b84f18efb5659220d4755fff0b Mon Sep 17 00:00:00 2001 From: Yuval Kogman Date: Thu, 10 Jul 2025 02:24:55 +0200 Subject: [PATCH] scripted-diff: fix BIP 2 field order violations -BEGIN VERIFY SCRIPT- set -e perl <<'-END PERL-' use strict; use warnings; my $topbip = 9999; my @FieldOrder = qw( BIP Layer Title Author Authors Editor Deputies Discussions-To Comments-Summary Comments-URI Status Type Created License License-Code Discussion Post-History Version Requires Replaces Proposed-Replacement Superseded-By ); my $bipnum = 0; while (++$bipnum <= $topbip) { my $fn = sprintf "bip-%04d.mediawiki", $bipnum; my $is_markdown = 0; if (!-e $fn) { $fn = sprintf "bip-%04d.md", $bipnum; $is_markdown = 1; } -e $fn || next; open my $F, "<", $fn or die "$!"; my (@before, %preamble, @after); if ($is_markdown) { while (<$F>) { push @before, $_; last if m[^(?:\xef\xbb\xbf)?```$] } die "No ``` in $fn" if eof $F; } else { while (<$F>) { push @before, $_; last if m[^(?:\xef\xbb\xbf)?
$];
		}
		die "No 
 in $fn" if eof $F;
	}
	my %found;
	my ($title, $author, $status, $type, $layer);
	my ($field, $val, @field_order);
	while (<$F>) {
		push @after, $_ and last if ($is_markdown && m[^```$]);
		push @after, $_ and last if (!$is_markdown && m[^
$]); if (m[^ ([\w-]+)\: (.*\S)$]) { $field = $1; $val = $2; } elsif (m[^ ( +)(.*\S)$]) { $val = $2; } else { die "Bad line in $fn preamble"; } push @{$preamble{$field} ||= []}, $_; } push @after, <$F>; close $F or die $!; open my $W, ">", "$fn" or die "$!"; print $W @before; print $W map { @$_ } grep { defined } delete @preamble{@FieldOrder}; die "Unknown fields: @{[ keys %preamble ]}" if %preamble; print $W @after; close $W or die $!; } -END PERL- -END VERIFY SCRIPT- --- bip-0077.md | 6 +++--- bip-0078.mediawiki | 2 +- bip-0326.mediawiki | 4 ++-- bip-0327.mediawiki | 4 ++-- bip-0340.mediawiki | 2 +- bip-0341.mediawiki | 2 +- bip-0342.mediawiki | 2 +- bip-0350.mediawiki | 2 +- bip-0374.mediawiki | 2 +- 9 files changed, 13 insertions(+), 13 deletions(-) diff --git a/bip-0077.md b/bip-0077.md index 8021503b..790bad60 100644 --- a/bip-0077.md +++ b/bip-0077.md @@ -5,13 +5,13 @@ Author: Dan Gould Yuval Kogman Comments-URI: https://github.com/bitcoin/bips/wiki/Comments:BIP-0077 - Post-History: https://github.com/bitcoin/bips/pull/1483 - https://gnusha.org/pi/bitcoindev/7B11AE34-27A7-46ED-95BF-66CA13BA26F3@ngould.dev/#t - https://gnusha.org/pi/bitcoindev/3C0A6E4C-444E-4E75-829C-1A21D8EE40E0@ngould.dev/#t Status: Draft Type: Standards Track Created: 2023-08-08 License: BSD-2-Clause + Post-History: https://github.com/bitcoin/bips/pull/1483 + https://gnusha.org/pi/bitcoindev/7B11AE34-27A7-46ED-95BF-66CA13BA26F3@ngould.dev/#t + https://gnusha.org/pi/bitcoindev/3C0A6E4C-444E-4E75-829C-1A21D8EE40E0@ngould.dev/#t Requires: 21, 78, 173, 174 ``` diff --git a/bip-0078.mediawiki b/bip-0078.mediawiki index a865543a..63cc5ed4 100644 --- a/bip-0078.mediawiki +++ b/bip-0078.mediawiki @@ -3,13 +3,13 @@ Layer: Applications Title: A Simple Payjoin Proposal Author: Nicolas Dorier - Replaces: 79 Comments-Summary: No comments yet. Comments-URI: https://github.com/bitcoin/bips/wiki/Comments:BIP-0078 Status: Draft Type: Standards Track Created: 2019-05-01 License: BSD-2-Clause + Replaces: 79
==Introduction== diff --git a/bip-0326.mediawiki b/bip-0326.mediawiki index 526ab5fa..d8148f5e 100644 --- a/bip-0326.mediawiki +++ b/bip-0326.mediawiki @@ -3,10 +3,10 @@ Layer: Applications Title: Anti-fee-sniping in taproot transactions Author: Chris Belcher - Status: Draft - Type: Informational Comments-Summary: No comments yet. Comments-URI: https://github.com/bitcoin/bips/wiki/Comments:BIP-0326 + Status: Draft + Type: Informational Created: 2021-06-10 License: CC0-1.0 Post-History: 2021-6-10: https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2021-June/019048.html diff --git a/bip-0327.mediawiki b/bip-0327.mediawiki index 7eb8d1a6..d5cda11d 100644 --- a/bip-0327.mediawiki +++ b/bip-0327.mediawiki @@ -4,13 +4,13 @@ Author: Jonas Nick Tim Ruffing Elliott Jin + Comments-URI: https://github.com/bitcoin/bips/wiki/Comments:BIP-0327 Status: Active - License: BSD-3-Clause Type: Informational Created: 2022-03-22 + License: BSD-3-Clause Post-History: 2022-04-05: https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2022-April/020198.html [bitcoin-dev] MuSig2 BIP 2022-10-11: https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2022-October/021000.html [bitcoin-dev] MuSig2 BIP - Comments-URI: https://github.com/bitcoin/bips/wiki/Comments:BIP-0327 == Introduction == diff --git a/bip-0340.mediawiki b/bip-0340.mediawiki index 97c9fa9b..90e424c7 100644 --- a/bip-0340.mediawiki +++ b/bip-0340.mediawiki @@ -8,11 +8,11 @@ Comments-URI: https://github.com/bitcoin/bips/wiki/Comments:BIP-0340 Status: Final Type: Standards Track + Created: 2020-01-19 License: BSD-2-Clause License-Code: BSD-2-Clause MIT CC0-1.0 - Created: 2020-01-19 Post-History: 2018-07-06: https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2018-July/016203.html [bitcoin-dev] Schnorr signatures BIP diff --git a/bip-0341.mediawiki b/bip-0341.mediawiki index 83e4c7cb..183fde3a 100644 --- a/bip-0341.mediawiki +++ b/bip-0341.mediawiki @@ -11,9 +11,9 @@ Type: Standards Track Created: 2020-01-19 License: BSD-3-Clause - Requires: 340 Post-History: 2019-05-06: https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2019-May/016914.html [bitcoin-dev] Taproot proposal 2019-10-09: https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2019-October/017378.html [bitcoin-dev] Taproot updates + Requires: 340 ==Introduction== diff --git a/bip-0342.mediawiki b/bip-0342.mediawiki index 64d07cc2..2b6ab709 100644 --- a/bip-0342.mediawiki +++ b/bip-0342.mediawiki @@ -11,8 +11,8 @@ Type: Standards Track Created: 2020-01-19 License: BSD-3-Clause - Requires: 340, 341 Post-History: 2019-05-06: https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2019-May/016914.html [bitcoin-dev] Taproot proposal + Requires: 340, 341 ==Introduction== diff --git a/bip-0350.mediawiki b/bip-0350.mediawiki index 4c30b8f8..c4129f1f 100644 --- a/bip-0350.mediawiki +++ b/bip-0350.mediawiki @@ -9,8 +9,8 @@ Type: Standards Track Created: 2020-12-16 License: BSD-2-Clause - Replaces: 173 Post-History: 2021-01-05: https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2021-January/018338.html [bitcoin-dev] Bech32m BIP: new checksum, and usage for segwit address + Replaces: 173 ==Introduction== diff --git a/bip-0374.mediawiki b/bip-0374.mediawiki index 0abb8957..e5895621 100644 --- a/bip-0374.mediawiki +++ b/bip-0374.mediawiki @@ -8,8 +8,8 @@ Comments-URI: https://github.com/bitcoin/bips/wiki/Comments:BIP-0374 Status: Draft Type: Standards Track - License: BSD-2-Clause Created: 2024-12-26 + License: BSD-2-Clause Post-History: https://gist.github.com/andrewtoth/df97c3260cc8d12f09d3855ee61322ea https://groups.google.com/g/bitcoindev/c/MezoKV5md7s