feat(starship): remove most git info in jj repos
This commit is contained in:
@@ -19,30 +19,58 @@ in {
|
||||
inherit (cfg) enable;
|
||||
enableTransience = true;
|
||||
settings = mkIf cfg.jjIntegration {
|
||||
custom.jj = {
|
||||
description = "The current jj status";
|
||||
detect_folders = [".jj"];
|
||||
symbol = "🥋 ";
|
||||
command = ''
|
||||
jj log --revisions @ --no-graph --ignore-working-copy --color always --limit 1 --template '
|
||||
separate(" ",
|
||||
change_id.shortest(4),
|
||||
bookmarks,
|
||||
"|",
|
||||
concat(
|
||||
if(conflict, "💥"),
|
||||
if(divergent, "🚧"),
|
||||
if(hidden, "👻"),
|
||||
if(immutable, "🔒"),
|
||||
),
|
||||
raw_escape_sequence("\x1b[1;32m") ++ if(empty, "(empty)"),
|
||||
raw_escape_sequence("\x1b[1;32m") ++ coalesce(
|
||||
truncate_end(29, description.first_line(), "…"),
|
||||
"(no description set)",
|
||||
) ++ raw_escape_sequence("\x1b[0m"),
|
||||
)
|
||||
'
|
||||
'';
|
||||
# Disabling these so they can be enabled conditionally
|
||||
# See https://github.com/jj-vcs/jj/wiki/Starship
|
||||
git_status.disabled = true;
|
||||
git_commit.disabled = true;
|
||||
git_metrics.disabled = true;
|
||||
git_branch.disabled = true;
|
||||
custom = let
|
||||
when = "! jj --ignore-working-copy-root";
|
||||
description = "Only show if we’re not in a jj repository";
|
||||
style = "";
|
||||
in {
|
||||
git_status = {
|
||||
inherit when description style;
|
||||
command = "starship module git_status";
|
||||
};
|
||||
git_commit = {
|
||||
inherit when description style;
|
||||
command = "starship module git_commit";
|
||||
};
|
||||
git_metrics = {
|
||||
inherit when description style;
|
||||
command = "starship module git_metrics";
|
||||
};
|
||||
git_branch = {
|
||||
inherit when description style;
|
||||
command = "starship module git_branch";
|
||||
};
|
||||
jj = {
|
||||
description = "The current jj status";
|
||||
detect_folders = [".jj"];
|
||||
symbol = "🥋 ";
|
||||
command = ''
|
||||
jj log --revisions @ --no-graph --ignore-working-copy --color always --limit 1 --template '
|
||||
separate(" ",
|
||||
change_id.shortest(4),
|
||||
bookmarks,
|
||||
"|",
|
||||
concat(
|
||||
if(conflict, "💥"),
|
||||
if(divergent, "🚧"),
|
||||
if(hidden, "👻"),
|
||||
if(immutable, "🔒"),
|
||||
),
|
||||
raw_escape_sequence("\x1b[1;32m") ++ if(empty, "(empty)"),
|
||||
raw_escape_sequence("\x1b[1;32m") ++ coalesce(
|
||||
truncate_end(29, description.first_line(), "…"),
|
||||
"(no description set)",
|
||||
) ++ raw_escape_sequence("\x1b[0m"),
|
||||
)
|
||||
'
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user