2021-03-15 10:40:52 +00:00
|
|
|
use crate::config::ModuleConfig;
|
2019-12-06 16:57:42 +00:00
|
|
|
|
2021-03-31 15:31:55 +00:00
|
|
|
use serde::Serialize;
|
2019-12-06 16:57:42 +00:00
|
|
|
use starship_module_config_derive::ModuleConfig;
|
|
|
|
|
2021-03-31 15:31:55 +00:00
|
|
|
#[derive(Clone, ModuleConfig, Serialize)]
|
2019-12-06 16:57:42 +00:00
|
|
|
pub struct GitCommitConfig<'a> {
|
|
|
|
pub commit_hash_length: usize,
|
2020-07-07 22:45:32 +00:00
|
|
|
pub format: &'a str,
|
|
|
|
pub style: &'a str,
|
2020-02-12 19:56:29 +00:00
|
|
|
pub only_detached: bool,
|
2019-12-06 16:57:42 +00:00
|
|
|
pub disabled: bool,
|
2020-10-23 15:49:19 +00:00
|
|
|
pub tag_symbol: &'a str,
|
|
|
|
pub tag_disabled: bool,
|
2019-12-06 16:57:42 +00:00
|
|
|
}
|
|
|
|
|
2021-03-15 10:40:52 +00:00
|
|
|
impl<'a> Default for GitCommitConfig<'a> {
|
|
|
|
fn default() -> Self {
|
2019-12-06 16:57:42 +00:00
|
|
|
GitCommitConfig {
|
|
|
|
// be consistent with git by default, which has DEFAULT_ABBREV set to 7
|
|
|
|
commit_hash_length: 7,
|
2020-10-23 15:49:19 +00:00
|
|
|
format: "[\\($hash$tag\\)]($style) ",
|
2020-07-07 22:45:32 +00:00
|
|
|
style: "green bold",
|
2020-02-12 19:56:29 +00:00
|
|
|
only_detached: true,
|
|
|
|
disabled: false,
|
2020-10-23 15:49:19 +00:00
|
|
|
tag_symbol: "🏷 ",
|
|
|
|
tag_disabled: true,
|
2019-12-06 16:57:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|