Tarmil / FSharp.Data.LiteralProviders

F# Type providers generating literals from the compile-time environment
MIT License
135 stars 6 forks source link

Feature request: info from git #16

Closed jpeg729 closed 2 years ago

jpeg729 commented 2 years ago

It would be cool to be able to include the branch name if on a branch, the tagname if there is a tag on the current commit, the commit hash, and also the number of uncommitted changes.

Tarmil commented 2 years ago

I think directly implementing a git API would be an endless pit of adding features and subtleties. However a simpler and more extensible solution would be adding the ability to run a program and capture its output. So you could do something like

let branch = Exec<"git branch --show-current">.Output
let tag = Exec<"git describe --tags --exact-match">.Output
Tarmil commented 2 years ago

This is released with v1.0.