GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — chore: Remove Pify dependency by jdalrymple · Pull Request #465 · all-contributors/cli Conversation
| |||||||||||||||||||||||||||||||||||||||
| ], | ||
| choices: choices, | ||
| when: !argv._[0], | ||
| default: 0, |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
If you dont specify the default value, the hint shows (0) and not (add)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| "commit": false, | ||
| "contributorsPerLine": 6, | ||
| "linkToUsage": true, | ||
| "files": [ |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Just linting in this whole file
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| @@ -0,0 +1,159 @@ | |||
| import {test, expect, vi, describe, beforeEach} from 'vitest' | |||
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Added tests for this functionality to ensure nothing broke / doesnt break going forward
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| @@ -0,0 +1,66 @@ | |||
| import {test, expect, describe} from 'vitest' | |||
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Just moved the tests from the separate files. Now the test file matches the src file naming convention
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
@lwasser Let me know if there are any additional things you want to validate before merging this badboy |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Thank you @jdalrymple for this!! there is some great cleanup here and reorg + new tests are also welcome!! let's merge this. My apologies, i started testing this the other day and then forgot to complete my review.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Since all-contributors#465, spawnGitCommand has joined its arguments into one string and run it through a shell. The commit message was split on spaces, so `all-contributors add` failed with `pathspec` errors when `commit` was enabled. Paths containing spaces broke `git add` the same way, and shell metacharacters in a username or commit template were executed. Pass the arguments to execFile so each one reaches git intact. Fixes all-contributors#587 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Since all-contributors#465, spawnGitCommand has joined its arguments into one string and run it through a shell. The commit message was split on spaces, so `all-contributors add` failed with `pathspec` errors when `commit` was enabled. Paths containing spaces broke `git add` the same way, and shell metacharacters in a username or commit template were executed. Pass the arguments to execFile so each one reaches git intact. Fixes all-contributors#587 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Since all-contributors#465, spawnGitCommand has joined its arguments into one string and run it through a shell. The commit message was split on spaces, so `all-contributors add` failed with `pathspec` errors when `commit` was enabled. Paths containing spaces broke `git add` the same way, and shell metacharacters in a username or commit template were executed. Pass the arguments to execFile so each one reaches git intact. Fixes all-contributors#587 Co-Authored-By: Claude Opus 5.5 <[email protected]>
<!-- Thanks for your interest in the project. Bugs filed and PRs submitted are appreciated! Please make sure that you are familiar with and follow the Code of Conduct for this project (found in the CODE_OF_CONDUCT.md file). Also, please make sure you're familiar with and follow the instructions in the contributing guidelines (found in the CONTRIBUTING.md file). If you're new to contributing to open source projects, you might find this free video course helpful: http://kcd.im/pull-request Please fill out the information below to expedite the review and (hopefully) merge of your pull request! --> <!-- What changes are being made? (What feature/bug is being fixed here?) --> **What**: Fixes #587: With `"commit": true`, `all-contributors add` fails at the commit step with `pathspec` errors, leaving the files staged but not committed. <!-- Why are these changes necessary? --> **Why**: This is a regression from #465. `spawnGitCommand` joins its arguments into one string and runs it through a shell, which causes three problems: - The commit message is split on spaces, so only the first word is used as the message and the rest are treated as pathspecs. - `git add` fails when the project path contains a space. - Shell metacharacters in a username or commit template are executed. Usernames aren't escaped because `autoEscape` is off (in src/util/template.js). (Confirmed this on Windows with `&`, did not test it on a POSIX shell) <!-- How were these changes implemented? --> **How**: - `spawnGitCommand` now uses `execFile('git', args)`, so each argument reaches git intact with no shell involved. - `getRemoteOriginData` still uses `exec`, since its command is just a fixed string. - The existing tests asserted the broken joined string, so they now expect an argument array. - Added regression tests to test/e2e/cli.test.js. They run add octocat doc --commit in a temporary git repo whose path contains a space, and check that the commit gets the whole message and that shell metacharacters in the message are not executed. Both tests fail without the fix. I also ran the reproduction steps from the issue using the fixed CLI, and confirmed the fix works. <!-- Have you done all of these things? --> **Checklist**: <!-- add "N/A" to the end of each line that's irrelevant to your changes --> <!-- to check an item, place an "x" in the box like so: "- [x] Documentation" --> - [ ] Documentation N/A - [x] Tests - [x] Ready to be merged <!-- In your opinion, is this ready to be merged as soon as it's reviewed? --> - [ ] Added myself to contributors table <!-- this is optional, see the contributing guidelines for instructions --> <!-- feel free to add additional comments --> --------- Co-authored-by: geniosoy <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.