Skip to content

Commit cd19d89

Browse files
nothingmuchjonatack
authored andcommitted
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)?<pre>$]; } die "No <pre> 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[^</pre>$]); 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-
1 parent 340c1a3 commit cd19d89

9 files changed

+13
-13
lines changed

bip-0077.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
Author: Dan Gould <[email protected]>
66
Yuval Kogman <[email protected]>
77
Comments-URI: https://github.com/bitcoin/bips/wiki/Comments:BIP-0077
8-
Post-History: https://github.com/bitcoin/bips/pull/1483
9-
https://gnusha.org/pi/bitcoindev/[email protected]/#t
10-
https://gnusha.org/pi/bitcoindev/[email protected]/#t
118
Status: Draft
129
Type: Standards Track
1310
Created: 2023-08-08
1411
License: BSD-2-Clause
12+
Post-History: https://github.com/bitcoin/bips/pull/1483
13+
https://gnusha.org/pi/bitcoindev/[email protected]/#t
14+
https://gnusha.org/pi/bitcoindev/[email protected]/#t
1515
Requires: 21, 78, 173, 174
1616
```
1717

bip-0078.mediawiki

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
Layer: Applications
44
Title: A Simple Payjoin Proposal
55
Author: Nicolas Dorier <[email protected]>
6-
Replaces: 79
76
Comments-Summary: No comments yet.
87
Comments-URI: https://github.com/bitcoin/bips/wiki/Comments:BIP-0078
98
Status: Draft
109
Type: Standards Track
1110
Created: 2019-05-01
1211
License: BSD-2-Clause
12+
Replaces: 79
1313
</pre>
1414

1515
==Introduction==

bip-0326.mediawiki

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
Layer: Applications
44
Title: Anti-fee-sniping in taproot transactions
55
Author: Chris Belcher <[email protected]>
6-
Status: Draft
7-
Type: Informational
86
Comments-Summary: No comments yet.
97
Comments-URI: https://github.com/bitcoin/bips/wiki/Comments:BIP-0326
8+
Status: Draft
9+
Type: Informational
1010
Created: 2021-06-10
1111
License: CC0-1.0
1212
Post-History: 2021-6-10: https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2021-June/019048.html

bip-0327.mediawiki

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
Author: Jonas Nick <[email protected]>
55
Tim Ruffing <[email protected]>
66
Elliott Jin <[email protected]>
7+
Comments-URI: https://github.com/bitcoin/bips/wiki/Comments:BIP-0327
78
Status: Active
8-
License: BSD-3-Clause
99
Type: Informational
1010
Created: 2022-03-22
11+
License: BSD-3-Clause
1112
Post-History: 2022-04-05: https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2022-April/020198.html [bitcoin-dev] MuSig2 BIP
1213
2022-10-11: https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2022-October/021000.html [bitcoin-dev] MuSig2 BIP
13-
Comments-URI: https://github.com/bitcoin/bips/wiki/Comments:BIP-0327
1414
</pre>
1515

1616
== Introduction ==

bip-0340.mediawiki

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
Comments-URI: https://github.com/bitcoin/bips/wiki/Comments:BIP-0340
99
Status: Final
1010
Type: Standards Track
11+
Created: 2020-01-19
1112
License: BSD-2-Clause
1213
License-Code: BSD-2-Clause
1314
MIT
1415
CC0-1.0
15-
Created: 2020-01-19
1616
Post-History: 2018-07-06: https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2018-July/016203.html [bitcoin-dev] Schnorr signatures BIP
1717
</pre>
1818

bip-0341.mediawiki

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
Type: Standards Track
1212
Created: 2020-01-19
1313
License: BSD-3-Clause
14-
Requires: 340
1514
Post-History: 2019-05-06: https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2019-May/016914.html [bitcoin-dev] Taproot proposal
1615
2019-10-09: https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2019-October/017378.html [bitcoin-dev] Taproot updates
16+
Requires: 340
1717
</pre>
1818

1919
==Introduction==

bip-0342.mediawiki

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
Type: Standards Track
1212
Created: 2020-01-19
1313
License: BSD-3-Clause
14-
Requires: 340, 341
1514
Post-History: 2019-05-06: https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2019-May/016914.html [bitcoin-dev] Taproot proposal
15+
Requires: 340, 341
1616
</pre>
1717

1818
==Introduction==

bip-0350.mediawiki

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
Type: Standards Track
1010
Created: 2020-12-16
1111
License: BSD-2-Clause
12-
Replaces: 173
1312
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
13+
Replaces: 173
1414
</pre>
1515

1616
==Introduction==

bip-0374.mediawiki

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
Comments-URI: https://github.com/bitcoin/bips/wiki/Comments:BIP-0374
99
Status: Draft
1010
Type: Standards Track
11-
License: BSD-2-Clause
1211
Created: 2024-12-26
12+
License: BSD-2-Clause
1313
Post-History: https://gist.github.com/andrewtoth/df97c3260cc8d12f09d3855ee61322ea
1414
https://groups.google.com/g/bitcoindev/c/MezoKV5md7s
1515
</pre>

0 commit comments

Comments
 (0)