11---
22name : edg-changes-example
33description : >-
4- Encodes and decodes non-UTF-8 example bytes in Changes changelogs with
5- edg-changes-example («HHHH...» markers) and writes Changes files as UTF-8.
6- Use when editing any Changes file (src/Changes, util/Changes, …), adding
4+ Writes Changes entries as pending_changes/*.txt files (collected
5+ nightly by edg-collect-changes, checked with edg-collect-changes --check),
6+ and encodes/decodes non-UTF-8 example bytes with edg-changes-example
7+ («HHHH...» markers). Use when adding a Changes entry, editing any Changes
8+ file (src/Changes, util/Changes, …) or pending_changes/ entry, adding
79 examples with Latin-1/EUC-JP/Shift-JIS/other non-UTF-8 bytes, or verifying
810 changelog encoding.
911---
1012
11- # ` edg-changes-example ` and Changes files
13+ # Changes entries, ` edg-collect-changes ` , and ` edg-changes-example `
1214
1315## Policy (all ` Changes ` files)
1416
@@ -74,7 +76,50 @@ bytes. No other escapes are interpreted.
7476
7577## Workflow for a new changelog entry
7678
77- 1 . Draft the entry as UTF-8 prose.
79+ New entries are ** not** written into a ` Changes ` file. Each ` Changes ` file
80+ has a ` pending_changes/ ` directory beside it (` src/pending_changes/ ` ,
81+ ` util/pending_changes/ ` , …); add one entry file there per change, named
82+ ` *.txt ` (suggested: ` gh-<N>-<short-slug>.txt ` ). A nightly job
83+ (` .github/workflows/collect-changes.yml ` , midnight US Eastern) runs
84+ ` edg-collect-changes ` , which moves every entry into its ` Changes ` file under
85+ the newest ` Version x.y ` line, adds the date, orders that night's entries by
86+ summary line, and deletes the entry files.
87+
88+ Entry file format:
89+
90+ ``` text
91+ //allowed_words: reflectable memoized
92+ [GH #335]
93+ Type transformations of qualified function types
94+
95+ Previously, the __add_lvalue_reference, __add_rvalue_reference, ...
96+ For example, with --c++11:
97+
98+ using F = void() const;
99+ using F = __add_pointer(F); // Previously a spurious error, now okay.
100+ ```
101+
102+ - Optional leading ` //key: value ` directives (EDG C++ line directive
103+ syntax). ` //allowed_words: ` lists space-separated words the spell check
104+ should accept (identifiers, jargon); repeat the line as needed. Words the
105+ target ` Changes ` file already uses (` constexpr ` , ` lvalue ` , …) are accepted
106+ without it. Directives are dropped when the entry is collected.
107+ - The tag block: one or more comma-separated ` GH #N ` tags in brackets
108+ (` [GH #12,GH #34] ` ; only ` GH #N ` , never ` [] ` ). It may wrap onto several
109+ lines; the tool re-wraps it the way existing entries are wrapped.
110+ - ** No date.** The tool adds it (` m/d/yy ` , padded to 8 columns) in front of
111+ the tags.
112+ - The summary line, one blank line, then the description, in the same style
113+ as existing entries (unindented prose wrapped at 79 columns, two spaces
114+ after periods, examples indented 2 spaces).
115+ - UTF-8, no tabs, at most ** 79** columns per line. Trailing whitespace is
116+ tolerated (it's stripped on collection).
117+
118+ Steps:
119+
120+ 1 . Draft the entry as UTF-8 prose in
121+ ` <dir>/pending_changes/<name>.txt ` (the ` pending_changes/ ` beside
122+ the ` Changes ` file the entry belongs in, usually ` src/ ` ).
781232 . If an example needs non-UTF-8 bytes, author the example in a small raw
79124 file (or produce the markers by hand only when the bytes are already
80125 known), then run ` edg-changes-example encode ` and paste the UTF-8 result
@@ -83,20 +128,35 @@ bytes. No other escapes are interpreted.
83128
84129 ` Note: The above example must be decoded using the edg-changes-example tool. `
85130
86- 4 . Insert the entry into the appropriate ` Changes ` file with a ** UTF-8**
87- write (keep the rest of the file valid UTF-8).
88- 5 . Verify the file still decodes as UTF-8 (raises on failure):
131+ 4 . Check the entry (format, spelling, typos, line length). This is the
132+ check ` edg-check-file-changes ` does for ` pending_changes/*.txt ` files,
133+ which pull request CI runs and which makes the pre-push hook refuse the
134+ push (no override) if anything is wrong:
89135
90136 ``` bash
91- python3 -c " open('path/to/ Changes', encoding='utf-8').read() "
137+ edg-exec -- edg-collect-changes --check src/ Changes src/pending_changes
92138 ```
93139
94- Use the real path (for example ` src/Changes ` ). A clean exit means the
95- whole file is valid UTF-8; a ` UnicodeDecodeError ` means the write
96- introduced non-UTF-8 bytes and must be fixed before continuing.
140+ (Name the ` Changes ` file and ` pending_changes/ ` directory the entry is
141+ in. ` edg-exec ` runs it in the dev-env container, which has ` aspell ` .) For
142+ misspellings that are really identifiers or terms, add them to an
143+ ` //allowed_words: ` line at the very top of the entry, as the failure
144+ message shows; fix real misspellings instead.
145+ 5 . Optionally preview the result without changing anything:
146+ ` edg-collect-changes --dry-run src/Changes src/pending_changes ` .
147+
148+ Edit a ` Changes ` file directly only to correct an entry that has already
149+ been collected; then write it as ** UTF-8** and verify the file still decodes
150+ (raises on failure):
151+
152+ ``` bash
153+ python3 -c " open('path/to/Changes', encoding='utf-8').read()"
154+ ```
97155
98156## Do not
99157
158+ - Add new entries directly to a ` Changes ` file, or put a date in a
159+ ` pending_changes/ ` entry.
100160- Commit raw Latin-1 / Shift-JIS / etc. bytes inside a ` Changes ` file.
101161- Invent alternate note wording; match the existing sentence above.
102162- Run ` encode ` on the entire historical ` src/Changes ` and rewrite it unless
0 commit comments