You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Noticed that when using git2 to compute the result of git describe, the behaviour can diverge from git
In particular this code
pub fn git_describe_native(path: &Path) -> Result<String> {
let repo = Repository::open(path)?;
let mut describe_opts = DescribeOptions::new();
describe_opts.describe_tags();
describe_opts.show_commit_oid_as_fallback(true);
let description = repo.describe(&describe_opts).into_diagnostic()?;
let format_opts = DescribeFormatOptions::new();
description.format(Some(&format_opts)).into_diagnostic()?;
}
will differ from git describe --tags --always in specific cases where the repo grows too large.
According to git docs the length of the abbreviation scales as the repository grows, using the approximate number of objects in the repository and a bit of math around the birthday paradox, and defaults to a minimum of 7.