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
shadcn init silently runs git add -A && git commit without user consent
As far as I can tell, a [March 4th commit](37ff1a3) introduced defaultPostInit in packages/shadcn/src/templates/create-template.ts, released with shadcn@4.0.0 on March 6th.
This function silently stages all files and commits them during commands such as:
git add -A stages everything, not just the files shadcn created.
There is no --no-git flag to opt out.
Errors are silently swallowed with an empty catch {}.
IMO, shadcn should not be making commits on behalf of the user. At the very least, there should be a --no-git flag and this behavior should be documented.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
shadcn initsilently runsgit add -A && git commitwithout user consentAs far as I can tell, a [March 4th commit](37ff1a3) introduced
defaultPostInitinpackages/shadcn/src/templates/create-template.ts, released withshadcn@4.0.0on March 6th.This function silently stages all files and commits them during commands such as:
Here's the relevant code:
This is problematic because:
git add -Astages everything, not just the files shadcn created.--no-gitflag to opt out.catch {}.IMO, shadcn should not be making commits on behalf of the user. At the very least, there should be a
--no-gitflag and this behavior should be documented.Beta Was this translation helpful? Give feedback.
All reactions