| ... | ... | @@ -1,4 +1,9 @@ |
| 1 | | { pkgs, host, ... }: |
| 1 | { |
| 2 | pkgs, |
| 3 | host, |
| 4 | lib, |
| 5 | ... |
| 6 | }: |
| 2 | 7 | let |
| 3 | 8 | hostServer = false; |
| 4 | 9 | in |
| ... | ... | @@ -66,8 +71,7 @@ in |
| 66 | 71 | jf = "jj git fetch"; |
| 67 | 72 | e = "jj edit"; |
| 68 | 73 | d = "jj desc"; |
| 69 | | bup = "jj b m --from 'parents(@)' --to '@'"; |
| 70 | | push = "jj git push"; |
| 74 | bup = "jj b m --from 'heads(::@- & bookmarks())' --to '@'"; |
| 71 | 75 | moveself = "jj rebase -r @ -d"; |
| 72 | 76 | logall = "jj log -r 'all()'"; |
| 73 | 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 | 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 | 121 | function pr() { |
| 87 | 122 | message=$(jj log -r '@' -T 'description' --no-graph) |
| 88 | 123 | if [[ -z "$message" ]] || [[ "$message" = "WIP:"* ]]; then |
| 89 | 124 | jj desc |
| 125 | message=$(jj log -r '@' -T 'description' --no-graph) |
| 126 | if [[ -z "$message" ]] || [[ "$message" = "WIP:"* ]]; then |
| 127 | exit |
| 128 | fi |
| 90 | 129 | fi |
| 91 | 130 | if [ -n "$1" ]; then |
| 92 | | jj git push --named "clo/$1"=@ |
| 93 | | branch="clo/$1" |
| 131 | if [[ "clo"/* = "$1" ]]; then |
| 132 | branch="$1"; |
| 133 | else |
| 134 | branch="clo/$1" |
| 135 | fi |
| 136 | command jj git push --named "$branch"=@ |
| 94 | 137 | else |
| 95 | | branch="$(jj log -r '@' -T '"clo/push-" ++ change_id.short()' --no-graph)" |
| 96 | | jj git push -c @ |
| 138 | command jj git push -c @ |
| 139 | branch="$(jj log -r '@-' -T 'bookmarks.join("\n")' --no-graph | head -1)" |
| 97 | 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 | 147 | git.userEmail = "git@paperclover.net"; |
| 105 | 148 | git.signing = { |
| 106 | 149 | signByDefault = true; |
| 107 | | key = "C0D577FD799F9D11"; |
| 150 | key = lib.mkDefault "C0D577FD799F9D11"; |
| 108 | 151 | }; |
| 109 | 152 | |
| 110 | 153 | jujutsu = { |
| ... | ... | @@ -175,7 +218,7 @@ in |
| 175 | 218 | }; |
| 176 | 219 | # ui.graph.style = "square"; |
| 177 | 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 | 222 | short-prefixes = "(trunk()..@)::"; |
| 180 | 223 | }; |
| 181 | 224 | # templates.log = "hl_wip(self)"; |