-
-
Notifications
You must be signed in to change notification settings - Fork 15k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
genemichaels: apply patch to only write files if changed #365303
genemichaels: apply patch to only write files if changed #365303
Conversation
When formatting rust files with `genemichaels`, the timestamp of the file is always modified whether or not the file was changed. This is problematic for detecting whether a file has been reformatted or not, such as when using tools such as `pre-commit`, `treefmt`, and `treefmt-nix`. See the following: andrewbaxter/genemichaels#95 andrewbaxter/genemichaels#96 numtide/treefmt-nix#277
Result of 1 package built:
|
Looks like the patch was merged and included in the latest tag! Can we bump that in this PR? |
# bumped to a release that has this change | ||
# See: https://github.com/andrewbaxter/genemichaels/issues/95 | ||
# See: https://github.com/andrewbaxter/genemichaels/pull/96 | ||
./genemichaels-only-write-if-changed.patch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'd be better to fetch the patch from GitHub rather than vendoring it in-tree
./genemichaels-only-write-if-changed.patch | |
(fetchpatch { | |
url = "https://github.com/andrewbaxter/genemichaels/commit/3c58f090888053b5165dbb0292b5974293851e2a.patch"; | |
hash = "sha256-vxtO9N6P6rcfGhIfagr2fT83o0lM6J1tOckxarMJkL8="; | |
}) |
Or update, oops! |
I didn't expect them to merge my PR so quickly. I'll make a new PR to bump the version and close this. |
Closing in favor of #365966 |
When formatting rust files with
genemichaels
, the timestamp of the file is always modified whether or not the file was changed. This is problematic for detecting whether a file has been reformatted or not, such as when using tools such aspre-commit
,treefmt
, andtreefmt-nix
.See the following:
andrewbaxter/genemichaels#95
andrewbaxter/genemichaels#96
numtide/treefmt-nix#277
Things done
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.