andir / npins

Nix dependency pinning. Very similar to Niv but has a few features that I personally wanted.
European Union Public License 1.2
194 stars 16 forks source link

Pinning specific commits in a GH repo #62

Open eclairevoyant opened 7 months ago

eclairevoyant commented 7 months ago

To add a GH source at a specific commit is explained as

npins add --name <name> github <owner> <repo> -b <branch> --at <rev>

In my case, I'd like to keep that source pinned to <rev> even after running npins update. Is this possible?

piegamesde commented 7 months ago

Sure, why not. One way I could see to handle this:

My only worry is that this terminology could be confusing due to the double meaning of "pinning". Not sure how else to call it though


An alternative would be to allow specifying which pins to skip while updating. Currently we can say update foo bar to only update certain pins, so maybe some --skip or --exclude flag could be added to do the opposite. I think I'd personally like this solution a bit more, but not sure how well it would fit your use case.

eclairevoyant commented 7 months ago

My use case is to prevent updating inputs when I know they're broken after a certain rev, i.e. I'd pin to the last known working rev.

I would lean towards the first option, since it would:

I do see the issue about calling it a "pin", though :confused:

piegamesde commented 7 months ago

How about "freeze"/"frozen"?

eclairevoyant commented 7 months ago

Yes, I think that makes sense.

andir commented 4 months ago

@eclairevoyant mind having a look at #78 and testing it?