{"id":17002029,"url":"https://github.com/sagiegurari/git_info","last_synced_at":"2025-03-17T09:30:54.259Z","repository":{"id":60775515,"uuid":"224495530","full_name":"sagiegurari/git_info","owner":"sagiegurari","description":"Extracts git repository information.","archived":false,"fork":false,"pushed_at":"2024-08-30T12:22:49.000Z","size":1906,"stargazers_count":6,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-13T01:48:23.008Z","etag":null,"topics":["extracts-git","git","runtime","rust","rust-library"],"latest_commit_sha":null,"homepage":null,"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/sagiegurari.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","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":"2019-11-27T18:43:22.000Z","updated_at":"2024-08-30T12:22:52.000Z","dependencies_parsed_at":"2023-12-30T00:23:29.565Z","dependency_job_id":"fe48fe99-4c84-43d8-b0a2-5536d704e835","html_url":"https://github.com/sagiegurari/git_info","commit_stats":{"total_commits":59,"total_committers":2,"mean_commits":29.5,"dds":0.03389830508474578,"last_synced_commit":"11b4d8e812e7c492bec55f439f482a4c3fa9efb8"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sagiegurari%2Fgit_info","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sagiegurari%2Fgit_info/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sagiegurari%2Fgit_info/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sagiegurari%2Fgit_info/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sagiegurari","download_url":"https://codeload.github.com/sagiegurari/git_info/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243858929,"owners_count":20359260,"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":["extracts-git","git","runtime","rust","rust-library"],"created_at":"2024-10-14T04:26:53.354Z","updated_at":"2025-03-17T09:30:53.601Z","avatar_url":"https://github.com/sagiegurari.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# git_info\n\n[![crates.io](https://img.shields.io/crates/v/git_info.svg)](https://crates.io/crates/git_info) [![CI](https://github.com/sagiegurari/git_info/workflows/CI/badge.svg?branch=master)](https://github.com/sagiegurari/git_info/actions) [![codecov](https://codecov.io/gh/sagiegurari/git_info/branch/master/graph/badge.svg)](https://codecov.io/gh/sagiegurari/git_info)\u003cbr\u003e\n[![license](https://img.shields.io/crates/l/git_info.svg)](https://github.com/sagiegurari/git_info/blob/master/LICENSE) [![Libraries.io for GitHub](https://img.shields.io/librariesio/github/sagiegurari/git_info.svg)](https://libraries.io/cargo/git_info) [![Documentation](https://docs.rs/git_info/badge.svg)](https://docs.rs/crate/git_info/) [![downloads](https://img.shields.io/crates/d/git_info.svg)](https://crates.io/crates/git_info)\u003cbr\u003e\n[![Built with cargo-make](https://sagiegurari.github.io/cargo-make/assets/badges/cargo-make.svg)](https://sagiegurari.github.io/cargo-make)\n\n\u003e Extracts git repository information.\n\n* [Overview](#overview)\n* [Usage](#usage)\n* [Installation](#installation)\n* [API Documentation](https://sagiegurari.github.io/git_info/)\n* [Contributing](.github/CONTRIBUTING.md)\n* [Release History](CHANGELOG.md)\n* [License](#license)\n\n\u003ca name=\"overview\"\u003e\u003c/a\u003e\n## Overview\nThis library main goal is to provide development/build tools such as [cargo-make](https://sagiegurari.github.io/cargo-make/) the needed information on the current git repository.\n\n\u003ca name=\"usage\"\u003e\u003c/a\u003e\n## Usage\nSimply include the library and invoke the get function to pull all info as follows:\n\n\u003c!--{ \"examples/example.rs\" | lines: 3 | code: rust }--\u003e\n```rust\nfn main() {\n    let info = git_info::get();\n\n    println!(\n        \"User Name: {}\",\n        info.user_name.unwrap_or(\"Unknown\".to_string())\n    );\n    println!(\n        \"User Email: {}\",\n        info.user_email.unwrap_or(\"Unknown\".to_string())\n    );\n    println!(\"Dirty: {}\", info.dirty.unwrap_or(false));\n    println!(\n        \"Current Branch: {}\",\n        info.current_branch.unwrap_or(\"Unknown\".to_string())\n    );\n\n    println!(\n        \"Last Commit Hash: {}\",\n        info.head.last_commit_hash.unwrap_or(\"Unknown\".to_string())\n    );\n    println!(\n        \"Last Commit Hash (short): {}\",\n        info.head\n            .last_commit_hash_short\n            .unwrap_or(\"Unknown\".to_string())\n    );\n\n    println!(\"Config: {:#?}\", info.config.unwrap());\n    println!(\"Branches: {:#?}\", info.branches.unwrap_or(vec![]));\n}\n```\n\u003c!--{ end }--\u003e\n\n\u003ca name=\"installation\"\u003e\u003c/a\u003e\n## Installation\nIn order to use this library, just add it as a dependency:\n\n```ini\n[dependencies]\ngit_info = \"^0.1.3\"\n```\n\n## API Documentation\nSee full docs at: [API Docs](https://sagiegurari.github.io/git_info/)\n\n## Contributing\nSee [contributing guide](.github/CONTRIBUTING.md)\n\n\u003ca name=\"history\"\u003e\u003c/a\u003e\n## Release History\n\nSee [Changelog](CHANGELOG.md)\n\n\u003ca name=\"license\"\u003e\u003c/a\u003e\n## License\nDeveloped by Sagie Gur-Ari and licensed under the Apache 2 open source license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsagiegurari%2Fgit_info","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsagiegurari%2Fgit_info","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsagiegurari%2Fgit_info/lists"}