Skip to content
This repository was archived by the owner on Apr 19, 2018. It is now read-only.

Commit 09922ac

Browse files
committed
feat: add Refs URL for commit backports
Refs: nodejs/node#16054
1 parent fb4d578 commit 09922ac

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/backport.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ exports.commitBackport = function commitBackport() {
3131
task: (ctx) => {
3232
const messageTitle = `deps: cherry-pick ${ctx.sha.substring(0, 7)} from upstream V8`;
3333
const messageBody = `Original commit message:\n\n ` +
34-
ctx.message.replace(/\n/g, '\n ');
34+
ctx.message.replace(/\n/g, '\n ') +
35+
`\n\nRefs: https://github.com/v8/v8/commit/${ctx.sha}`;
3536

3637
return execGitNode('add', 'deps/v8')
3738
.then(() => execGitNode('commit', '-m', messageTitle, '-m', messageBody));
@@ -48,8 +49,8 @@ function generatePatch() {
4849
title: 'Generate patch',
4950
task: (ctx) => {
5051
const sha = ctx.sha;
51-
if (!sha) {
52-
throw new Error('Commit SHA is required');
52+
if (!sha || sha.length !== 40) {
53+
throw new Error('--sha option is required and must be 40 characters long');
5354
}
5455
return Promise.all([
5556
execGitV8('format-patch', '--stdout', `${sha}^..${sha}`),

0 commit comments

Comments
 (0)