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