Git fetcher: Don't compute revCount/lastModified if they're already specified#14596
Git fetcher: Don't compute revCount/lastModified if they're already specified#14596
Conversation
|
I thought this is what |
|
No, |
|
I think we should make Would this be an accurate release note? ---
synopsis: Git fetcher accepts `revCount` and `lastModified` without validation
prs: [14596]
---The git fetcher now trusts When this applies:
When this doesn't apply:
Impact: Incorrect values don't affect source integrity (correct files are still fetched based on Risks:
Recommendations:
ALTERNATIVELY IF IMPLEMENTED
|
|
Yes that seems accurate. It's worth noting that the tarball fetcher already allows returning these attributes without checking them, so in that sense it makes behavior more consistent. |
We don't care if the user (or more likely the lock file) specifies an incorrect value for revCount, since it doesn't matter for security (unlikely content hashes like narHash).
Same as revCount.
17db441 to
4ecc09c
Compare
|
I guess we could warn if there is a mismatch. That way the user will get a warning in most cases (namely when Nix does an actual fetch, rather than a substitution, which would be the case unless you don't change |
Motivation
This avoids a potentially expensive computation of
revCount(andlastModified, but that's cheap) in the common case where it's already known (namely because it's in a lock file).This means that we no longer check the correctness of those attributes, but we don't care if the user (or more likely the lock file) specifies an incorrect value for these attributes, since it doesn't matter for security (unlikely content hashes like
narHash).Context
Add 👍 to pull requests you find important.
The Nix maintainer team uses a GitHub project board to schedule and track reviews.