You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you run oco without having set a remote destination, it crashes with
siraj at blakberrisigma in …/testing at master () 87% on 21:11
> oco
┌ open-commit
│
◇ No files are staged
│
◇ Do you want to stage all files and generate commit message?
│ No
│
◇ Select the files you want to add to the commit:
│ somefile.txt
│
◇ Done
┌ open-commit
│
◇ 1 staged files:
somefile.txt
│
◇ 📝 Commit message generated
│
└ Generated commit message:
——————————————————
feat(somefile.txt): add somefile.txt with universe-breaking changes and heavy commit
——————————————————
│
◇ Confirm the commit message?
│ Yes
│
◇ ✔ Successfully committed
│
└ [master (root-commit) 14700fa] feat(somefile.txt): add somefile.txt with universe-breaking changes and heavy commit
1 file changed, 4 insertions(+)
│
◇ ✖ Failed to generate the commit message
Error: Command failed with exit code 128: git push
fatal: No configured push destination.
Either specify the URL from the command-line or configure a remote repository using
git remote add <name><url>
and then push using the remote name
git push <name>
at makeError (/opt/homebrew/lib/node_modules/opencommit/out/cli.cjs:48250:13)
at handlePromise (/opt/homebrew/lib/node_modules/opencommit/out/cli.cjs:48706:29)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async generateCommitMessageFromGitDiff (/opt/homebrew/lib/node_modules/opencommit/out/cli.cjs:64660:37)
at async trytm (/opt/homebrew/lib/node_modules/opencommit/out/cli.cjs:64584:18)
at async commit (/opt/homebrew/lib/node_modules/opencommit/out/cli.cjs:64786:35)
at async commit (/opt/homebrew/lib/node_modules/opencommit/out/cli.cjs:64779:5) {
shortMessage: 'Command failed with exit code 128: git push',
command: 'git push',
escapedCommand: 'git push',
exitCode: 128,
signal: undefined,
signalDescription: undefined,
stdout: '',
stderr: 'fatal: No configured push destination.\n' +
'Either specify the URL from the command-line or configure a remote repository using\n' +
'\n' +
' git remote add <name> <url>\n' +
'\n' +
'and then push using the remote name\n' +
'\n' +
' git push <name>\n',
cwd: '/Users/siraj/testing',
failed: true,
timedOut: false,
isCanceled: false,
killed: false
}
│
└ ✖ Command failed with exit code 128: git push
fatal: No configured push destination.
Either specify the URL from the command-line or configure a remote repository using
git remote add <name><url>
and then push using the remote name
git push <name>
I'm aware that a remote should be set first, but the tool should still gracefully exit with an error message, instead of crashing, just logging it here if you think this should be fixed.
Expected Behavior
opencommit should gracefully exit with an error message if no remote url is specified, instead of crashing.
Current Behavior
Errors out with a crash (See above log)
Possible Solution
Handling the condition of no remote url specified with an error message
Steps to Reproduce
mkdir testing &&cd testing
echo"some legendary change">> somefile.txt
git init
oco
..
// choose to generate commit message and then commit the file
Relevant log output
The text was updated successfully, but these errors were encountered:
Edit: I'm guessing this crash is an expected behaviour looking at the test case push and cause error when there is no remote, so its designed to crash-error instead of gracefully handling it
Opencommit Version
3.2.5
Node Version
23.4.0
NPM Version
10.9.2
What OS are you seeing the problem on?
Mac
What happened?
If you run
oco
without having set a remote destination, it crashes withI'm aware that a remote should be set first, but the tool should still gracefully exit with an error message, instead of crashing, just logging it here if you think this should be fixed.
Expected Behavior
opencommit
should gracefully exit with an error message if no remote url is specified, instead of crashing.Current Behavior
Errors out with a crash (See above log)
Possible Solution
Handling the condition of no remote url specified with an error message
Steps to Reproduce
Relevant log output
The text was updated successfully, but these errors were encountered: