You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently when I try to use both ref and ref in flake input url I get:
error: URL 'github:ipetkov/crane?ref=v0.12.1&rev=445a3d222947632b5593112bb817850e8a9cf737' contains both a commit hash and a branch/tag name v0.12.1 445a3d222947632b5593112bb817850e8a9cf737
Steps To Reproduce
Use an flake input url that has both ref and rev (that point at the same commit).
Expected behavior
I think it should be supported. nix should just verify that that ref is still pointing at that rev.
rev is for pinning to a hash for security/reliability, while ref is for letting humans reading the code know which release version is it. One could put the ref in a comment, but then there's nothing to make sure it's not incorrect.
The text was updated successfully, but these errors were encountered:
nix flake clone is pretty useless without changing this.
If I try to clone a specific commit of a flake without a "ref" of main, I get a failure.
nix flake clone "github:numtide/system-manager/e8957ab8b4cf02574adb5f09ef4a2ef9ee48ef01" --dest local
error: Git input 'git+https://github.com/numtide/system-manager.git?rev=e8957ab8b4cf02574adb5f09ef4a2ef9ee48ef01' has a commit hash but no branch/tag name
If I add in the branch of main, and set the rev, it complains.
nix flake clone "github:numtide/system-manager/main?rev=e8957ab8b4cf02574adb5f09ef4a2ef9ee48ef01" --dest local
error: URL 'github:numtide/system-manager/main?rev=e8957ab8b4cf02574adb5f09ef4a2ef9ee48ef01' contains both a commit hash and a branch/tag name main e8957ab8b4cf02574adb5f09ef4a2ef9ee48ef01
We also ran into an issue by using builtins.fetchTree, which requires to set rev and ref to have a locked input. This also triggers this mentioned assertion. If we remove rev, the input is not locked anymore and cannot be used without --impure. If we omit ref, the commit hash is not found within our repository.
Describe the bug
Currently when I try to use both
ref
andref
in flake input url I get:Steps To Reproduce
Use an flake input url that has both
ref
andrev
(that point at the same commit).Expected behavior
I think it should be supported.
nix
should just verify that thatref
is still pointing at thatrev
.rev
is for pinning to a hash for security/reliability, whileref
is for letting humans reading the code know which release version is it. One could put theref
in a comment, but then there's nothing to make sure it's not incorrect.The text was updated successfully, but these errors were encountered: