Escape-Technologies / mookme

A pre-commit tool designed for monorepos.
MIT License
99 stars 16 forks source link

Fix not-pushed-files-filter strategy #118

Closed sliptype closed 12 months ago

sliptype commented 1 year ago

Fixes: https://github.com/Escape-Technologies/mookme/issues/111

I noticed that with a single unpushed commit git rev-list @{push}.. returns only a single commit

git rev-list @{push}..
af5d67bfaf2331f360e6a85c2c4e8ea814c3d5dd

and this.getFilesChangedBetweenRefs(commits[commits.length - 1], commits[0]) obviously returns no diff, resulting in the pre-push hook being skipped.

Using git rev-list @{push}^.. returns a list including the @{push} reference:

git rev-list @{push}^..
af5d67bfaf2331f360e6a85c2c4e8ea814c3d5dd
5afce4d9b54ba19fdfe390e8af500e803cd786c0

The diff properly returns the changed files and the pre-push hook is run

LMaxence commented 1 year ago

Well done, and thanks for your help :) I was stuck on this one.

I'll have this merged and deployed shortly in a beta version, then as a main hotfix. Hopefully it will be done today

LMaxence commented 1 year ago

Hi @sliptype, I can't merge your work and deploy a beta/main version because we need commits from contributors to be signed before we merge them into our beta branch. Could you sign your commits please ? Can't wait to have this fix deployed !

Some useful links about signing git commits, and especially existing commits

sliptype commented 12 months ago

Hey @LMaxence thanks for the heads up! Commit is signed now :)

LMaxence commented 12 months ago

Great, thanks for your contribution :)

LMaxence commented 12 months ago

Published with version 2.4.1