Skip to content

chore: Remove Pify dependency - #465

Merged
lwasser merged 8 commits into
all-contributors:mainfrom
jdalrymple:chore/remove-pify
Mar 3, 2026
Merged

lwasser merged 8 commits into
all-contributors:mainfrom
jdalrymple:chore/remove-pify

Conversation

@jdalrymple

@jdalrymple jdalrymple commented Mar 1, 2026 •

Copy link
Copy Markdown
Contributor

What: Removing pify dependency

Additionally:

Why: Native node supports promisified functions

How: Convert from one to the other

Checklist:

  • Documentation
  • Tests
  • Ready to be merged
  • Added myself to contributors table

Comment thread src/cli.js
],
choices: choices,
when: !argv._[0],
default: 0,

Copy link
Copy Markdown
Contributor Author

Choose a reason for 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)

Comment thread .all-contributorsrc Outdated
"commit": false,
"contributorsPerLine": 6,
"linkToUsage": true,
"files": [

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just linting in this whole file

Comment thread src/util/__tests__/git.js
@@ -0,0 +1,159 @@
import {test, expect, vi, describe, beforeEach} from 'vitest'

Copy link
Copy Markdown
Contributor Author

Choose a reason for 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

@@ -0,0 +1,66 @@
import {test, expect, describe} from 'vitest'

Copy link
Copy Markdown
Contributor Author

Choose a reason for 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

Comment thread src/contributors/prompt.js Resolved
@jdalrymple
jdalrymple requested a review from lwasser March 1, 2026 22:20
@jdalrymple
jdalrymple marked this pull request as ready for review March 1, 2026 22:20
@jdalrymple

Copy link
Copy Markdown
Contributor Author

@lwasser Let me know if there are any additional things you want to validate before merging this badboy

@lwasser lwasser left a comment

Copy link
Copy Markdown
Member

Choose a reason for 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.

@lwasser
lwasser merged commit ed5b6a6 into all-contributors:main Mar 3, 2026
5 checks passed
This was referenced Mar 3, 2026
@jdalrymple
jdalrymple deleted the chore/remove-pify branch March 3, 2026 07:15
@stchigel stchigel mentioned this pull request Oct 30, 2026
2 of 4 tasks
stchigel pushed a commit to stchigel/cli that referenced this pull request Nov 9, 2026
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 <noreply@anthropic.com>
stchigel pushed a commit to stchigel/cli that referenced this pull request Nov 11, 2026
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 <noreply@anthropic.com>
michaelfaith pushed a commit to stchigel/cli that referenced this pull request Nov 11, 2026
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 <noreply@anthropic.com>
michaelfaith pushed a commit that referenced this pull request Nov 12, 2026
<!--
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 <nstchigel@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants