Skip to main content

No project description provided

Project description

git-url-parse

Minimum Supported Rust Version Crates.io Github actions CI status docs.rs License Maintenance

Supports common protocols as specified by the Pro Git book

See: 4.1 Git on the Server - The Protocols

Supports parsing SSH/HTTPS repo urls for:

  • Github
  • Bitbucket
  • Azure Devops

See tests/parse.rs for expected output for a variety of inputs.


URLs that use the ssh:// protocol (implicitly or explicitly) undergo a small normalization process in order to be parsed.

Internally uses Url::parse() from the Url crate after normalization.

Examples

Run example with debug output

$ RUST_LOG=git_url_parse cargo run --example multi
$ RUST_LOG=git_url_parse cargo run --example trim_auth 

Simple usage and output

$ cargo run --example readme
use git_url_parse::GitUrl;

fn main() {
    println!("SSH: {:#?}", GitUrl::parse("git@github.com:tjtelan/git-url-parse-rs.git"));
    println!("HTTPS: {:#?}", GitUrl::parse("https://github.com/tjtelan/git-url-parse-rs"));
}

Example Output

SSH: Ok(
    GitUrl {
        host: Some(
            "github.com",
        ),
        name: "git-url-parse-rs",
        owner: Some(
            "tjtelan",
        ),
        organization: None,
        fullname: "tjtelan/git-url-parse-rs",
        scheme: Ssh,
        user: Some(
            "git",
        ),
        token: None,
        port: None,
        path: "tjtelan/git-url-parse-rs.git",
        git_suffix: true,
        scheme_prefix: false,
    },
)
HTTPS: Ok(
    GitUrl {
        host: Some(
            "github.com",
        ),
        name: "git-url-parse-rs",
        owner: Some(
            "tjtelan",
        ),
        organization: None,
        fullname: "tjtelan/git-url-parse-rs",
        scheme: Https,
        user: None,
        token: None,
        port: None,
        path: "/tjtelan/git-url-parse-rs",
        git_suffix: false,
        scheme_prefix: true,
    },
)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

