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

git-node-land: automatic correction of commit messages #149

Closed
joyeecheung opened this issue Jan 18, 2018 · 3 comments
Closed

git-node-land: automatic correction of commit messages #149

joyeecheung opened this issue Jan 18, 2018 · 3 comments
Labels
feature request New features for node-core-utils git-node stale

Comments

@joyeecheung
Copy link
Member

joyeecheung commented Jan 18, 2018

Should be behind a prompt, but would be very useful:

  1. Wrap commit message bodies
  2. Correct system labels (typos, common alias, e.g. docs -> doc, tls_wrap -> tls), or even generates one based on files changed
  3. Remove duplicate links: see Detect double Refs and Fixes entries. #133
@joyeecheung joyeecheung added the feature request New features for node-core-utils label Jan 18, 2018
@joyeecheung
Copy link
Member Author

joyeecheung commented Jan 18, 2018

Should be done here, need to extract these logic into a separate lib file for the ease of testing

const original = runSync('git', [
'show', 'HEAD', '-s', '--format=%B'
]).trim();
const metadata = this.metadata.trim().split('\n');
const amended = original.split('\n');
if (amended[amended.length - 1] !== '') {
amended.push('');
}
for (const line of metadata) {
if (original.includes(line)) {
if (line) {
cli.warn(`Found ${line}, skipping..`);
}
} else {
amended.push(line);
}
}
const message = amended.join('\n');
const messageFile = this.saveMessage(rev, message);

@github-actions
Copy link
Contributor

This issue is stale because it has been open many days with no activity. It will be closed soon unless the stale label is removed or a comment is made.

@github-actions github-actions bot added the stale label Aug 17, 2020
@priyank-p priyank-p removed the stale label Aug 17, 2020
@github-actions
Copy link
Contributor

This issue is stale because it has been open many days with no activity. It will be closed soon unless the stale label is removed or a comment is made.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New features for node-core-utils git-node stale
Projects
None yet
Development

No branches or pull requests

2 participants