builtins.getFlake accepts git+file:/home/... AND git+file:///home/... with different semantics #200

Open
opened 2024-03-29 22:27:14 +00:00 by rbt · 2 comments
Owner

git+file: gets the latest commit and git+file:// gets the changes in the working tree. What the hell.

nix-repl> (builtins.getFlake "git+file:/Users/wiggles/infrastructure").outPath
"/nix/store/7j7smga3nxq1sn392c863cja4vv5m12l-source"

nix-repl> (builtins.getFlake "git+file:///Users/wiggles/infrastructure").outPath
"/nix/store/hry7m94vcmy3jznf6qyg8k0f4jhyw2dx-source"
`git+file:` gets the latest commit and `git+file://` gets the changes in the working tree. What the hell. ``` nix-repl> (builtins.getFlake "git+file:/Users/wiggles/infrastructure").outPath "/nix/store/7j7smga3nxq1sn392c863cja4vv5m12l-source" nix-repl> (builtins.getFlake "git+file:///Users/wiggles/infrastructure").outPath "/nix/store/hry7m94vcmy3jznf6qyg8k0f4jhyw2dx-source" ```
rbt added the
bug
label 2024-03-29 22:27:14 +00:00
Owner

Please test this on upstream unstable and report if the same behavior happens; I noticed these seemed to possibly change behavior on later versions and want to decide an approach to take.

Also note that in certain contexts git+file:. and "git+file://" + (toString ./.) also work, so it'd be interesting to see how they compare

Please test this on upstream unstable and report if the same behavior happens; I noticed these seemed to possibly change behavior on later versions and want to decide an approach to take. Also note that in certain contexts `git+file:.` and `"git+file://" + (toString ./.)` also work, so it'd be interesting to see how they compare
Owner

This was found on Nix 2.21 according to wiggles (here with me).

This was found on Nix 2.21 according to wiggles (here with me).
jade added the
Area/flakes
label 2024-03-30 00:04:22 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: lix-project/lix#200
No description provided.