feature: supports the commit hash issue tracker (#382)

Using issue tracker instead of built-in supported commit web link is based on the following reasons

* repo may have multiple remotes
* it is not good to open an context menu to choose which web to visit with multiple remotes
* some remote servers are not supported by this app
This commit is contained in:
leo 2024-08-21 10:44:07 +08:00
parent 7b26589485
commit 48adad53b4
No known key found for this signature in database
6 changed files with 22 additions and 0 deletions

View file

@ -125,6 +125,19 @@ namespace SourceGit.Models
return rule;
}
public IssueTrackerRule AddCommitLinkIssueTracker()
{
var rule = new IssueTrackerRule()
{
Name = "Commit Link",
RegexString = @"\b([0-9a-fA-F]{8,40})\b",
URLTemplate = "https://test/$1",
};
IssueTrackerRules.Add(rule);
return rule;
}
public IssueTrackerRule AddGithubIssueTracker(string repoURL)
{
var rule = new IssueTrackerRule()