| ... | @@ -1,4 +1,9 @@ | ... | @@ -1,4 +1,9 @@ |
| 1 | { pkgs, host, ... }: | 1 | { |
| | 2 | pkgs, |
| | 3 | host, |
| | 4 | lib, |
| | 5 | ... |
| | 6 | }: |
| 2 | let | 7 | let |
| 3 | hostServer = false; | 8 | hostServer = false; |
| 4 | in | 9 | in |
| ... | @@ -66,8 +71,7 @@ in | ... | @@ -66,8 +71,7 @@ in |
| 66 | jf = "jj git fetch"; | 71 | jf = "jj git fetch"; |
| 67 | e = "jj edit"; | 72 | e = "jj edit"; |
| 68 | d = "jj desc"; | 73 | d = "jj desc"; |
| 69 | bup = "jj b m --from 'parents(@)' --to '@'"; | 74 | bup = "jj b m --from 'heads(::@- & bookmarks())' --to '@'"; |
| 70 | push = "jj git push"; | | |
| 71 | moveself = "jj rebase -r @ -d"; | 75 | moveself = "jj rebase -r @ -d"; |
| 72 | logall = "jj log -r 'all()'"; | 76 | logall = "jj log -r 'all()'"; |
| 73 | cherry = "jj git fetch && jj split -i -p -m 'SPLIT_CHANGES' && jj edit -r 'description(\"SPLIT_CHANGES\")' && jj desc -m '' --edit"; | 77 | cherry = "jj git fetch && jj split -i -p -m 'SPLIT_CHANGES' && jj edit -r 'description(\"SPLIT_CHANGES\")' && jj desc -m '' --edit"; |
| ... | @@ -83,19 +87,58 @@ in | ... | @@ -83,19 +87,58 @@ in |
| 83 | uv run --project "$dirname" "$@" | 87 | uv run --project "$dirname" "$@" |
| 84 | } | 88 | } |
| 85 | | 89 | |
| | 90 | function bun() { |
| | 91 | if [[ "$1" = "build" ]]; then |
| | 92 | command bun run "$@" |
| | 93 | elif [[ "$1" = "bundle" ]]; then |
| | 94 | shift |
| | 95 | command bun build "$@" |
| | 96 | else |
| | 97 | command bun "$@" |
| | 98 | fi |
| | 99 | } |
| | 100 | |
| | 101 | function jj() { |
| | 102 | if [[ "$*" = "git push"* ]] && [[ "$*" != *"--dry-run"* ]]; then |
| | 103 | command jj "$@" --dry-run |
| | 104 | printf "Press any key to continue... " |
| | 105 | read -r |
| | 106 | command jj "$@" |
| | 107 | else |
| | 108 | command jj "$@" |
| | 109 | fi |
| | 110 | } |
| | 111 | |
| | 112 | function push() { |
| | 113 | command jj git push "$@" --dry-run |
| | 114 | printf "Press any key to continue... " |
| | 115 | read -r |
| | 116 | if bash -c 'cd $(jj workspace root); bun local-ci'; then |
| | 117 | command jj git push "$@" |
| | 118 | fi |
| | 119 | } |
| | 120 | |
| 86 | function pr() { | 121 | function pr() { |
| 87 | message=$(jj log -r '@' -T 'description' --no-graph) | 122 | message=$(jj log -r '@' -T 'description' --no-graph) |
| 88 | if [[ -z "$message" ]] || [[ "$message" = "WIP:"* ]]; then | 123 | if [[ -z "$message" ]] || [[ "$message" = "WIP:"* ]]; then |
| 89 | jj desc | 124 | jj desc |
| | 125 | message=$(jj log -r '@' -T 'description' --no-graph) |
| | 126 | if [[ -z "$message" ]] || [[ "$message" = "WIP:"* ]]; then |
| | 127 | exit |
| | 128 | fi |
| 90 | fi | 129 | fi |
| 91 | if [ -n "$1" ]; then | 130 | if [ -n "$1" ]; then |
| 92 | jj git push --named "clo/$1"=@ | 131 | if [[ "clo"/* = "$1" ]]; then |
| 93 | branch="clo/$1" | 132 | branch="$1"; |
| | 133 | else |
| | 134 | branch="clo/$1" |
| | 135 | fi |
| | 136 | command jj git push --named "$branch"=@ |
| 94 | else | 137 | else |
| 95 | branch="$(jj log -r '@' -T '"clo/push-" ++ change_id.short()' --no-graph)" | 138 | command jj git push -c @ |
| 96 | jj git push -c @ | 139 | branch="$(jj log -r '@-' -T 'bookmarks.join("\n")' --no-graph | head -1)" |
| 97 | fi | 140 | fi |
| 98 | open "$(git remote get-url origin | sed 's/git@github\.com:/https:\/\/github.com\//' | sed 's/\.git$//')/compare/master...$branch" | 141 | open "$(git remote get-url origin | sed 's/git@github\.com:/https:\/\/github.com\//' | sed 's/\.git$//')/compare/master...$branch?quick_pull=1&labels=awaiting+code+review,awaiting+functionality+review&body=" |
| 99 | } | 142 | } |
| 100 | ''; | 143 | ''; |
| 101 | }; | 144 | }; |
| ... | @@ -104,7 +147,7 @@ in | ... | @@ -104,7 +147,7 @@ in |
| 104 | git.userEmail = "git@paperclover.net"; | 147 | git.userEmail = "git@paperclover.net"; |
| 105 | git.signing = { | 148 | git.signing = { |
| 106 | signByDefault = true; | 149 | signByDefault = true; |
| 107 | key = "C0D577FD799F9D11"; | 150 | key = lib.mkDefault "C0D577FD799F9D11"; |
| 108 | }; | 151 | }; |
| 109 | | 152 | |
| 110 | jujutsu = { | 153 | jujutsu = { |
| ... | @@ -175,7 +218,7 @@ in | ... | @@ -175,7 +218,7 @@ in |
| 175 | }; | 218 | }; |
| 176 | # ui.graph.style = "square"; | 219 | # ui.graph.style = "square"; |
| 177 | revsets = { | 220 | revsets = { |
| 178 | log = "ancestors(description(regex:\"^(WIP:|\\\\s+$)\"):: | working_copies() | bookmarks(\"master\")::remote_bookmarks(\"master\") | bookmarks(glob:\"clo/*\")::, 5)"; | 221 | log = "ancestors(description(regex:\"^(WIP:|\\\\s+$)\"):: | working_copies() | bookmarks(exact:\"master\")::remote_bookmarks(exact:\"master\") | bookmarks(glob:\"clo/*\")::, 5)"; |
| 179 | short-prefixes = "(trunk()..@)::"; | 222 | short-prefixes = "(trunk()..@)::"; |
| 180 | }; | 223 | }; |
| 181 | # templates.log = "hl_wip(self)"; | 224 | # templates.log = "hl_wip(self)"; |