Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dump git-log to change-log #156

Draft
wants to merge 30 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
957976d
Dump git-log to change-log
HeikoTheissen Sep 22, 2021
4df5141
typo
HeikoTheissen Sep 22, 2021
a06e4a5
Only commits where the long text starts with CHANGELOG
HeikoTheissen Sep 22, 2021
3417423
markdown flavor
HeikoTheissen Sep 23, 2021
195116e
Script for updating CHANGELOG.md
HeikoTheissen Sep 23, 2021
b0d6a81
conditional step for changelog
HeikoTheissen Sep 23, 2021
84e53b0
determination of remote URL
HeikoTheissen Sep 23, 2021
3ec05ca
added test
HeikoTheissen Sep 23, 2021
b2b6e5c
prepare alternative
HeikoTheissen Sep 23, 2021
0ade0ff
corrected nodejs.yml
HeikoTheissen Sep 23, 2021
d0ae1b4
corrected commit message
HeikoTheissen Sep 23, 2021
adac6c7
Update changelog.test.js
ralfhandl Sep 23, 2021
e38f779
Extended test to two changelog entries
HeikoTheissen Sep 23, 2021
9e5daf2
Merge branch 'changelogs' of
HeikoTheissen Sep 23, 2021
290094b
Mechanism to correct typos in the changelog.
HeikoTheissen Sep 23, 2021
0771726
Allow corrections of corrections
HeikoTheissen Sep 23, 2021
cad3ecb
changelog handbook
HeikoTheissen Sep 23, 2021
6682867
Prepare for CHANGELOG.md in main branch
HeikoTheissen Sep 23, 2021
f117ab5
allow indentation in markdown
HeikoTheissen Sep 23, 2021
c7dd50c
Switch to standard-changelog
HeikoTheissen Sep 24, 2021
f8a319d
Revert handbook
HeikoTheissen Sep 24, 2021
641ca41
remove empty line
HeikoTheissen Sep 24, 2021
b839f32
This is no merge commit.
HeikoTheissen Sep 26, 2021
3263262
Own template
HeikoTheissen Sep 26, 2021
c7f63c8
Amendment
HeikoTheissen Sep 26, 2021
1e94709
git add before git commit
HeikoTheissen Sep 30, 2021
622f265
amended changelog entries keep their commit id
HeikoTheissen Oct 1, 2021
f539a8a
maintain CHANGELOG.md in main branch
HeikoTheissen Oct 1, 2021
837a367
Merge branch 'main' into changelogs
ralfhandl Dec 14, 2021
58f61e7
Refreshed package.json and package-lock.json
ralfhandl Dec 14, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions lib/changelog.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const {Transform} = require("stream");

var entry;
var blocked = new Map();

function nextLine(t) {
var offset = t.buffer.indexOf("\n");
Expand Down Expand Up @@ -31,19 +32,22 @@ process.stdin.pipe(
}
})
.on("line", function(line) {
if (line.startsWith("commit")) {
if (/^commit\s+([0-9a-f]*)/.test(line)) {
if (entry && entry.length > 2) this.push(entry.join(""));
entry = undefined;
} else if (/^Date:\s+(.*)$/.test(line))
entry = ["# " + RegExp.$1 + "\n"];
if (blocked.get(RegExp.$1)) entry = undefined;
else entry = [];
} else if (entry && /^Date:\s+(.*)$/.test(line))
entry.push("# " + RegExp.$1 + "\n");
else if (entry && /^\s+\S/.test(line)) {
if (entry.length === 1)
entry.push("");
else if (entry.length === 2) {
if (!/^\s+CHANGELOG\s*$/.test(line))
if (!/^\s+CHANGELOG(\s+([0-9a-f]*))?\s*$/.test(line))
entry = undefined;
else
else {
blocked.set(RegExp.$2, true);
entry.push("");
}
} else
entry.push(line.replace(/^\s*/, "") + "\n");
}
Expand Down
13 changes: 11 additions & 2 deletions test/gitlog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,21 @@ Date: Thu Sep 16 17:24:48 2021 +0200

Temporal vocabulary (#146)

commit 122dff83ef4f139e3361e5af557519c898ee81bd
commit 122dff93ef4f139e3361e5af557519c898ee81bd
Author: Ralf Handl <ralf.handl@sap.com>
Date: Thu Sep 16 17:19:01 2021 +0200

Temporal: example for timeline with object key (#154)

CHANGELOG
CHANGELOG 122dff73ef4f139e3361e5af557519c898ee81bd
HeikoTheissen marked this conversation as resolved.
Show resolved Hide resolved
New vocabulary

commit 122dff73ef4f139e3361e5af557519c898ee81bd
Author: Ralf Handl <ralf.handl@sap.com>
Date: Thu Sep 16 17:19:01 2021 +0200

Temporal: example for timeline with object key (#154)

CHANGELOG
HeikoTheissen marked this conversation as resolved.
Show resolved Hide resolved
New vocabularie