Skip to content

nix/flake: fix Ref.String() for github flakes w/ rev and ref #2467

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 20, 2024

Conversation

gcurtis
Copy link
Collaborator

@gcurtis gcurtis commented Dec 20, 2024

The string form of GitHub flakeref can only have a rev or a ref, not both. For example:

  • Good: github:NixOS/nixpkgs/b321c8e818546d5491ee5611476500557b880856
  • Good: github:NixOS/nixpkgs/nixpkgs-unstable
  • Bad: github:NixOS/nixpkgs/nixpkgs-unstable/b321c8e818546d5491ee5611476500557b880856

If both the Rev and Ref fields are set, use Rev.

The string form of GitHub flakeref can only have a rev or a ref, not
both. For example:

- Good: github:NixOS/nixpkgs/b321c8e818546d5491ee5611476500557b880856
- Good: github:NixOS/nixpkgs/nixpkgs-unstable
- Bad: github:NixOS/nixpkgs/nixpkgs-unstable/b321c8e818546d5491ee5611476500557b880856

If both the Rev and Ref fields are set, use Rev.
@gcurtis gcurtis requested review from mikeland73 and savil December 20, 2024 21:41
@gcurtis gcurtis merged commit f3a5af4 into main Dec 20, 2024
29 checks passed
@gcurtis gcurtis deleted the gcurtis/fix-github-flakeref branch December 20, 2024 21:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants