Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 35 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Pure Lua implemented git URL parsing library, e.g. the output of <code>git remot

Single file & zero dependency.

Full [Git Protocols](https://git-scm.com/book/en/v2/Git-on-the-Server-The-Protocols) support:
Full [Git Protocols](https://git-scm.com/book/en/v2/Git-on-the-Server-The-Protocols) support (see below).

> [!NOTE]
>
Expand All @@ -47,28 +47,40 @@ Full [Git Protocols](https://git-scm.com/book/en/v2/Git-on-the-Server-The-Protoc
> 4. The `[]+` contains 1 or more (&ge; 1) component.
> 5. The `|` inside `[]` is **_or_** operator.

1. `{protocol}://[[{user}[:{password}]@]{host}[:{port}]]/[{org}/]*{repo}`, for example:
- `http://host.xyz/repo.git`
- `https://git@127.0.0.1:12345/repo.git`
- `ssh://username:password@host.xyz:port/path/to/the/repo.git`
- `ssh://host.xyz:port/path/to/the/repo.git`
- `file:///repo.git`
- `file://user:passwd@host.xyz:port/path/to/the/repo.git`
- `file://~/home/to/the/repo.git`
2. `[{user}[:{password}]@]{host}:[{org}/]*{repo}`, for example:
- `git@host.xyz:repo.git`
- `user:passwd@host.xyz:path/to/the/repo.git`
3. `[.|..|~][/{org}]*/{repo}`, for example:
- `repo.git`
- `./repo.git`
- `../path/to/the/repo.git`
- `~/home/to/the/repo.git`
- `/usr/home/to/the/repo.git`

All of above can be written by:

1. `[{protocol}://][[{user}[:{password}]@]host[:{port}]]/[{org}/]*{repo}`
2. `[.|..|~][/{org}]*/{repo}`
### Full Pattern

`{protocol}://[[{user}[:{password}]@]{host}[:{port}]]/[{org}/]*{repo}`

For example:

- `http://host.xyz/repo.git`
- `https://git@127.0.0.1:12345/repo.git`
- `ssh://username:password@host.xyz:port/path/to/the/repo.git`
- `ssh://host.xyz:port/path/to/the/repo.git`
- `file:///repo.git`
- `file://user:passwd@host.xyz:port/path/to/the/repo.git`
- `file://~/home/to/the/repo.git`

### Protocol Omitted Pattern

`[{user}[:{password}]@]{host}:[{org}/]*{repo}`

For example:

- `git@host.xyz:repo.git`
- `user:passwd@host.xyz:path/to/the/repo.git`

### Local Pattern

`[.|..|~][/{org}]*/{repo}`

For example:

- `repo.git`
- `./repo.git`
- `../path/to/the/repo.git`
- `~/home/to/the/repo.git`
- `/usr/home/to/the/repo.git`

## Install

Expand Down