pkgs/git-show-link: Match names with special chars too
This commit is contained in:
parent
dbd16ed438
commit
7254525c8e
@ -7,13 +7,13 @@ import subprocess
|
||||
REMOTE_TYPES = [
|
||||
{
|
||||
# github
|
||||
"match": re.compile(r'git@github.com:(?P<username>\w+)/(?P<project>\w+).git'),
|
||||
"match": re.compile(r'git@github.com:(?P<username>[\w\.-]+)/(?P<project>[\w\.-]+).git'),
|
||||
"format-branch": lambda g, b: f"https://github.com/{g['username']}/{g['project']}/tree/{b}/",
|
||||
"format-commit": lambda g, c: f"https://github.com/{g['username']}/{g['project']}/commit/{c}/",
|
||||
},
|
||||
{
|
||||
# gitea
|
||||
"match": re.compile(r'(?P<gituser>\w+)@(?P<host>[\w\.-]+):(?P<username>\w+)/(?P<project>\w+).git'),
|
||||
"match": re.compile(r'(?P<gituser>[\w\.-]+)@(?P<host>[\w\.-]+):(?P<username>[\w\.-]+)/(?P<project>[\w\.-]+).git'),
|
||||
"format-branch": lambda g, b: f"https://{g['host']}/{g['username']}/{g['project']}/src/branch/{b}/",
|
||||
"format-commit": lambda g, c: f"https://{g['host']}/{g['username']}/{g['project']}/commit/{c}/",
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user