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

Pathspec issue on windows #7

Open
martic opened this issue Dec 6, 2022 · 3 comments
Open

Pathspec issue on windows #7

martic opened this issue Dec 6, 2022 · 3 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@martic
Copy link

martic commented Dec 6, 2022

Does the Commit message need to include the filenames included in the commit?

I have ran commitgpt a few times for this commit and none of the suggestions include the filename.
But it looks as if the filename is required in the commit message.

√ Pick a message · Update password reset duration to 60 minutes
error: pathspec 'password' did not match any file(s) known to git
error: pathspec 'reset' did not match any file(s) known to git
error: pathspec 'duration' did not match any file(s) known to git
error: pathspec 'to' did not match any file(s) known to git
error: pathspec '60' did not match any file(s) known to git
error: pathspec 'minutes'' did not match any file(s) known to git
Aborted.
Error: Command failed: git commit -m 'Update password reset duration to 60 minutes'
    at checkExecSyncError (node:child_process:871:11)
    at execSync (node:child_process:943:15)
    at file:///C:/Users/xxxxxx/AppData/Local/npm-cache/_npx/de3899c053a47706/node_modules/commitgpt/dist/index.js:122:25
    at step (file:///C:/Users/xxxxxx/AppData/Local/npm-cache/_npx/de3899c053a47706/node_modules/commitgpt/dist/index.js:33:23)
    at Object.next (file:///C:/Users/xxxxxx/AppData/Local/npm-cache/_npx/de3899c053a47706/node_modules/commitgpt/dist/index.js:14:53)
    at fulfilled (file:///C:/Users/xxxxxx/AppData/Local/npm-cache/_npx/de3899c053a47706/node_modules/commitgpt/dist/index.js:5:58)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  status: 1,
  signal: null,
  output: [ null, null, null ],
  pid: 22868,
  stdout: null,
  stderr: null
}
@RomanHotsiy
Copy link
Owner

I'm not clear on what you mean. Can you provide more details?

@RomanHotsiy RomanHotsiy added the question Further information is requested label Dec 7, 2022
@martic
Copy link
Author

martic commented Dec 7, 2022

I'm running in Poweshell on windows.
I think when it generates the commit and sends it to execSync that maybe windows needs it in double quotes.

execSync("git commit -m '".concat(answer.message.replace(/'/, "\'"), "'"), { stdio: 'inherit' });

git commit -m 'Update password reset duration to 60 minutes'

It looks as if pathSpec is interpreting each word of the commit as separate parameters hence pathspec errors.
error: pathspec 'password' did not match any file(s) known to git
error: pathspec 'reset' did not match any file(s) known to git
error: pathspec 'duration' did not match any file(s) known to git

@bjornkpu
Copy link

bjornkpu commented Dec 9, 2022

I have the same issue.

OS: Windows 11.
Terminals: Visual studio integrated terminal, windows terminal, bash
with both PowerShell v17.4.2 and Ubuntu 20.04 LTS

@RomanHotsiy RomanHotsiy changed the title Does the Commit message need to include the filenames included in the commit? Pathspec issue on windows May 15, 2023
@RomanHotsiy RomanHotsiy added bug Something isn't working help wanted Extra attention is needed and removed question Further information is requested labels May 15, 2023
DarkSavci added a commit to DarkSavci/commitgpt that referenced this issue Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants