rustyhorde / vergen

Generate cargo instructions at compile time in build scripts for use with the env! or option_env! macros
Apache License 2.0
396 stars 56 forks source link

vergen-gix describing dirty doesn't work #359

Open demoray opened 4 months ago

demoray commented 4 months ago

The following appropriately identifies a "dirty" repo:

use vergen_git2::{Emitter, Git2Builder};
fn main() -> Result<(), Box<dyn std::error::Error>> {
    let git = Git2Builder::default().describe(true, true, None).build()?;
    Emitter::default().add_instructions(&git)?.emit()?;
    Ok(())
}

While this does not:

use vergen_gix::{Emitter, GixBuilder};
fn main() -> Result<(), Box<dyn std::error::Error>> {
    let git = GixBuilder::default().describe(true, true, None).build()?;
    Emitter::default().add_instructions(&git)?.emit()?;
    Ok(())
}
max-sixty commented 3 months ago

Curiously I get a bug in the same command but slightly different: I get dirty but not all tags — so '0.2.5-2720-g48c52f18-dirty with gix than the correct 0.13.0-20-g48c52f1-dirty with git2

SanchithHegde commented 3 months ago

@max-sixty I stumbled upon the same issue you've reported, I've opened #364 for it.