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

Add feature to commands that you aren't running on latest version of deployment #55

Open
bayangan1991 opened this issue Jan 10, 2023 · 0 comments

Comments

@bayangan1991
Copy link
Collaborator

Common gotcha is the people are running commands on old version of deployments, so migrations are not being run correctly.

Add a prompt to confirm with the user that they are aware they are running on an old version of their deployment would prevent this from being a common issue.

The git commands are options below would fetch this information.

git status

Has the advantage of automatically checking against the set tracking branch, the check code can then find the presence of behind in the output

$ git fetch
$ git status -sb
## master...origin/master [behind 1]

git rev-list

Displays a simple count of commits not on local branch, but is limited to an explicitly set branch

$ git fetch
$ git rev-list ..origin/master | wc -l
        1

Could be improved by using the current branch name, but opens the rabbit hole of figuring out the correcting tracking branch

$ git rev-list ..origin/$(git symbolic-ref --short HEAD) | wc -l
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

1 participant