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

Fix version #26

Open
marksartdev opened this issue Jun 27, 2024 · 6 comments
Open

Fix version #26

marksartdev opened this issue Jun 27, 2024 · 6 comments

Comments

@marksartdev
Copy link

Excellent tool.

But it will be better, if I can fix particular version for particular binary.

For example:
I have [email protected], [email protected], [email protected].

I want update all bins except foo. I want to call something like this go-global-update --exclude foo or go-global-update --fix [email protected].

@Gelio
Copy link
Owner

Gelio commented Jun 27, 2024

Thanks for your feedback!

Having such a way to exclude a binary from being updated seems like a worthwhile feature.

I was immediately thinking whether this should be something permanent (you call go-global-update --exclude foo and that puts foo into some exclude file which is consulted during each next go-global-update), or one-time only (you must specify --exclude each time).

I'm leaning towards having a list of ignored binaries in some config file, since I reckon that would be a more common use-case.

I would probably name it --lock, since, to me, this is about locking a specific version of the binary (if we follow the persistent config approach).

EDIT: alternatively, this option could be called --pin, since it pins the version. I guess we should do more research on how other package managers name this feature.

What are your thoughts?

@marksartdev
Copy link
Author

Hello @Gelio,

Thank you for answer.
In my opinion, adding version to lock list is a good idea. But I think, using sub command lock is better than using parameter, because it is not a customization of updating. It is another operation (it is addition version to lock list).

In my option, this sub command will be great:

go-global-update lock [email protected]

And it will be great to have ability to lock major, minor or patch versions. For this purposes you can use parameters:

go-global-update lock [email protected] # for patch version
go-global-update lock --minor [email protected] # for minor version
go-global-update lock --major foo@v1 # for major version

@Gelio
Copy link
Owner

Gelio commented Sep 18, 2024

Right, and that, unfortunately, would be a breaking change, since right now, there are no subcommands for go-global-update. It has flags, and any arguments that come after are binary names.

Perhaps it's fine to make such a breaking change by introducing subcommands to go-global-update. Alternatively, we could have a separate go-global-update-lock command (or something like that) for controlling the lockfile 🤔

@marksartdev
Copy link
Author

marksartdev commented Sep 19, 2024

We can add subcommands and use run subcommand as default. It means that call without any subcommands will equal go-global-update run with passing all flags to subcommand.

go-global-update --dry-run will equal go-global-update run --dry-run.
And also we can add go-global-update lock [email protected].

It can be implemented by https://github.com/spf13/cobra.

If you want, I can help with subcommands.

@Gelio
Copy link
Owner

Gelio commented Sep 20, 2024

Right, that's a possible approach. I am still not sure about making this breaking change vs adding a new command to manage the lockfile. Especially since the lockfile is optional. Perhaps someone else will come here and have an opinion.

It can be implemented by https://github.com/spf13/cobra.

go-global-update is already using https://github.com/urfave/cli which supports commands.

@marksartdev
Copy link
Author

It is not a breaking changes. It will still work as before, because new command run will be default command. It means that executing go-global-update will work as before.

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

2 participants