dotnet / sourcelink

Source Link enables a great source debugging experience for your users, by adding source control metadata to your built assets
MIT License
1.24k stars 121 forks source link

Populate RepositoryBranch automatically #1243

Open MattKotsenas opened 1 week ago

MattKotsenas commented 1 week ago

Following up from #188 and starting the discussion to populate RepositoryBranch automatically.

There are a few linked items in the old issue requesting this feature. Additionally, a new version of the DotNet.ReproducibleBuilds package was released, which sets this for some common CI providers (see https://github.com/dotnet/reproducible-builds/pull/27). However, that has the side-effect of causing the nuspec to be different between a local build and a CI build (beyond what's already necessary).

I'm open to design discussions, but I'll propose an algorithm that's the same as the one currently provided by ReproducibleBuilds, with a fallback that's essentially git rev-parse --abbrev-ref HEAD (or similar) if no properties are provided.

baronfel commented 1 week ago

I think this would be a great thing to have, and SourceLink is a reasonable place to ship it. @tmat do you have thoughts here?

tmat commented 1 week ago

Sounds good to me. We'd definitely accept a PR.