It is currently April 19th, 2024, 10:10 am

Creating a plugin for git, but it crashes Rainmeter

Share and get help with Plugins and Addons
Thaurin
Posts: 1
Joined: December 15th, 2020, 4:28 pm

Creating a plugin for git, but it crashes Rainmeter

Post by Thaurin »

Hello,

I hope I've found the right forum, if not please point me to the right direction. Seeing a lack of git skins, I decided to create a plugin that can return information about git repositories, like files changes, current branch, etc. I did this up until now with a !CommandMeasure bang to the git executable, and it worked, but now I'm trying a new thing by making a git-specific plugin in C# using https://github.com/libgit2/libgit2sharp.

I've succeeded in returning a simple string measure to a skin. However, when I initialize a new Repository object, it crashes Rainmeter. I tried the same in a console application, and it works there. Wrapping it in a try/catch block did not send it to the catch block, so I could not find out anything about what the problem was. I also did not find anything useful in the log file in AppData. Just this:

Code: Select all

NOTE (17:25:26.478) TestPlugin\TestPlugin.ini: Refreshing skin
DBUG (17:25:26.479) TestPlugin\TestPlugin.ini: Reading file: C:\Users\heel\Documents\Rainmeter\Skins\TestPlugin\TestPlugin.ini
DBUG (17:25:26.482) : Reading file: C:\Users\heel\AppData\Roaming\Rainmeter\Rainmeter.ini
...and then nothing. Do you have any idea what I can try next to identify the problem? What's so different in the plugin environment that it would cause a complete crash, but not in the console test app? Basically, what LibGit2Sharp needs to do is something like this, but I have no idea where it goes wrong:

Code: Select all

using (var repo = new Repository(@"C:\path\to\repo\.git"))
{
    currentBranchName = repo.Head.FriendlyName;
}
I realize you probably need more code examples to know what I'm trying to do. But I'm awaiting replies first to see if this rings any bells, because I am pretty stumped at this point about how I'm able to diagnose this further.

Thanks for reading, and I'm hoping for some advice.