Skip to content
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

Use refs/tags/v${version} in fetchFromGitHub. #538

Open
GaetanLepage opened this issue Oct 24, 2024 · 4 comments
Open

Use refs/tags/v${version} in fetchFromGitHub. #538

GaetanLepage opened this issue Oct 24, 2024 · 4 comments

Comments

@GaetanLepage
Copy link
Member

GaetanLepage commented Oct 24, 2024

When using the fetchFromGitHub fetcher, it is recommended to prefix the rev with refs/tags to prevent branch-tag mismatch.

Currently, nix-init generates

src = fetchFromGitHub {
  owner = "foo";
  repo = "bar";
  rev = "refs/tags/${version}";  # or "refs/tags/v${version}"
  hash = "...";
};

Ideally, it should generate:

src = fetchFromGitHub {
  owner = "foo";
  repo = "bar";
  tag = version;  # or "v${version}"
  hash = "...";
};
@Moraxyc
Copy link

Moraxyc commented Dec 12, 2024

It's better to let nix-init generate tag

src = fetchFromGitHub {
  owner = "foo";
  repo = "bar";
  tag = version;  # or "v${version}"
  hash = "...";
};

@GaetanLepage
Copy link
Member Author

It's better to let nix-init generate tag

Definitely, I inverted "before" and "after". I edited the initial message.

@eclairevoyant
Copy link
Contributor

The original message still mentions rev instead of tag for the "after" case, btw :)

@GaetanLepage
Copy link
Member Author

The original message still mentions rev instead of tag for the "after" case, btw :)

Wow, that was harder than expected... Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants