di-sukharev / opencommit

Generate conventional git commit messages with AI in 1 second 🤯🔫
https://www.npmjs.com/package/opencommit
MIT License
5.94k stars 311 forks source link

[Bug]: #115

Closed Poshi closed 1 year ago

Poshi commented 1 year ago

Opencommit Version

1.1.38

Node Version

v16.15.1

NPM Version

8.11.0

What OS are you seeing the problem on?

Other Linux Distro

What happened?

I have a GIT repository without defined remotes. It fails after the commit due to not being able to push the changes.

Expected Behavior

I expect not to even try to push anything unless explicitly asked. And, even if it is asked, do not try if not defined remotes.

Current Behavior

It tries to push and fails.

Possible Solution

Do not push if no remotes defined.

Steps to Reproduce

git init touch kk git add kk oc

Relevant log output

└  ✖ 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>
di-sukharev commented 1 year ago

@Poshi looks like you havent set a git remote, so nowhere to push :)

Poshi commented 1 year ago

Thanks! As you said, I haven't set a git remote and I don't want to. But while testing the latest version, I hit the following message:

❯ oc --version
node:internal/encoding:469
          throw new ERR_NO_ICU('"fatal" option');
          ^

TypeError [ERR_NO_ICU]: "fatal" option is not supported on Node.js compiled without ICU
    at new NodeError (node:internal/errors:372:5)
    at new TextDecoder (node:internal/encoding:469:17)
    at node_modules/@dqbd/tiktoken/lite/tiktoken_bg.cjs (/home/groups/pbt/jcamps/.local/lib/node_modules/opencommit/out/cli.cjs:15113:29)
    at __require (/home/groups/pbt/jcamps/.local/lib/node_modules/opencommit/out/cli.cjs:10:50)
    at node_modules/@dqbd/tiktoken/lite/tiktoken.cjs (/home/groups/pbt/jcamps/.local/lib/node_modules/opencommit/out/cli.cjs:15329:16)
    at __require (/home/groups/pbt/jcamps/.local/lib/node_modules/opencommit/out/cli.cjs:10:50)
    at Object.<anonymous> (/home/groups/pbt/jcamps/.local/lib/node_modules/opencommit/out/cli.cjs:21461:27)
    at Module._compile (node:internal/modules/cjs/loader:1105:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
    at Module.load (node:internal/modules/cjs/loader:981:32) {
  code: 'ERR_NO_ICU'
}

I know this is a different bug, but the issue already contains all the requested version information :-) I'm not sure if it could be related to my NodeJS compilation, but so far I've been running opencommit without any issue like this :-?