Skip to content

Commit 7a65cfd

Browse files
committed
Merge pull request clog-tool#11 from lidavidm/cgit
feat: add cgit link style
2 parents fe8257e + 0df12c8 commit 7a65cfd

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/link_style.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ clog_enum!{
1212
pub enum LinkStyle {
1313
Github,
1414
Gitlab,
15-
Stash
15+
Stash,
16+
Cgit
1617
}
1718
}
1819

@@ -36,6 +37,8 @@ impl LinkStyle {
3637
LinkStyle::Github => format!("{}/issues/{}", link, issue.as_ref()),
3738
LinkStyle::Gitlab => format!("{}/issues/{}", link, issue.as_ref()),
3839
LinkStyle::Stash => format!("{}", issue.as_ref()),
40+
// cgit does not support issues
41+
LinkStyle::Cgit => format!("{}", issue.as_ref()),
3942
}
4043
}
4144
}
@@ -59,6 +62,7 @@ impl LinkStyle {
5962
LinkStyle::Github => format!("{}/commit/{}", link, hash.as_ref()),
6063
LinkStyle::Gitlab => format!("{}/commit/{}", link, hash.as_ref()),
6164
LinkStyle::Stash => format!("{}/commits/{}", link, hash.as_ref()),
65+
LinkStyle::Cgit => format!("{}/commit/?id={}", link, hash.as_ref()),
6266
}
6367
}
6468
}

0 commit comments

Comments
 (0)