fix(starship): jj status takes too much time

This commit is contained in:
Khaïs COLIN 2025-05-29 14:56:47 +02:00
parent 484dc6a929
commit f0b320658c
Signed by: logistic-bot
SSH key fingerprint: SHA256:RlpiqKeXpcPFZZ4y9Ou4xi2M8OhRJovIwDlbCaMsuAo

View file

@ -444,27 +444,27 @@ in {
programs.starship = { programs.starship = {
enable = true; enable = true;
settings = { settings = {
custom.jj = { # custom.jj = {
command = '' # command = ''
jj log -r@ -n1 --ignore-working-copy --no-graph --color always -T ' # jj log -r@ -n1 --ignore-working-copy --no-graph --color always -T '
separate(" ", # separate(" ",
bookmarks.map(|x| truncate_end(10, x.name(), "")).join(" "), # bookmarks.map(|x| truncate_end(10, x.name(), "…")).join(" "),
tags.map(|x| truncate_end(10, x.name(), "")).join(" "), # tags.map(|x| truncate_end(10, x.name(), "…")).join(" "),
surround("\"", "\"", truncate_end(24, description.first_line(), "")), # surround("\"", "\"", truncate_end(24, description.first_line(), "…")),
if(conflict, "conflict"), # if(conflict, "conflict"),
if(divergent, "divergent"), # if(divergent, "divergent"),
if(hidden, "hidden"), ) # if(hidden, "hidden"), )
' # '
''; # '';
when = "jj root --ignore-working-copy"; # when = "jj root --ignore-working-copy";
symbol = "jj"; # symbol = "jj";
}; # };
custom.jjstate = { # custom.jjstate = {
command = '' # command = ''
jj log -r@ -n1 --ignore-working-copy --no-graph --stat | tail -n1 | ${pkgs.sd}/bin/sd "(\d+) files? changed, (\d+) insertions?\(\+\), (\d+) deletions?\(-\)" ' ''${1}m ''${2}+ ''${3}-' | ${pkgs.sd}/bin/sd " 0." "" # jj log -r@ -n1 --ignore-working-copy --no-graph --stat | tail -n1 | ${pkgs.sd}/bin/sd "(\d+) files? changed, (\d+) insertions?\(\+\), (\d+) deletions?\(-\)" ' ''${1}m ''${2}+ ''${3}-' | ${pkgs.sd}/bin/sd " 0." ""
''; # '';
when = "jj root"; # when = "jj root";
}; # };
git_state.disabled = true; git_state.disabled = true;
git_commit.disabled = true; git_commit.disabled = true;
git_metrics.disabled = true; git_metrics.disabled = true;