Skip to content

Inline printHash16or32 and remove redundant helper#13716

Merged
Ericson2314 merged 4 commits intoNixOS:masterfrom
aln730:master
Aug 8, 2025
Merged

Inline printHash16or32 and remove redundant helper#13716
Ericson2314 merged 4 commits intoNixOS:masterfrom
aln730:master

Conversation

@aln730
Copy link
Copy Markdown
Contributor

@aln730 aln730 commented Aug 8, 2025

Motivation

printHash16or32 was only used in nix-prefetch-url. Removing it and inlining the logic simplifies the code.

Context

This addresses issue #13692.

As discussed, we inline the hash formatting logic directly at the call site. This simplifies the codebase by eliminating a redundant helper function. And also preserves the MD5 behavior.

At first, I considered keeping a generic function, but it ended up feeling redundant.

The main logic is now inlined directly into nix-prefetch-url. Reviewers can focus on verifying that the inlined logic preserves the old behavior for MD5 hashes.


Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

@aln730 aln730 requested a review from edolstra as a code owner August 8, 2025 02:46
@github-actions github-actions bot added the new-cli Relating to the "nix" command label Aug 8, 2025
@aln730 aln730 mentioned this pull request Aug 8, 2025
Co-authored-by: John Ericson <git@JohnEricson.me>
@aln730 aln730 requested a review from Ericson2314 August 8, 2025 03:49
aln730 and others added 2 commits August 8, 2025 08:42
Co-authored-by: Sergei Zimmerman <sergei@zimmerman.foo>
@Ericson2314 Ericson2314 enabled auto-merge (squash) August 8, 2025 15:17
@aln730 aln730 requested a review from xokdvium August 8, 2025 15:44
@Ericson2314 Ericson2314 merged commit d202218 into NixOS:master Aug 8, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new-cli Relating to the "nix" command

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants