Skip to content

Run nothing at install time - #25

Merged
chris-peterson merged 1 commit into
mainfrom
remove-postinstall
Oct 25, 2026
Merged

chris-peterson merged 1 commit into
mainfrom
remove-postinstall

Conversation

@chris-peterson

@chris-peterson chris-peterson commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Context

The npm package runs a postinstall that copies the zsh completion files into npm's prefix (COMPLETE-07) and refuses the install on a git older than 2.41.0 (PRE-06). Install scripts get extra scrutiny as a supply-chain attack path, so this removes it. Completion becomes a command the user runs, shown in git fi -h, the man page, and the quickstart's install step (COMPLETE-08). The git floor stays enforced before every command by PRE-02.

Review guide

Discoverability (what replaces the automatic install)

Removal

Mechanical: STATUS.md, README.md, docs/troubleshooting.md, comments in src/git.ts and src/build-info.ts, and the regenerated man/git-fi.1

Install scripts are a common supply-chain attack path, and package
managers have started skipping them (pnpm does by default since v10).
git-fi's postinstall did two things that don't need to run there.

The zsh completion copy (COMPLETE-07) becomes a step the user takes:
`install-completions --write` already did the same job into a
directory the user names. To keep it discoverable, `git fi -h` and the
man page now end with the setup command for each shell (COMPLETE-08),
and the quickstart shows it right after `npm install -g`.

The install-time git floor (PRE-06) goes too. PRE-02 checks the same
floor before every command, and was already the check that governed a
run, since --ignore-scripts skipped the postinstall anyway. A new test
drives that path with a fake git below the floor.

Anyone who installed through the postinstall still has the two zsh
files in <npm prefix>/share/zsh/site-functions. npm didn't put them
there, so it won't remove them; they keep working but stop tracking
new flags until rewritten with `install-completions --write`.

STATUS's summary count is corrected to the table's actual row count.
@chris-peterson chris-peterson self-assigned this Oct 22, 2026
@chris-peterson chris-peterson added this to the 1.4 milestone Oct 22, 2026
@chris-peterson
chris-peterson marked this pull request as ready for review October 25, 2026 20:58
@chris-peterson
chris-peterson merged commit d6e4730 into main Oct 25, 2026
9 checks passed
@chris-peterson
chris-peterson deleted the remove-postinstall branch October 25, 2026 21:03
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.

1 participant