numtide / flake-utils

Pure Nix flake utility functions [maintainer=@zimbatm]
MIT License
1.14k stars 78 forks source link

master rename to main breaks nix flake update #88

Closed numinit closed 1 year ago

numinit commented 1 year ago

Describe the bug

nix flake update on existing flakes is broken since branch rename to main

To Reproduce

inputs.flake-utils.url = github:numtide/flake-utils/master;

$ nix flake update
error: unable to download 'https://api.github.com/repos/numtide/flake-utils/commits/master': HTTP error 422

       response body:

       {
         "message": "No commit found for SHA: master",
         "documentation_url": "https://docs.github.com/rest/commits/commits#get-a-commit"
       }
(use '--show-trace' to show detailed location information)

Expected behavior

Update functions

System information

NixOS 22.11

Additional context

This is a backwards compat issue as it breaks existing flake.nix that used master branch instead of main.

numinit commented 1 year ago

Fixed with some use of grep and sed. Is the value of not specifying a branch in a flake input documented somewhere clear? (i.e. does it use the default branch per github, which would make this compat issue go away?)

zimbatm commented 1 year ago

I should have known that renaming the branch would have broken something :face_with_spiral_eyes:

The best is to remove the /master entirely, as flake will pick the default branch, just like git would.

numinit commented 1 year ago

Thanks!