{"id":22281933,"url":"https://github.com/tjtelan/git-url-parse-rs","last_synced_at":"2025-04-07T05:09:32.216Z","repository":{"id":39641388,"uuid":"235507391","full_name":"tjtelan/git-url-parse-rs","owner":"tjtelan","description":"Parser of git repo urls for Rust","archived":false,"fork":false,"pushed_at":"2024-10-30T21:35:24.000Z","size":64,"stargazers_count":17,"open_issues_count":6,"forks_count":9,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-31T04:08:24.531Z","etag":null,"topics":["azure-devops","bitbucket","git","github"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tjtelan.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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},"funding":{"custom":"https://www.buymeacoffee.com/tjtelan"}},"created_at":"2020-01-22T05:47:03.000Z","updated_at":"2025-03-22T22:52:02.000Z","dependencies_parsed_at":"2024-10-30T22:36:31.574Z","dependency_job_id":null,"html_url":"https://github.com/tjtelan/git-url-parse-rs","commit_stats":{"total_commits":37,"total_committers":8,"mean_commits":4.625,"dds":0.3513513513513513,"last_synced_commit":"fae176e9984472e1d50c9c27f294bc8f0a62e573"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tjtelan%2Fgit-url-parse-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tjtelan%2Fgit-url-parse-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tjtelan%2Fgit-url-parse-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tjtelan%2Fgit-url-parse-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tjtelan","download_url":"https://codeload.github.com/tjtelan/git-url-parse-rs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247595334,"owners_count":20963943,"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":["azure-devops","bitbucket","git","github"],"created_at":"2024-12-03T16:23:43.594Z","updated_at":"2025-04-07T05:09:32.193Z","avatar_url":"https://github.com/tjtelan.png","language":"Rust","funding_links":["https://www.buymeacoffee.com/tjtelan"],"categories":[],"sub_categories":[],"readme":"# git-url-parse\n\n![Minimum Supported Rust Version](https://raw.githubusercontent.com/tjtelan/git-url-parse-rs/main/.github/assets/msrv-badge.svg)\n[![Crates.io](https://img.shields.io/crates/v/git-url-parse)](https://crates.io/crates/git-url-parse)\n[![Github actions CI status](https://github.com/tjtelan/git-url-parse-rs/actions/workflows/ci.yml/badge.svg)](https://github.com/tjtelan/git-url-parse-rs/actions/workflows/ci.yml)\n[![docs.rs](https://docs.rs/git-url-parse/badge.svg)](https://docs.rs/git-url-parse/)\n[![License](https://img.shields.io/github/license/tjtelan/git-url-parse-rs)](LICENSE)\n![Maintenance](https://img.shields.io/maintenance/yes/2024)\n\nSupports common protocols as specified by the [Pro Git book](https://git-scm.com/book/en/v2)\n\nSee: [4.1 Git on the Server - The Protocols](https://git-scm.com/book/en/v2/Git-on-the-Server-The-Protocols)\n\nSupports parsing SSH/HTTPS repo urls for:\n* Github\n* Bitbucket\n* Azure Devops\n\nSee [tests/parse.rs](tests/parse.rs) for expected output for a variety of inputs.\n\n---\n\nURLs that use the `ssh://` protocol (implicitly or explicitly) undergo a small normalization process in order to be parsed.\n\nInternally uses `Url::parse()` from the [Url](https://crates.io/crates/url) crate after normalization.\n\n## Examples\n\n### Run example with debug output\n\n```shell\n$ RUST_LOG=git_url_parse cargo run --example multi\n$ RUST_LOG=git_url_parse cargo run --example trim_auth \n```\n\n### Simple usage and output\n\n```bash\n$ cargo run --example readme\n```\n\n```rust\nuse git_url_parse::GitUrl;\n\nfn main() {\n    println!(\"SSH: {:#?}\", GitUrl::parse(\"git@github.com:tjtelan/git-url-parse-rs.git\"));\n    println!(\"HTTPS: {:#?}\", GitUrl::parse(\"https://github.com/tjtelan/git-url-parse-rs\"));\n}\n```\n\n### Example Output\n```bash\nSSH: Ok(\n    GitUrl {\n        host: Some(\n            \"github.com\",\n        ),\n        name: \"git-url-parse-rs\",\n        owner: Some(\n            \"tjtelan\",\n        ),\n        organization: None,\n        fullname: \"tjtelan/git-url-parse-rs\",\n        scheme: Ssh,\n        user: Some(\n            \"git\",\n        ),\n        token: None,\n        port: None,\n        path: \"tjtelan/git-url-parse-rs.git\",\n        git_suffix: true,\n        scheme_prefix: false,\n    },\n)\nHTTPS: Ok(\n    GitUrl {\n        host: Some(\n            \"github.com\",\n        ),\n        name: \"git-url-parse-rs\",\n        owner: Some(\n            \"tjtelan\",\n        ),\n        organization: None,\n        fullname: \"tjtelan/git-url-parse-rs\",\n        scheme: Https,\n        user: None,\n        token: None,\n        port: None,\n        path: \"/tjtelan/git-url-parse-rs\",\n        git_suffix: false,\n        scheme_prefix: true,\n    },\n)\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftjtelan%2Fgit-url-parse-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftjtelan%2Fgit-url-parse-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftjtelan%2Fgit-url-parse-rs/lists"}