{"id":13572488,"url":"https://github.com/kinnison/git-testament","last_synced_at":"2025-05-16T09:05:00.899Z","repository":{"id":46291868,"uuid":"174750393","full_name":"kinnison/git-testament","owner":"kinnison","description":"Rust library for creating a commit testament at compile time","archived":false,"fork":false,"pushed_at":"2024-11-28T20:06:57.000Z","size":143,"stargazers_count":49,"open_issues_count":0,"forks_count":11,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-13T18:10:06.137Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kinnison.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":"CODE_OF_CONDUCT.mdwn","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":"2019-03-09T21:54:45.000Z","updated_at":"2025-02-04T18:10:09.000Z","dependencies_parsed_at":"2024-01-21T22:46:10.504Z","dependency_job_id":"aa9d6978-545c-42ca-af2d-1e9ce3c3588d","html_url":"https://github.com/kinnison/git-testament","commit_stats":{"total_commits":102,"total_committers":5,"mean_commits":20.4,"dds":"0.10784313725490191","last_synced_commit":"0ef1d62c316156ade419070f0432fc920661566d"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kinnison%2Fgit-testament","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kinnison%2Fgit-testament/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kinnison%2Fgit-testament/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kinnison%2Fgit-testament/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kinnison","download_url":"https://codeload.github.com/kinnison/git-testament/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254501557,"owners_count":22081528,"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","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-08-01T14:01:24.749Z","updated_at":"2025-05-16T09:04:55.871Z","avatar_url":"https://github.com/kinnison.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# Git Testament\n\n![BSD 3 Clause](https://img.shields.io/github/license/kinnison/git-testament.svg)\n![Main build status](https://github.com/kinnison/git-testament/workflows/main/badge.svg)\n![Latest docs](https://docs.rs/git-testament/badge.svg)\n![Crates.IO](https://img.shields.io/crates/v/git-testament.svg)\n\n`git-testament` is a library to embed a testament as to the state of a git\nworking tree during the build of a Rust program. It uses the power of procedural\nmacros to embed commit, tag, and working-tree-state information into your program\nwhen it is built. This can then be used to report version information.\n\n```rust\nuse git_testament::{git_testament, render_testament};\n\ngit_testament!(TESTAMENT);\n\nfn main() {\n    println!(\"My version information: {}\", render_testament!(TESTAMENT));\n}\n```\n\nThe above code may print, for example, for a clean build from a 1.0.0 tag:\n\n```\nMy version information: 1.0.0 (763aa159d 2019-04-02)\n```\n\nOr something like `1.0.0+14 (651af89ed 2019-04-02) dirty 4 modifications`\nif the working tree is dirty and there have been some commits since the last\ntag.\n\nTo access the testament data (for example to render it yourself), the\n[documentation] describes all the details.\n\n[documentation]: https://docs.rs/git-testament/latest/git_testament/struct.GitTestament.html\n\n## Reproducible builds\n\nIn the case that your build is not being done from a Git repository, you still\nwant your testament to be useful to your users.  Reproducibility of the binary\nis critical in that case.  The [Reproducible Builds][reprobuild] team have defined\na mechanism for this known as [`SOURCE_DATE_EPOCH`][sde] which is an environment\nvariable which can be set to ensure the build date is fixed for reproducibilty\nreasons.  If you have no repo (or a repo but no commit) then `git_testament!()`\nwill use the [`SOURCE_DATE_EPOCH`][sde] environment variable (if present and parseable\nas a number of seconds since the UNIX epoch) to override `now`.\n\n[reprobuild]: https://reproducible-builds.org\n[sde]: https://reproducible-builds.org/docs/source-date-epoch/\n\n## Use in `no_std` scenarios\n\nThis crate does not link to anything in the standard library, but it does rely by default\non the `alloc` library being available. Disabling the `alloc` feature allows the crate to work \nin `no_std` environments where the `alloc` library is not available.\nYou can still generate a `GitTestament` struct though it'll be less easy to work with.\nInstead it'd be recommended to use the `git_testament_macros!()` macro instead \nwhich provides a set of macros which produce string constants to use.\nThis is less flexible/capable but can sometimes be easier to work with in these kinds of situations.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkinnison%2Fgit-testament","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkinnison%2Fgit-testament","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkinnison%2Fgit-testament/lists"}