From 83774884937790388259d7c3f36607cf943fc47b Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Sun, 9 Nov 2025 12:06:24 +0100 Subject: [PATCH] fix(git-node): clarify remote configuration error message --- lib/session.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/session.js b/lib/session.js index 1f3eafe8..30c66d5e 100644 --- a/lib/session.js +++ b/lib/session.js @@ -382,10 +382,14 @@ export default class Session { cli.setExitCode(1); } if (!upstream) { - cli.warn('You need to configure the remote repository for Node.js core.'); + cli.warn('You have not told git-node what remote name you are trying to land commits on.'); cli.separator(); - cli.info( - '1. First, add the Node.js core repository as a remote (if not already added):\n' + + const remoteName = runSync('git', ['remote', '-v']) + .match(/^(\S+)\s+(?:https:\/\/github\.com\/|git@github\.com:)nodejs\/node\.git \(\S+\)\r?$/m)?.[1]; + cli.info(remoteName + ? `You likely want to run the following:\n\n $ ncu-config set upstream ${remoteName}` + : 'The expected repository does not seem to appear in your local config.\n' + + '1. First, add the Node.js core repository as a remote:\n' + ' $ git remote add upstream https://github.com/nodejs/node.git\n\n' + '2. Then, tell git-node to use this remote for syncing:\n' + ' $ ncu-config set upstream upstream\n\n' +