Skip to content

main: only run --build when changes are detected#529

Open
Mic92 wants to merge 2 commits intomainfrom
only-build
Open

main: only run --build when changes are detected#529
Mic92 wants to merge 2 commits intomainfrom
only-build

Conversation

@Mic92
Copy link
Owner

@Mic92 Mic92 commented Jan 17, 2026

No description provided.

Mic92 added 2 commits January 17, 2026 11:25
When using --version skip, the hash was still being updated because
update_hash defaulted to True. This caused unwanted changes and broken
commit messages showing 'version -> None'.

Since skipping version detection implies no version change occurred,
we should also skip hash updates - the source hasn't changed, so
there's no reason to recalculate the hash.

Fixes the case where running nix-update with --version skip on an
already up-to-date package would still modify the nix file.
When running nix-update on many packages in batch with --build --commit,
unchanged packages were still being built, wasting significant time.

Move the build step to after change detection so that --build only
triggers when the package was actually updated. Interactive commands
(--run, --shell) still run immediately since the user explicitly
requested them.

This significantly speeds up batch updates of many packages where
most are already at the latest version.

Closes: #497
@Mic92 Mic92 mentioned this pull request Jan 17, 2026
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