This repository was archived by the owner on Sep 30, 2024. It is now read-only.
chore(local): clear ambiguity in between sg version|live#64122
Merged
Conversation
If you haven't used `sg` in a while, it's easy to think that `sg version` refers to the currently deployed Sourcegraph instance and not the CLI. This commit adds a little preamble on stderr to not mess with script usage while still reminding the user that it's the CLI version that gets printed out.
Strum355
approved these changes
Jul 29, 2024
Strum355
left a comment
Contributor
There was a problem hiding this comment.
I wonder is it possible to error when passing arguments to this command like how olaf did sg version s2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context: As I was catching up with my Slack notifications, I spotted this conversation and this PR is a 5m fix to avoid the problem to happen again.
What: If you haven't used
sgin a while, it's easy to think thatsg versionrefers to the currently deployed Sourcegraph instance and not the CLI. This commit adds a little preamble on stderr to not mess with script usage while still reminding the user that it's the CLI version that gets printed out.Before: we printed the version without any context
After: we also print the following on stderr:
👉 Showing the current version of the sg CLI, if you're looking for deployed Sourcegraph instances version, please usesg liveinstead.. Stderr so we don't break things like$(sg version).Note: at a broader level, we should generalize this pattern, we don't use too much
sgraw output in scripts, but for the few places where it's the case, it's a footgun.Test plan
Locally tested + CI.
Changelog
sg versionexplicitly mentions that it's the CLI version that's printed out, not any instance version.