I'm writing a plugin that records some info about the current file. I'm able to get the current file info, get selected text, and some other basic stuff. However, I'd also like to check if the file is under source control, and if so, get info about the source control.
I assume this is trickier because the details of source control differ between implementations. Eventually I may want to handle multiple, but for today, I just want to check if git support is enabled, and get the git info for that file. Ideally:
if the file has been edited
I know git is more complex than this interenally. Selecting a range of text, there may be different commits represented in the text selection, but if I could simply get the latest, that would be good enough.
Thoughts? I have the Project, VirtualFile, and Editor instances. Also grabbed the intellij community source and am taking a look at the git plugin source. Any ideas how to close the loop on this?
Thanks in advance.