owenthereal/gh

Change `update` to `--system-update`

gfontenot opened this issue · 10 comments

Right now, update is needlessly added to the global commands. Given that this isn't exactly a top-level feature, it would make sense to move the command to a flag so that gh doesn't clobber other commands or aliases.

I see how update can conflict with other aliases, but gh is built around commands. I'd rather find a better name for the command than adding another way to invoke commands without actually using commands.

As long as the update command exists alongside normal commands, you'll always be at risk of clobbering someone's workflow.

How about renaming it to selfupdate?

👍 on this issue - I think it should be a flag, not a subcommand.

How about ghupdate, since it's very gh-specific?

(Here's a suggestion that you won't like: how about removing it and letting the package manager handle this?)

@gfontenot @gabebw Could you share more why you think flag is a good idea? Flag is usually used as an option to control the workflow of a command. Update seems to be more like a command than an option. More examples are brew update, heroku update etc.

I do understand though for a sophisticated tool like git, popular name like update has a high chance of overlapping with user defined alias. selfupdate should be unique enough? Otherwise ghupdate would work too. But typing git ghupdate looks worse than git selfupdate.

@mike-burns We provide option that people could manage gh with a package manager, check out homebrew-gh. They could turn autoupdate off and let homebrew manages it. For Windows where there's no package manager built in, the users will appreciate this feature.

@jingweno With the exception of update, all of the other top level commands are concerned with dealing with git repos. update is concerned with updating the tool itself, and so is outside of the primary concern of gh. I would argue that brew update is a top level concern of brew, since it updates the formulae. Additionally, since the tool itself is a package manager, upgrading itself is a core concern.

I would make these same arguments for moving heroku update to some kind of flag (or removal altogether, as @mike-burns suggested), for what it's worth.

I think self update is one of the primary concerns with gh too. Just like Chrome or Firefox, you could update them manually or let them update automatically themselves. gh just doesn't have the graphical UI. Another example is oh-my-zsh.

I renamed update to selfupdate. Shall we use it for a while and see if it works out then revisit this decision?

I've merged #197. Please give it a shot and let's revisit this decision later.