pub struct Git2 { /* private fields */ }
Expand description
The VERGEN_GIT_*
configuration features
Variable | Sample |
---|---|
VERGEN_GIT_BRANCH | feature/fun |
VERGEN_GIT_COMMIT_AUTHOR_EMAIL | janedoe@email.com |
VERGEN_GIT_COMMIT_AUTHOR_NAME | Jane Doe |
VERGEN_GIT_COMMIT_COUNT | 330 |
VERGEN_GIT_COMMIT_DATE | 2021-02-24 |
VERGEN_GIT_COMMIT_MESSAGE | feat: add commit messages |
VERGEN_GIT_COMMIT_TIMESTAMP | 2021-02-24T20:55:21+00:00 |
VERGEN_GIT_DESCRIBE | 5.0.0-2-gf49246c |
VERGEN_GIT_SHA | f49246ce334567bff9f950bfd0f3078184a2738a |
VERGEN_GIT_DIRTY | true |
§Example
let git2 = Git2Builder::all_git()?;
Emitter::default().add_instructions(&git2)?.emit()?;
Override output with your own value
temp_env::with_var("VERGEN_GIT_BRANCH", Some("this is the branch I want output"), || {
let result = || -> Result<()> {
let git2 = Git2Builder::all_git()?;
Emitter::default().add_instructions(&git2)?.emit()?;
Ok(())
}();
assert!(result.is_ok());
});
Implementations§
Trait Implementations§
Source§impl Add for Git2
impl Add for Git2
Source§fn add_map_entries(
&self,
idempotent: bool,
cargo_rustc_env: &mut CargoRustcEnvMap,
cargo_rerun_if_changed: &mut CargoRerunIfChanged,
cargo_warning: &mut CargoWarning,
) -> Result<()>
fn add_map_entries( &self, idempotent: bool, cargo_rustc_env: &mut CargoRustcEnvMap, cargo_rerun_if_changed: &mut CargoRerunIfChanged, cargo_warning: &mut CargoWarning, ) -> Result<()>
Try to add instructions entries to the various given arguments. Read more
Source§fn add_default_entries(
&self,
config: &DefaultConfig,
cargo_rustc_env_map: &mut CargoRustcEnvMap,
cargo_rerun_if_changed: &mut CargoRerunIfChanged,
cargo_warning: &mut CargoWarning,
) -> Result<()>
fn add_default_entries( &self, config: &DefaultConfig, cargo_rustc_env_map: &mut CargoRustcEnvMap, cargo_rerun_if_changed: &mut CargoRerunIfChanged, cargo_warning: &mut CargoWarning, ) -> Result<()>
Based on the given configuration, emit either default idempotent output or generate a failue. Read more
impl StructuralPartialEq for Git2
Auto Trait Implementations§
impl Freeze for Git2
impl RefUnwindSafe for Git2
impl Send for Git2
impl Sync for Git2
impl Unpin for Git2
impl UnwindSafe for Git2
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more