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

Pinning specific commits in a GH repo #62

Open
eclairevoyant opened this issue Feb 28, 2024 · 5 comments · May be fixed by #78
Open

Pinning specific commits in a GH repo #62

eclairevoyant opened this issue Feb 28, 2024 · 5 comments · May be fixed by #78
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@eclairevoyant
Copy link
Contributor

eclairevoyant commented Feb 28, 2024

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?

@eclairevoyant eclairevoyant changed the title Pinning specific commits in a git repo Pinning specific commits in a GH repo Feb 28, 2024
@piegamesde
Copy link
Collaborator

piegamesde commented Mar 2, 2024

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

  • Add a pinned attribute to each pin entry
  • Add a pin and unpin subcommand to the CLI to modify that value
  • When updating, skip pinned entries
  • Maybe add a --pin flag to the add subcommand which will set pinned to true on creation

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
Copy link
Contributor Author

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:

  • ensure I don't accidentally update the rev because I forgot to pass the flag
  • explicitly indicate that I'd like it at that rev, for whatever reason

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

@piegamesde
Copy link
Collaborator

How about "freeze"/"frozen"?

@eclairevoyant
Copy link
Contributor Author

Yes, I think that makes sense.

@piegamesde piegamesde added help wanted Extra attention is needed good first issue Good for newcomers labels Mar 4, 2024
@andir andir linked a pull request May 11, 2024 that will close this issue
@andir
Copy link
Owner

andir commented May 11, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants