• Home
  • Raw
  • Download

Lines Matching +full:commit +full:- +full:message

7 //     https://www.apache.org/licenses/LICENSE-2.0
16 // We use this tool to speed up the generation of bi-weekly changelog
17 // updates. It fetches the commits over a user-specified timeframe, derives
18 // a little metadata about each commit, organizes the commits, and renders
23 // Get the commits from the user-specified timeframe.
27 document.querySelector('#status').textContent = `Getting commit data...`;
41 'X-GitHub-Api-Version': '2022-11-28',
46 'An error occurred while fetching the commit data.';
62 // Also, parse the "subject" of the commit, which is the first line
63 // of the commit message.
65 function parseSubject(message) { argument
66 const end = message.indexOf('\n\n');
67 return message.substring(0, end);
72 commits.forEach((commit) => {
74 sha: commit.sha,
75 message: commit.commit.message, property
76 date: commit.commit.committer.date,
77 subject: parseSubject(commit.commit.message),
83 // Derive Pigweed-specific metadata from each commit.
107 function parseTitle(message) { argument
108 const start = message.indexOf(':') + 1;
109 const tmp = message.substring(start);
114 function parseBugUrl(message, bugLabel) { argument
115 const start = message.indexOf(bugLabel);
116 const tmp = message.substring(start);
123 function parseChangeUrl(message) { argument
124 const label = 'Reviewed-on:';
125 const start = message.indexOf(label);
126 const tmp = message.substring(start);
133 let commit = commits[i];
134 const { message, sha } = commit;
135 commit.url = `https://cs.opensource.google/pigweed/pigweed/+/${sha}`;
136 commit.change = parseChangeUrl(message);
137 commit.summary = message.substring(0, message.indexOf('\n'));
138 commit.preamble = message.substring(0, message.indexOf(':'));
139 commit.category = categorize(commit.preamble);
140 commit.title = parseTitle(message);
141 // We use syntax like "pw_{tokenizer,string}" to indicate that a commit
143 // situation. The same commit gets duplicated to each module's section.
147 if (commit.preamble.indexOf('{') > -1) {
148 commit.topics = [];
149 const topics = commit.preamble
151 commit.preamble.indexOf('{') + 1,
152 commit.preamble.indexOf('}'),
155 topics.forEach((topic) => commit.topics.push(`pw_${topic}`));
157 commit.topics = [commit.preamble];
162 if (message.indexOf(bugLabel) > -1) {
163 const bugUrl = parseBugUrl(message, bugLabel);
165 commit.issue = { id: bugId, url: bugUrl };
176 const filteredCommits = commits.filter((commit) => {
177 if (commit.preamble === 'roll') return false;
183 // Render the commit data as reStructuredText.
187 commits.forEach((commit) => {
188 const { category } = commit;
190 commit.topics.forEach((topic) => {
192 ? categories[category][topic].push(commit)
193 : (categories[category][topic] = [commit]);
200 const locale = 'en-US';
201 const format = { day: '2-digit', month: 'short', year: 'numeric' };
209 rest += '.. _docs-changelog-latest:\n\n';
211 rest += `${'-'.repeat(title.length)}\n`;
213 rest += `${'-'.repeat(title.length)}\n\n`;
222 rest += 'Help shape the future of Pigweed! Please visit :ref:`seed-0000`\n';
226 rest += '.. and commit lists to remind you to write a summary for each\n';
237 'Third-party software',
254 rest += `${'-'.repeat(topic.length)}\n\n\n`;
256 commits[category][topic].forEach((commit) => {
257 // Escape any backticks that are used in the commit message.
258 const change = commit.change.replaceAll('`', '\\`');
261 // https://github.com/sphinx-doc/sphinx/issues/3921
262 rest += `* \`${commit.title}\n <${change}>\`__\n`;
263 if (commit.issue)
264 rest += ` (issue \`#${commit.issue.id} <${commit.issue.url}>\`__)\n`;
300 twoWeeksAgo.setDate(twoWeeksAgo.getDate() - 14);
311 const dateFormat = /^\d{4}-\d{2}-\d{2}$/;
318 status.textContent = 'Invalid start or end date (should be YYYY-MM-DD)';