Compare commits

..

2 Commits

Author SHA1 Message Date
jolheiser fb26c31776
omp prompt for git-bug 2025-07-26 06:42:24 -05:00
jolheiser 26612ee1d2
combine refspecs into single git command for git-bug 2025-07-26 06:21:34 -05:00
2 changed files with 26 additions and 6 deletions

View File

@ -9,13 +9,11 @@ export def "git bug init" [] {
} }
export def "git bug pull" [] { export def "git bug pull" [] {
^git fetch origin refs/bugs/*:refs/bugs/* ^git fetch origin refs/bugs/*:refs/bugs/* refs/identities/*:refs/identities/*
^git fetch origin refs/identities/*:refs/identities/*
} }
export def "git bug push" [] { export def "git bug push" [] {
^git push origin refs/bugs/*:refs/bugs/* ^git push origin refs/bugs/*:refs/bugs/* refs/identities/*:refs/identities/*
^git push origin refs/identities/*:refs/identities/*
} }
def "bug-id" [] { def "bug-id" [] {

View File

@ -1,7 +1,7 @@
{ pkgs, ... }: { pkgs, ... }:
let let
unicode = x: builtins.fromJSON ''"${x}"''; unicode = x: builtins.fromJSON ''"${x}"'';
script = pkgs.writeShellApplication { jjScript = pkgs.writeShellApplication {
name = "jj-prompt"; name = "jj-prompt";
runtimeInputs = [ pkgs.jujutsu ]; runtimeInputs = [ pkgs.jujutsu ];
text = text =
@ -40,6 +40,16 @@ let
' '
''; '';
}; };
gitBugScript = pkgs.writeShellApplication {
name = "git-bug-prompt";
runtimeInputs = [
pkgs.git-bug
pkgs.jq
];
text = ''
git-bug bug --format json status:open | jq 'length'
'';
};
in in
{ {
programs.oh-my-posh = { programs.oh-my-posh = {
@ -110,12 +120,23 @@ in
foreground = "p:black"; foreground = "p:black";
powerline_symbol = unicode "\\ue0b0"; powerline_symbol = unicode "\\ue0b0";
properties = { properties = {
script = "${script}/bin/jj-prompt"; script = "${jjScript}/bin/jj-prompt";
}; };
style = "powerline"; style = "powerline";
template = "{{ if (glob \".jj\")}} {{ .Output }} {{ end }}"; template = "{{ if (glob \".jj\")}} {{ .Output }} {{ end }}";
type = "command"; type = "command";
} }
{
background = "p:maroon";
foreground = "p:black";
powerline_symbol = unicode "\\ue0b0";
properties = {
script = "${gitBugScript}/bin/git-bug-prompt";
};
style = "powerline";
template = "{{ if (glob \".git/refs/bugs\")}} 󰃤 {{ .Output }} {{ end }}";
type = "command";
}
{ {
background = "p:blue"; background = "p:blue";
background_templates = [ "{{ if gt .Code 0 }}p:red{{ end }}" ]; background_templates = [ "{{ if gt .Code 0 }}p:red{{ end }}" ];
@ -142,6 +163,7 @@ in
lavender = "#B4BEFE"; lavender = "#B4BEFE";
orange = "#FAB387"; orange = "#FAB387";
red = "#F38BA8"; red = "#F38BA8";
maroon = "#EBA0AC";
white = "#CDD6F4"; white = "#CDD6F4";
yellow = "#F9E2AF"; yellow = "#F9E2AF";
}; };