-
Notifications
You must be signed in to change notification settings - Fork 29.5k
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 a git extensions api to check for unsynced changes #93779
Comments
Specifically, this would need to be a command so that we can execute it over a local -> remote connection. |
@wangjaso Your snippet shows that the git extension already exposes this information. What other information do you need?
That would be a utility function, not exactly API. We don't really expose utility functions in our API. @jkeech I don't understand what you mean by this. Given that the Git extension exposes this information via its API, you can just use the API. |
From @kieferrm:
Got it. We could expose an internal command which returns a snapshot of |
@joaomoreno, the Visual Studio Online Extension is a UI extension since it includes a remote resolver. In VS Code desktop, it runs on the local side, while the Git extension is a workspace extension that runs on the remote side. In this scenario, the Git extension is not visible to the VSO extension. Extension APIs are not remoted, but commands are. So we need the Git extension to also expose this functionality via commands. |
@wangjaso, do you think it would make sense to have two commands?
I think we don’t know all of the interesting repos up front, so we’re relying on VS Code to provide that information, hence the need for the first command. Jason can confirm. |
That would make sense, since right now we can only know about #1 if user actively worked on it. |
OK, just pushed this. Here are the commands:
Please give it a try in tomorrow's insiders. Let me know how it goes and if you need more data in the methods. |
Verification: please see comment above |
@joaomoreno I verified that these 2 are working correctly. Thanks! With these 2 apis I'm able to detect existing repo changes. But is there a way to know when a repo has been initialized? For example below:
|
Thanks! No, there is currently no way to do that. Remember that the current solution is a hack: it just passes a JSON representation of the git model between the barrier... it doesn't really reproduce the model on the other side. |
Currently the git extensions api does not have a method to check if the user has unsynced changes. To achieve that I am doing a check like such
Would be nice to have a api method that does this.
Thanks,
Jason
The text was updated successfully, but these errors were encountered: