VOGONS


First post, by superfury

User metadata
Rank l33t++
Rank
l33t++

As far as I've found out, the .sln(Solution) file should be added to source control. They say it's because it contains the project and not user-specific contents.

When I open the project in Visual Studio and run performance sessions, the performance sessions themselves are ignored by source control. But whenever sessions are added(1 or more sessions available) or all are removed(0 sessions available), Visual Studio Community adds and removes a 'user-specific' entry to the .sln file:

GlobalSection(Performance) = preSolution
HasPerformanceSessions = true
EndGlobalSection

This little text appears in the .sln file when any performance sessions are ran. It's deleted by Visual Studio when all performance sessions are deleted(from inside Visual Studio).

The performance sessions are user-specific, so they aren't checked in Source Control. But the .sln file still changes depending on whether or not they exist, which IS user specific(the related files aren't checked in Source Control).

Should I still keep the .sln in source control, even though it's constantly changing whenever I run performance sessions and delete the sessions(adding and deleting the mentioned lines)?

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 1 of 3, by spiroyster

User metadata
Rank Oldbie
Rank
Oldbie

The solution file should most definitely be in source control. Especially if your end product is in anyway a windows compatible binary built with VC or derivative 😀

The solution file doesn't contain the projects, it holds references to them. A solution can contain multiple projects from multiple languages which all form part of an end product (be it dynamic libs written in either vc++,c#, <insert microsoft-stylised language here> etc) so they effectively form the 'solution' to your problem. Likewise you can have multiple solutions using the same project, ergo the solution does not contain the project, but forms a vital part of the build process... I digress...

Performance sessions are profiling tools? In which case yes they should not be source control (or at least the results of such), however I would not worry about this reference contantly changing, annoying yes, but no doubt a quick scoot over the diff will show the single change and it can be easily ignored in review. If your worried or OCD disagrees with this then maybe branch before profiling, this way any 'user-specific' data and 'solution change' will be isolated from code changes.

Personally I would have a separate build configuration which can be used for profiling, leak finding etc (quantify and purify!). Also a separate build configuration would allow you to include unit testing (if your that way inclined), while isolating this from a release build. Build configurations can be more than Debug and Release 😀

Incidentally if you want to see real annoyance try managing VB code from VS6 in source control (I'm looking at you git). Long story short, every build can change voodoo magic within the frx which inevitably end up in commits that light up like xmas trees on a diff... so your effectively back to eyeballing the entire code base ensuring you don't accidentally skip over a human change ... I've digressed again. Apologies.

Reply 2 of 3, by mudlord

User metadata
Rank Newbie
Rank
Newbie

And if you want to know safe files to ignore with Visual Studio:
https://www.gitignore.io/

There is a gitignore gen that generates a list of known redundant files for Visual Studio as well as many other things. This also stops those files from being merged/added by mistake to your source code tree so you can directly work on a checked out git repo. 😀

Reply 3 of 3, by superfury

User metadata
Rank l33t++
Rank
l33t++

I've changed my .gitignore to use the "Android", "VisualStudio" and "C++" lines generated by https://gitignore.io . Is that enough for all my PC/PSP/Android UniPCemu subprojects?

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io