git_url_parse_rs-0.4.5.tar.gz (39.1 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

git_url_parse_rs-0.4.5-cp39-abi3-win_amd64.whl (220.6 kB view details)

Uploaded CPython 3.9+Windows x86-64

git_url_parse_rs-0.4.5-cp39-abi3-win32.whl (212.3 kB view details)

Uploaded CPython 3.9+Windows x86

git_url_parse_rs-0.4.5-cp39-abi3-musllinux_1_2_x86_64.whl (528.4 kB view details)

Uploaded CPython 3.9+musllinux: musl 1.2+ x86-64

git_url_parse_rs-0.4.5-cp39-abi3-musllinux_1_2_aarch64.whl (530.0 kB view details)

Uploaded CPython 3.9+musllinux: musl 1.2+ ARM64

git_url_parse_rs-0.4.5-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (358.3 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ x86-64

git_url_parse_rs-0.4.5-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (351.7 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

git_url_parse_rs-0.4.5-cp39-abi3-macosx_11_0_arm64.whl (323.3 kB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

git_url_parse_rs-0.4.5-cp39-abi3-macosx_10_12_x86_64.whl (331.9 kB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

Details for the file git_url_parse_rs-0.4.5.tar.gz.

File metadata

  • Download URL: git_url_parse_rs-0.4.5.tar.gz
  • Upload date:
  • Size: 39.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for git_url_parse_rs-0.4.5.tar.gz
Algorithm Hash digest
SHA256 6249b329535794af993f773a45f1b5ca22a303c825dff3ef358a793de6b1744b
MD5 d95d1601e1c93e5e4bdc78b24c05b272
BLAKE2b-256 4da8f1cc482ada61544bcfa7d68bdc8b47a21f4a42d39ea8523c787728e9e3e5

See more details on using hashes here.

File details

Details for the file git_url_parse_rs-0.4.5-cp39-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for git_url_parse_rs-0.4.5-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 7f6d6d44767608964bd6283f63249783444a2479aa019a79f35bf4ee09c26c4b
MD5 38c2812593838f933b835517c27df2d9
BLAKE2b-256 bf22867a2d7b345e411a8234cea2d01eb5dd81ab9ba64e7801b5b550df8c14b3

See more details on using hashes here.

File details

Details for the file git_url_parse_rs-0.4.5-cp39-abi3-win32.whl.

File metadata

  • Download URL: git_url_parse_rs-0.4.5-cp39-abi3-win32.whl
  • Upload date:
  • Size: 212.3 kB
  • Tags: CPython 3.9+, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for git_url_parse_rs-0.4.5-cp39-abi3-win32.whl
Algorithm Hash digest
SHA256 bc6b03d66d0afc57d6c49e358ec02a0ccc6f8ca1bb4dcf3cd6726584a46b5302
MD5 bf9efa05f6b137f55deff19a7bc948bf
BLAKE2b-256 efd2c74dd81eb8bac046647f51fe6197fb85dd68386c8705bd6518fb68db6fc3

See more details on using hashes here.

File details

Details for the file git_url_parse_rs-0.4.5-cp39-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for git_url_parse_rs-0.4.5-cp39-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 0a9cdbcaa3324a047df1a4d050cf63d4cb9e0c1f1be082e46aa8d23810424c18
MD5 0202415bed7a77e7eb08c6463743a321
BLAKE2b-256 f28c88fe09af30c9ae4c21478a3a1f4b35c2542c3bcee0de78ef836bfe142269

See more details on using hashes here.

File details

Details for the file git_url_parse_rs-0.4.5-cp39-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for git_url_parse_rs-0.4.5-cp39-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 b7f053adb1f570e95485dd2aa1b28cde000a34435f5e9b5d14f7650bdb439b9c
MD5 591020a7df9f691c0560491dda10ca9e
BLAKE2b-256 c2d4c337da438828ca134caf8b4a512e43d0aab410ef4b48f7fdf879b8882356

See more details on using hashes here.

File details

Details for the file git_url_parse_rs-0.4.5-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for git_url_parse_rs-0.4.5-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f5bc9354e82f5aa79be49d3cce82b36e2fb20d45074df6e529a3345478f00c17
MD5 3fc2381f4238ef8d02008f4d15cc9c34
BLAKE2b-256 68a5d4185c181f0364cf40130d9d46273bea23d679031363c426ce33136f915a

See more details on using hashes here.

File details

Details for the file git_url_parse_rs-0.4.5-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for git_url_parse_rs-0.4.5-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 874fd610d451c170a65230fa6ec1d74978f3faf74b8459369466c2ed429bfb25
MD5 c79b3fc18b5688a8a4e34ad9f5c886d1
BLAKE2b-256 7591f00c4bdb4cba952fceafbb1888f62e7b029d767edb85d569ca60a3e56ba2

See more details on using hashes here.

File details

Details for the file git_url_parse_rs-0.4.5-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for git_url_parse_rs-0.4.5-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7a573d2a78f1c6ebfda813ae02927fffde9bf1aea1660195a71cad3ffc5cacad
MD5 d0a992d4815393c14c24ba0a1189e3a0
BLAKE2b-256 e9779709e4e0e553ceeeb66a8b4321e636dc545797b2201758eadd70a1aaee43

See more details on using hashes here.

File details

Details for the file git_url_parse_rs-0.4.5-cp39-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for git_url_parse_rs-0.4.5-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 c2a53b3115f858d71fd707968c3b6301a7c5a1b6aff42dda8b34303cf06dc9a8
MD5 de9b3cd284ea0864992ab00e0691d069
BLAKE2b-256 2245458e13cc630efe1af5e7b2376202e4c0efa3967d95ee3ecd626f6789e4a1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page