baoyachi / shadow-rs

A build-time information stored in your rust project.(binary,lib,cdylib,dylib)
https://docs.rs/shadow-rs
MIT License
444 stars 40 forks source link

Can we add git commit count to build information? #137

Closed tiann closed 1 year ago

tiann commented 1 year ago

The result of git rev-list --count HEAD is sometimes useful to generate version code.

baoyachi commented 1 year ago

Hi @tiann shadow-rs support extended hook function.

If you want add git rev-list --count HEAD result in you build project. I suggest use new_hook function.

The detail example ,please see

tiann commented 1 year ago

If using a hook, we may need to integrate the git2 dependency or install git. I would be happy to submit a PR if you are willing to accept this feature.

baoyachi commented 1 year ago

Currently, the feature is not needed.