MCPcopy Index your code
hub / github.com/getsentry/sentry-javascript / getNewGitCommits

Function getNewGitCommits

scripts/get-commit-list.ts:5–30  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3const ISSUE_URL = 'https://github.com/getsentry/sentry-javascript/pull/';
4
5export function getNewGitCommits(): string[] {
6 const commits = execSync('git log --format="- %s"').toString().split('\n');
7
8 const lastReleasePos = commits.findIndex(commit => /- meta\(changelog\)/i.test(commit));
9
10 const newCommits = commits.splice(0, lastReleasePos).filter(commit => {
11 // Filter out merge commits
12 if (/Merge pull request/.test(commit)) {
13 return false;
14 }
15 // Filter release branch merged
16 if (/Merge branch/.test(commit)) {
17 return false;
18 }
19 // Filter release commit itself
20 if (/release:/.test(commit)) {
21 return false;
22 }
23
24 return true;
25 });
26
27 newCommits.sort((a, b) => a.localeCompare(b));
28
29 return newCommits.map(commit => commit.replace(/#(\d+)/, `[#$1](${ISSUE_URL}$1)`));
30}
31
32function run(): void {
33 // eslint-disable-next-line no-console

Callers 2

runFunction · 0.90
runFunction · 0.85

Calls 4

sortMethod · 0.80
replaceMethod · 0.80
toStringMethod · 0.65
testMethod · 0.65

Tested by

no test coverage detected