-
Notifications
You must be signed in to change notification settings - Fork 20
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
Implement freezing and thawing of pins #78
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems to work as expected. Thanks for looking into this!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good, only some nits (and "thaw" as name)
Now that I actually think of it, what is the workflow of manually updating frozen pins? Unfreezing them just for that purpose seems a bit unwieldy. |
Perhaps an extra argument to the |
de638f3
to
d62d910
Compare
This allows freezing a pin to ensure that it isn't changed by issuing a blanked `npins update`. Co-authored-by: piegames <[email protected]>
d62d910
to
a20936d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't look like it breaks anything on the updating side 👍
let (mut style, status) = if opts.names.is_empty() || valid_names.contains(name) { | ||
(ContentStyle::new().grey(), "queued") | ||
if pin.is_frozen() && !opts.update_frozen { | ||
(ContentStyle::new().dark_grey(), "frozen") | ||
} else { | ||
(ContentStyle::new().grey(), "queued") | ||
} | ||
} else { | ||
(ContentStyle::new().dark_grey(), "ignored") | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would probably nicer turned into a match now:
let (mut style, status) = match (
opts.names.is_empty() || valid_names.contains(name),
pin.is_frozen() && !opts.update_frozen,
) {
(true, false) => (ContentStyle::new().grey(), "queued"),
(true, true) => (ContentStyle::new().dark_grey(), "frozen"),
(false, _) => (ContentStyle::new().dark_grey(), "ignored"),
};
This allows freezing a pin to ensure that it isn't changed by issuing a blanked
npins update
.Should fix #62