{"id":18417364,"url":"https://github.com/stellar/crate-git-revision","last_synced_at":"2025-10-04T18:44:47.686Z","repository":{"id":61727579,"uuid":"554490332","full_name":"stellar/crate-git-revision","owner":"stellar","description":"Embed git revision into crates built and published.","archived":false,"fork":false,"pushed_at":"2024-07-22T05:20:14.000Z","size":25,"stargazers_count":2,"open_issues_count":1,"forks_count":4,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-07-24T00:56:15.791Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stellar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-10-19T22:43:17.000Z","updated_at":"2024-07-11T22:19:52.000Z","dependencies_parsed_at":"2025-04-07T12:43:30.276Z","dependency_job_id":null,"html_url":"https://github.com/stellar/crate-git-revision","commit_stats":{"total_commits":15,"total_committers":4,"mean_commits":3.75,"dds":0.5333333333333333,"last_synced_commit":"38883b43f394b4dc50da2b8cebbfe6224c704418"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/stellar/crate-git-revision","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stellar%2Fcrate-git-revision","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stellar%2Fcrate-git-revision/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stellar%2Fcrate-git-revision/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stellar%2Fcrate-git-revision/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stellar","download_url":"https://codeload.github.com/stellar/crate-git-revision/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stellar%2Fcrate-git-revision/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268310800,"owners_count":24230186,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-01T02:00:08.611Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T04:09:04.123Z","updated_at":"2025-10-04T18:44:42.649Z","avatar_url":"https://github.com/stellar.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# crate-git-revision\n\nEmbed the git revision of a crate in its build.\n\nSupports embedding the version from a local or remote git repository the build\nis occurring in, as well as when `cargo install` or depending on a crate\npublished to crates.io.\n\nIt extracts the git revision in two ways:\n- From the `.cargo_vcs_info.json` file embedded in published crates.\n- From the git repository the build is occurring from in unpublished crates.\n\nInjects an environment variable `GIT_REVISION` into the build that contains\nthe full git revision, with a `-dirty` suffix if the working directory is\ndirty.\n\nRequires the use of a build.rs build script. See [Build Scripts]() for more\ndetails on how Rust build scripts work.\n\n[Build Scripts]: https://doc.rust-lang.org/cargo/reference/build-scripts.html\n\n#### Examples\n\nAdd the following to the crate's `Cargo.toml` file:\n\n```toml\n[build_dependencies]\ncrate-git-revision = \"0.0.2\"\n```\n\nAdd the following to the crate's `build.rs` file:\n\n```rust\ncrate_git_revision::init();\n```\n\nAdd the following to the crate's `lib.rs` or `main.rs` file:\n\n```rust\npub const GIT_REVISION: \u0026str = env!(\"GIT_REVISION\");\n```\n\nLicense: Apache-2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstellar%2Fcrate-git-revision","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstellar%2Fcrate-git-revision","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstellar%2Fcrate-git-revision/lists"}