authorgravatar for git@paperclover.netclover caruso <git@paperclover.net> 2026-05-18 12:20:22-07:00
committergravatar for git@paperclover.netclover caruso <git@paperclover.net> 2026-08-14 14:18:46-07:00
log9e1f8fd9137873ba69a31f4ee1bfa1cc809601fe
treec761309dac110e43d4eda981f38a932ff2ace56a
parent395583786f5adeb3a2a358f5a9d0ec9e5cd180b0
signature Signed by SSH key SHA256:cOKiuRFOeSRxne6EWgHtdQQSlBxjOXm2hOCFnCdLQbQ

clover: more stuff


2 files changed, 40 insertions(+), 3 deletions(-)

users/clover/AGENTS.md+1-1
......@@ -19,7 +19,7 @@ You are working with Clover, an intelligent web/systems engineer. Please avoid e
1919
2020## Comments
2121
22Comments must always be placed and edited with intent to serialize codebase theory for future versions of ourselves and coworkers. They are professionally written, containing relevant context to the current iteration. Clover's comments are always timeless and rarely written from the first person (no `I`, `we`) -- refer directly to the code. Rewording comments this way helps solidify your own understanding, and can even reveal logic bugs in the designed systems. Prefer documentation comments over line comments.
22Comments must always be placed and edited with intent to serialize codebase theory for future versions of ourselves and coworkers. They are professionally written, containing relevant context to the current iteration. Clover's comments are always timeless and rarely written from the first person (no `I`, `we`) -- refer directly to the code. Rewording comments this way helps solidify your own understanding, and can even reveal logic bugs in the designed systems. Prefer documentation comments on declarations over inline comments.
2323
2424## Code Quality
2525
users/clover/home.nix+39-2
......@@ -76,6 +76,8 @@ in
7676 bup = "jj b m --from 'heads(::@- & bookmarks()) ~ (master | bookmarks(glob:\"deployment*\"))' --to '@'";
7777 moveself = "jj rebase -s @ -d";
7878 logall = "jj log -r 'all()'";
79 unmerged = "jj log -r 'unmerged()'";
80 um = "jj log -r 'unmerged()'";
7981 cherry = "jj git fetch && jj split -i -p -m 'SPLIT_CHANGES' && jj edit -r 'description(\"SPLIT_CHANGES\")' && jj desc -m '' --edit";
8082 };
8183 initContent = ''
......@@ -146,13 +148,26 @@ in
146148 }
147149
148150 function jj() {
149 if [[ "$*" = "git push"* ]] && [[ "$*" != *"--dry-run"* ]]; then
151 if [[ "$1" = "new" && "$#" -eq 2 && "$2" != *@* && "$2" != -* ]]; then
152 local stderr status
153 stderr="$(mktemp)"
154 command jj "$@" 2>"$stderr"
155 status=$?
156 if [[ $status -ne 0 ]] && command grep -Fq "Revision \`$2\` doesn't exist" "$stderr" && command grep -Fq "\`$2@origin\`" "$stderr"; then
157 rm -f "$stderr"
158 command jj new "$2@origin"
159 return $?
160 fi
161 command cat "$stderr" >&2
162 rm -f "$stderr"
163 return $status
164 elif [[ "$*" = "git push"* ]] && [[ "$*" != *"--dry-run"* ]]; then
150165 if command jj "$@" --dry-run; then
151166 printf "Press any key to continue... "
152167 read -r
153168 command jj "$@"
154169 fi
155 else if [[ "$*" != "undo" ]] || [[ "$*" != "redo" ]]
170 elif [[ "$*" != "undo" && "$*" != "redo" ]]; then
156171 # auto-install deps when switching commits
157172 wrapWithAutoInstall jj "$@"
158173 fi
......@@ -254,6 +269,28 @@ in
254269 revsets = {
255270 short-prefixes = "(trunk()..@)::";
256271 };
272 "template-aliases" = {
273 "format_log_author(commit)" = ''
274 if(commit.mine(), "You", commit.author().name().match("[^ ]+"))
275 '';
276 "format_log_timestamp(timestamp)" = ''
277 if(timestamp.after("1 day ago"), timestamp.ago(), timestamp.local().format("%Y-%m-%d"))
278 '';
279 "format_short_commit_header(commit)" = ''
280 separate(" ",
281 format_short_change_id_with_change_offset(commit),
282 label("author", format_log_author(commit)),
283 label("timestamp", format_log_timestamp(commit_timestamp(commit))),
284 commit.bookmarks(),
285 commit.tags(),
286 commit.working_copies(),
287 format_commit_labels(commit),
288 if(config("ui.show-cryptographic-signatures").as_boolean(),
289 format_short_cryptographic_signature(commit.signature())
290 ),
291 )
292 '';
293 };
257294 aliases = {
258295 "ab" = [ "abandon" ];
259296 "ci" = [