Repository navigation
leave lockfiles out of line and file counts - #157
Merged
Merged
Conversation
A regenerated package-lock.json, yarn.lock or Cargo.lock can add thousands of lines, so one dependency bump cleared the 50-line ship bar on its own. parseNumstat now skips well-known lockfiles by basename (including the new path of a rename), for committed work, uncommitted work and per-commit facts alike. A file merely named like one, such as lockfile.ts, still counts. Totals drop for anyone whose commits carried lockfile churn. A session open across the upgrade sees its totals dip, and both the CLI and the server already clamp the event baseline down, so later ships are measured in the new units without paying anything twice. Commit facts for a commit already on record match by commit id; only a commit rebased after the upgrade would file as new work.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Raised publicly on X: a regenerated lockfile counted toward the 50-line ship bar, so a single
npm installthat rewrotepackage-lock.jsoncould earn a ship on its own.Change:
parseNumstatinsrc/git.tsskips well-known lockfiles by basename: package-lock.json, npm-shrinkwrap.json, yarn.lock, pnpm-lock.yaml, bun.lock(b), deno.lock, Cargo.lock, Gemfile.lock, poetry.lock, Pipfile.lock, uv.lock, pdm.lock, composer.lock, go.sum, mix.lock, pubspec.lock, Podfile.lock, Package.resolved, packages.lock.json, flake.lock, gradle.lockfile. They no longer count toward lines or files, for committed work, uncommitted work, or the per-commit facts sent to the server. A rename onto a lockfile path is caught (git reportsold => new), and a file merely named like one (lockfile.ts,my-package-lock.json) still counts. The commit itself still counts as a commit.What moves: totals go down for anyone whose commits carry lockfile churn, so some sessions that shipped before will not. That is the point, but it is a counting change, and it only reaches people who upgrade.
Mixed versions, checked against the code:
trackShipEvents(CLI) andclampBaseline(server) both clamp the event baseline down, so later ships are measured in the new units and nothing is paid twice.commit_creditsprimary key), so its new smaller line counts don't make it new work.Tests: three new cases in
test/git-stats.test.mjs. The two lockfile ones fail without the fix (checked by disabling the skip and rebuilding), and the third guards against over-matching. Full suite 231/231, server typecheck clean.README now says lockfiles are left out. The website copy is unchanged, because older CLIs still count them.
Needs a CLI release to reach anyone.