terminal user interface to jujutsu. Focused on speed and clarity
9
fork

Configure Feed

Select the types of activity you want to include in your feed.

using graph view templating

+381 -89
+2
flake.nix
··· 249 249 ocamlPackages.angstrom 250 250 ocamlPackages.ppx_expect 251 251 ocamlPackages.uutf 252 + 253 + ocamlPackages.re 252 254 # ocamlPackages.parsexp 253 255 254 256 # Ocaml package dependencies needed to build go here.
+1 -1
jj_tui/bin/graph_view.ml
··· 418 418 | `Filler x -> 419 419 W.Lists.( 420 420 Filler 421 - (" " ^ x ^ "\n" 421 + (" " ^ x 422 422 |> Jj_tui.AnsiReverse.colored_string 423 423 |> Ui.atom 424 424 |> Lwd.pure)))
+13 -4
jj_tui/lib/dune
··· 1 1 (include_subdirs unqualified) 2 - (library 3 2 3 + (library 4 4 (name jj_tui) 5 5 (inline_tests) 6 - (libraries stdio notty nottui angstrom bigstringaf picos_std.sync picos_std.finally picos_std.structured logs) 6 + (libraries 7 + stdio 8 + notty 9 + nottui 10 + angstrom 11 + bigstringaf 12 + picos_std.sync 13 + picos_std.finally 14 + picos_std.structured 15 + logs 16 + re) 7 17 (preprocess 8 - (pps ppx_expect logs-ppx ppx_deriving.std)) 9 - ) 18 + (pps ppx_expect logs-ppx ppx_deriving.std)))
+314 -84
jj_tui/lib/process_wrappers.ml
··· 84 84 (* 85 85 1. Make the graph 86 86 *) 87 - let is_line_filler line = 88 - if line |> Base.String.is_substring ~substring:"root()" 89 - then raise FoundStart 90 - else 91 - line 92 - (* We will iterate through skipping any chars like pipes and whitespace untill we find either: 93 - a) A rev start char,which would make the line a rev. 94 - b) Nothing, which would make the the line filler 95 - *) 96 - |> String.iteri (fun i char -> 97 - let uchar = String.get_utf_8_uchar line i |> Uchar.utf_decode_uchar in 98 - (*I've removed the part that tries to precisely skip all the start chars. this is becasue it gets all stuffed up by the terminal escape codes 99 - FIXME currently this will get stuffed up if a line has that rev symbol in it 100 - *) 101 - (* TODO: Overhaul the default graph template to include a special token at the end of selectable revisions *) 102 - if (uchar |> Uchar.equal merge_symbol 103 - || uchar |> Uchar.equal rev_symbol 104 - || uchar |> Uchar.equal elieded_symbol 105 - || uchar |> Uchar.equal elieded_symbol_alt 106 - || uchar |> Uchar.equal (make_uchar "×") 107 - || char == '@') 108 - && not (line |> Base.String.is_substring ~substring:"(elided revisions)") 109 - then raise FoundStart) 110 - ;; 111 - 112 87 (** Function to tag duplicated items in a list *) 113 88 let tag_duplicates lst = 114 89 (* Create a frequency map to count occurrences of each element *) ··· 127 102 lst 128 103 ;; 129 104 105 + (* 106 + let ansi_regex = 107 + let open Re in 108 + let csi_start = alt [ char '\x1B'; char '\x9B' ] in (* ESC or CSI *) 109 + let intermediates = rep (set "[]()#;?") in 110 + let params = rep (seq [ char ';'; rep1 (set "-a-zA-Z0-9/#&.:=?%@~_") ]) in 111 + let csi_terminator = alt [ 112 + char '\x07'; (* BEL *) 113 + seq [ char '\x1B'; char '\\' ]; (* ESC \ *) 114 + char '\x9C' (* ST *) 115 + ] in 116 + let csi_sequence = seq [ 117 + csi_start; 118 + intermediates; 119 + opt (alt [ 120 + seq [ params; csi_terminator ]; 121 + seq [ rep1 (rg 'a' 'z'); opt params; csi_terminator ] 122 + ]) 123 + ] in 124 + let param_sequence = seq [ 125 + rep (seq [ rg '0' '9'; rep (seq [ char ';'; rep (rg '0' '9') ]) ]); 126 + alt [ 127 + set "A-PR-TZ"; (* Cursor movements and scroll regions *) 128 + set "cf-nq-uy"; (* Tab stops and erasure *) 129 + set "=><~" (* Keypad and editing modes *) 130 + ] 131 + ] in 132 + Re.compile (alt [ 133 + csi_sequence; 134 + param_sequence 135 + ]) 136 + let ansi_regex = 137 + let open Re in 138 + let st = alt [ str "\x07"; str "\x1B\\"; str "\x9C" ] in 139 + let pattern = 140 + alt [ 141 + (* CSI escape sequence pattern *) 142 + seq [ 143 + set "\x1B\x9B"; 144 + rep (set "[]()#;?"); 145 + opt (alt [ 146 + rep (seq [ char ';'; rep1 (set "a-zA-Z0-9/#&.:=?%@~_-") ]); 147 + seq [ 148 + rep1 (set "a-zA-Z0-9"); 149 + rep (seq [ char ';'; rep (set "a-zA-Z0-9/#&.:=?%@~_-") ]) 150 + ] 151 + ]); 152 + st; 153 + ]; 154 + 155 + (* OSC escape sequence pattern *) 156 + seq [ 157 + opt (seq [ repn digit 1 (Some 4); rep (seq [ char ';'; repn digit 0 (Some 4) ]) ]); 158 + set "0-9A-PR-TZcf-nq-uy=><~"; 159 + ] 160 + ] 161 + in 162 + Re.compile pattern *) 163 + let ansi_regex = 164 + let open Re in 165 + let pattern = 166 + seq 167 + [ 168 + set "\x1B" 169 + ; (* ESC character *) 170 + char '[' 171 + ; (* Opening bracket *) 172 + rep 173 + ((* Zero or more of: *) 174 + alt 175 + [ digit; (* Digits *) char ';' (* Semicolon separator *) ]) 176 + ; char 'm' (* SGR terminator *) 177 + ] 178 + in 179 + Re.compile pattern 180 + ;; 181 + 182 + let remove_ansi str = str |> Re.replace_string ~by:"" ansi_regex 183 + let count_ansi str = str |> Re.all ansi_regex |> List.length 184 + 130 185 let find_selectable_from_graph str = 131 - let selectable_count = ref 0 in 132 - let processLine new_list previous_line this_line = 133 - match previous_line with 134 - | Some previous_line -> 135 - selectable_count := !selectable_count + 1; 136 - `Selectable (String.concat "\n" [ previous_line; this_line ]) :: new_list, None 137 - | None -> 138 - (try 139 - is_line_filler this_line; 140 - `Filler this_line :: new_list, None 141 - with 142 - | FoundStart -> 143 - new_list, Some this_line 144 - | FoundFiller -> 145 - `Filler this_line :: new_list, None) 146 - in 147 - let graph = 186 + let matches = 148 187 str 149 - |> String.split_on_char '\n' 150 - (* filter out any lines that contain *) 151 - |> Base.List.fold ~init:([], None) ~f:(fun (new_list, previous) x -> 152 - (*there is generally a final newline and we should just skip that *) 153 - if String.length x = 0 154 - then new_list, previous 155 - else if String.length x <= 1 156 - then `Filler x :: new_list, None 157 - else processLine new_list previous x) 158 - (*the root() commit only has one line and will always be last, so we will try to process the final line*) 159 - |> (fun (list, final_line) -> 160 - match final_line with 161 - | Some line -> 162 - selectable_count := !selectable_count + 1; 163 - `Selectable line :: list 164 - | None -> 165 - list) 166 - |> List.rev 167 - |> Array.of_list 188 + |> Re.split_full 189 + (Re.Pcre.regexp 190 + ~flags:[ Re.Pcre.(`MULTILINE) ] 191 + {|(^.*?)\$\$--START--\$\$\|(.+?)\|(.+?)\|([\s\S]*?)\$\$--END--\$\$\n?|}) 192 + in 193 + (*if there are no matches it's all filler*) 194 + (* let count = matches |> List.length in *) 195 + let graph, ids = 196 + matches 197 + |> List.fold_left 198 + (fun (graph_acc, ids_acc) chunk -> 199 + match chunk with 200 + | `Delim selectable -> 201 + let graph_bit = Re.Group.get selectable 1 in 202 + let change_id = Re.Group.get selectable 2 |> remove_ansi in 203 + let commit_id = Re.Group.get selectable 3 |> remove_ansi in 204 + let content = Re.Group.get selectable 4 in 205 + ( `Selectable (graph_bit ^ content) :: graph_acc 206 + , { change_id; commit_id } :: ids_acc ) 207 + | `Text filler -> 208 + if filler = "" 209 + then 210 + graph_acc, ids_acc 211 + else `Filler filler :: graph_acc, ids_acc) 212 + ([], []) 213 + |> fun (graph, ids) -> List.rev graph |> Array.of_list, List.rev ids 168 214 in 169 - !selectable_count, graph 215 + let revs = ids |> tag_duplicates in 216 + graph, revs 170 217 ;; 171 218 172 219 (** retrieve revs from jj log of jj_tui*) ··· 195 242 struct 196 243 open Process 197 244 245 + let base_graph_template = 246 + {|if(root, 247 + format_root_commit(self), 248 + label(if(current_working_copy, "working_copy"), 249 + concat( 250 + format_short_commit_header(self)++"\n" , 251 + separate(" ", 252 + if(empty, label("empty", "(empty)")), 253 + if(description, 254 + description.first_line(), 255 + label(if(empty, "empty"), description_placeholder), 256 + ), 257 + ) , 258 + ), 259 + ) 260 + )|} 261 + ;; 262 + 263 + let graph_info_template = 264 + {|"$$--START--$$"++"|"++change_id++"|"++commit_id++"|"++|} 265 + ^ base_graph_template 266 + ^ {|++"$$--END--$$"++""|} 267 + ;; 268 + 269 + let get_graph_info revset_arg = 270 + let output = jj_no_log ([ "log"; "-T"; graph_info_template ] @ revset_arg) in 271 + output |> find_selectable_from_graph 272 + ;; 273 + 198 274 (**Returns a list of revs with both the change_id and commit_id*) 199 275 let get_revs ?revset () = 200 276 let revset_arg = match revset with Some revset -> [ "-r"; revset ] | None -> [] in ··· 209 285 (* in *) 210 286 (* if count<=0 then failwith "no process root" *) 211 287 (* ;; *) 212 - 288 + let graph_view_template = {|""|} 213 289 214 290 (** returns the graph and a list of revs within that graph*) 215 291 let graph_and_revs ?revset () = 216 292 (*We join_after here to ensure any errors in sub-fibers only propegate to here, otherwise fibers everywhere would get cancelled when an error here occurs*) 217 - Flock.join_after @@ fun _-> 293 + Flock.join_after @@ fun _ -> 218 294 let graph = 219 295 Flock.fork_as_promise @@ fun () -> 220 296 let revset_arg = match revset with Some revset -> [ "-r"; revset ] | None -> [] in 221 - let output = jj_no_log ([ "log" ] @ revset_arg) in 222 - output |> find_selectable_from_graph 223 - and revs = Flock.fork_as_promise @@ fun () -> get_revs ?revset () in 224 - let selectable_count, graph = Promise.await graph 225 - and revs = Promise.await revs in 297 + get_graph_info revset_arg 298 + in 299 + let graph, revs = Promise.await graph in 226 300 (*The graph should never have selectable items that don't also have a rev*) 227 - 228 - (* TODO: remove this becasue it's just for debugging*) 229 - let revs_len = revs |> Array.length in 230 - if selectable_count <> revs_len 231 - then failwith (Printf.sprintf "selectable:%d revs:%d" selectable_count revs_len); 232 - graph, revs 301 + (* if not (Array.length graph = List.length revs) then 302 + failwith @@ Printf.sprintf "graph and revs length mismatch %d %d" (Array.length graph) (List.length revs) 303 + else *) 304 + graph, revs |> Array.of_list 233 305 ;; 234 306 end 235 307 ··· 289 361 ~|} 290 362 ;; 291 363 364 + let test_data_3 = 365 + {|@ $$--START--$$|zqtxnkuuryqzzolyksrylpzotmplmvus|8ee443e4a374f7dfdd00494d8bf71af6162a1300|zqtxnkuu eli.jambu@gmail.com 2025-02-15 21:22:48 8ee443e4 366 + │ (no description set)$$--END--$$ 367 + ◌ $$--START--$$|wmrnukwqvmnrsovsyxnmpwlkklnzpvpp|b72673dcf464650064cdd80233b47848503cd01a|wmrnukwq eli.jambu@gmail.com 2025-02-12 20:20:28 git_head() b72673dc 368 + │ wip: test$$--END--$$ 369 + ○ $$--START--$$|oxpkqyozkvtxoklqutxztsmznxvwroxx|9c3af61798927da4c80caa216688ea9d69e0d8bb|oxpkqyoz eli.jambu@gmail.com 2024-11-26 12:13:41 9c3af617 370 + │ added duplicate and undo commands$$--END--$$ 371 + ○ $$--START--$$|tmyqqryzkukzztrpxrsxlqlzutptsnsw|47d6c9a1db9d3756549dc7a68690f3df5600c83a|tmyqqryz eli.jambu@gmail.com 2024-11-23 21:50:19 47d6c9a1 372 + │ make update view fully async$$--END--$$ 373 + │ ○ $$--START--$$|xwxrzsrzzlttpmysywysmnvtmrvysrvy|8e338e5c76cdcfb71951367ff87eb1df98561fbd|xwxrzsrz eli.jambu@gmail.com 2024-11-23 21:17:50 8e338e5c 374 + │ │ use picos nottui$$--END--$$ 375 + │ ○ $$--START--$$|osuupotwtypnmvnkrrlxmyxukvykmtsn|3c203669a359b27833d9104c80505afd89af5f4d|osuupotw eli.jambu@gmail.com 2024-11-23 19:25:59 3c203669 376 + │ │ support await_read for async integration with nottui$$--END--$$ 377 + │ ◌ $$--START--$$|zmxzlvmwmnqruvrosmmknumpupoztuum|668152f47d627e80184b8dbb5f40dd2b83ad6488|zmxzlvmw eli.jambu@gmail.com 2024-11-11 12:06:45 668152f4 378 + ├─╯ wip: try to allow nottui to support picos$$--END--$$ 379 + │ ○ $$--START--$$|opytqrnrrxlkzsxtkuvtvxyrpqsmrznl|e9d81817d5e56e0817b725e2965dd36d3918a087|opytqrnr eli.jambu@gmail.com 2024-11-02 12:31:37 e9d81817 380 + ├─╯ safeguard obj.magic functions$$--END--$$ 381 + │ ○ $$--START--$$|ozotxprmvvwvwuulxlokrmlksxtzpmmv|e882ff4a65c0eea778c4d0cc572d63e85444bc93|ozotxprm eli.jambu@gmail.com 2024-11-01 21:03:37 test-issues* e882ff4a 382 + ├─╯ spooky testing branch indicator$$--END--$$ 383 + ◆ $$--START--$$|kyzmstkmrsnrvtzzpwwnummnzpwlousx|15e7195328f95c7158dd1adc5e4bb50c7dd3372a|kyzmstkm eli.jambu@gmail.com 2024-11-01 21:03:37 master v0.8.8 v0.8.9 15e71953 384 + │ fix remaining references to branch rather than bookmark$$--END--$$ 385 + ~ (elided revisions) 386 + │ ○ $$--START--$$|uzuylryqmsmrlyzunluznwlkqsuurktp|811f78b9f5d3272ff65a80d973ad9fe3db338fc8|uzuylryq eli.jambu@gmail.com 2024-10-31 18:49:04 811f78b9 387 + ├─╯ Try to make new dune build the project$$--END--$$ 388 + ◆ $$--START--$$|oorzkzkwlkqpptmnzvvqvkmxxxrvxpnv|93c69eccd3e0838ee45946dc2b0eadbe4e679362|oorzkzkw eli.jambu@gmail.com 2024-10-27 18:44:00 aaa v0.8.7 93c69ecc 389 + │ updated to use bookmark instead of branch$$--END--$$ 390 + ~ (elided revisions) 391 + │ ○ $$--START--$$|nyzlmxtpvrxsormrrtzkwsopzuypppwr|81fca5ab7626736be4f61323ca8f27ed35659343|nyzlmxtp eli.jambu@gmail.com 2024-09-30 21:13:28 81fca5ab 392 + ├─╯ debugging config$$--END--$$ 393 + ◆ $$--START--$$|llxznmqxrmtumwyprntkvzupkywpvwoz|a529037b79b469d3c63857ef70395be46a38dda7|llxznmqx eli.jambu@gmail.com 2024-09-30 20:57:49 a529037b 394 + │ multi-select$$--END--$$ 395 + ~ (elided revisions) 396 + │ ○ $$--START--$$|wlrqltouzqqpvpzzlzstytypnstlronp|a6dbb3d390f01789f34ca279f3ee4ac0df6ceacd|wlrqltou eli.jambu@gmail.com 2024-08-18 16:04:45 a6dbb3d3 397 + ├─╯ (no description set)$$--END--$$ 398 + ◆ $$--START--$$|rwovpxktnwvyzpwmqsymtsquspvszwnl|235cdeaa5ef71894eca562a04eaee8d010ebe276|rwovpxkt eli.jambu@gmail.com 2024-08-18 15:07:25 235cdeaa 399 + │ filterable selcteion box styling$$--END--$$ 400 + ~ (elided revisions) 401 + │ ○ $$--START--$$|vzpuwsqtotlxpkxpqqkxzzlrkupknztq|a26efab4741c026b298098bd4ef6f251b9c29945|vzpuwsqt eli.jambu@gmail.com 2024-08-18 11:56:20 a26efab4 402 + ├─╯ (empty) ss$$--END--$$ 403 + ◆ $$--START--$$|zyonzlkqvopymszlpsztlrxqwttyxqoy|5cf5114617d86a60abe3dc33b77ff1c13ddcc202|zyonzlkq eli.jambu@gmail.com 2024-08-09 11:44:33 5cf51146 404 + │ Replace tabs with 4 spaces becasue they cause issuse for nottui$$--END--$$ 405 + ~|} 406 + ;; 407 + 292 408 let%expect_test "revs_graph_parsing" = 293 - let selectable, graph = find_selectable_from_graph test_data_2 in 409 + let graph, ids = find_selectable_from_graph test_data_3 in 410 + let ids = ids |> Array.of_list in 411 + let ids_idx = ref 0 in 294 412 graph 295 413 |> Array.iter (fun x -> 296 414 match x with ··· 299 417 x |> print_endline 300 418 | `Selectable x -> 301 419 "S:" |> print_endline; 420 + let id = ids.(!ids_idx) in 421 + (match id with 422 + | Unique id -> 423 + id.change_id |> print_endline; 424 + id.commit_id |> print_endline 425 + | Duplicate id -> 426 + id.change_id |> print_endline; 427 + id.commit_id |> print_endline); 428 + incr ids_idx; 302 429 x |> print_endline); 303 430 [%expect 304 431 {| 305 432 S: 306 - @ qpnrvwyl ethanboxx 13 seconds ago 48829167 433 + zqtxnkuuryqzzolyksrylpzotmplmvus 434 + 8ee443e4a374f7dfdd00494d8bf71af6162a1300 435 + @ zqtxnkuu eli.jambu@gmail.com 2025-02-15 21:22:48 8ee443e4 307 436 │ (no description set) 308 437 S: 309 - ◆ pqvkrmkw ethanboxx 3 months ago main v0.1.10 HEAD@git 931019c4 310 - │ (empty) Merge pull request #63 from eopb/release-plz-2024-05-11T09-14-47Z 438 + wmrnukwqvmnrsovsyxnmpwlkklnzpvpp 439 + b72673dcf464650064cdd80233b47848503cd01a 440 + ◌ wmrnukwq eli.jambu@gmail.com 2025-02-12 20:20:28 git_head() b72673dc 441 + │ wip: test 442 + S: 443 + oxpkqyozkvtxoklqutxztsmznxvwroxx 444 + 9c3af61798927da4c80caa216688ea9d69e0d8bb 445 + ○ oxpkqyoz eli.jambu@gmail.com 2024-11-26 12:13:41 9c3af617 446 + │ added duplicate and undo commands 447 + S: 448 + tmyqqryzkukzztrpxrsxlqlzutptsnsw 449 + 47d6c9a1db9d3756549dc7a68690f3df5600c83a 450 + ○ tmyqqryz eli.jambu@gmail.com 2024-11-23 21:50:19 47d6c9a1 451 + │ make update view fully async 452 + S: 453 + xwxrzsrzzlttpmysywysmnvtmrvysrvy 454 + 8e338e5c76cdcfb71951367ff87eb1df98561fbd 455 + │ ○ xwxrzsrz eli.jambu@gmail.com 2024-11-23 21:17:50 8e338e5c 456 + │ │ use picos nottui 457 + S: 458 + osuupotwtypnmvnkrrlxmyxukvykmtsn 459 + 3c203669a359b27833d9104c80505afd89af5f4d 460 + │ ○ osuupotw eli.jambu@gmail.com 2024-11-23 19:25:59 3c203669 461 + │ │ support await_read for async integration with nottui 462 + S: 463 + zmxzlvmwmnqruvrosmmknumpupoztuum 464 + 668152f47d627e80184b8dbb5f40dd2b83ad6488 465 + │ ◌ zmxzlvmw eli.jambu@gmail.com 2024-11-11 12:06:45 668152f4 466 + ├─╯ wip: try to allow nottui to support picos 467 + S: 468 + opytqrnrrxlkzsxtkuvtvxyrpqsmrznl 469 + e9d81817d5e56e0817b725e2965dd36d3918a087 470 + │ ○ opytqrnr eli.jambu@gmail.com 2024-11-02 12:31:37 e9d81817 471 + ├─╯ safeguard obj.magic functions 472 + S: 473 + ozotxprmvvwvwuulxlokrmlksxtzpmmv 474 + e882ff4a65c0eea778c4d0cc572d63e85444bc93 475 + │ ○ ozotxprm eli.jambu@gmail.com 2024-11-01 21:03:37 test-issues* e882ff4a 476 + ├─╯ spooky testing branch indicator 477 + S: 478 + kyzmstkmrsnrvtzzpwwnummnzpwlousx 479 + 15e7195328f95c7158dd1adc5e4bb50c7dd3372a 480 + ◆ kyzmstkm eli.jambu@gmail.com 2024-11-01 21:03:37 master v0.8.8 v0.8.9 15e71953 481 + │ fix remaining references to branch rather than bookmark 482 + F: 483 + ~ (elided revisions) 484 + 485 + S: 486 + uzuylryqmsmrlyzunluznwlkqsuurktp 487 + 811f78b9f5d3272ff65a80d973ad9fe3db338fc8 488 + │ ○ uzuylryq eli.jambu@gmail.com 2024-10-31 18:49:04 811f78b9 489 + ├─╯ Try to make new dune build the project 490 + S: 491 + oorzkzkwlkqpptmnzvvqvkmxxxrvxpnv 492 + 93c69eccd3e0838ee45946dc2b0eadbe4e679362 493 + ◆ oorzkzkw eli.jambu@gmail.com 2024-10-27 18:44:00 aaa v0.8.7 93c69ecc 494 + │ updated to use bookmark instead of branch 495 + F: 496 + ~ (elided revisions) 497 + 498 + S: 499 + nyzlmxtpvrxsormrrtzkwsopzuypppwr 500 + 81fca5ab7626736be4f61323ca8f27ed35659343 501 + │ ○ nyzlmxtp eli.jambu@gmail.com 2024-09-30 21:13:28 81fca5ab 502 + ├─╯ debugging config 503 + S: 504 + llxznmqxrmtumwyprntkvzupkywpvwoz 505 + a529037b79b469d3c63857ef70395be46a38dda7 506 + ◆ llxznmqx eli.jambu@gmail.com 2024-09-30 20:57:49 a529037b 507 + │ multi-select 508 + F: 509 + ~ (elided revisions) 510 + 511 + S: 512 + wlrqltouzqqpvpzzlzstytypnstlronp 513 + a6dbb3d390f01789f34ca279f3ee4ac0df6ceacd 514 + │ ○ wlrqltou eli.jambu@gmail.com 2024-08-18 16:04:45 a6dbb3d3 515 + ├─╯ (no description set) 516 + S: 517 + rwovpxktnwvyzpwmqsymtsquspvszwnl 518 + 235cdeaa5ef71894eca562a04eaee8d010ebe276 519 + ◆ rwovpxkt eli.jambu@gmail.com 2024-08-18 15:07:25 235cdeaa 520 + │ filterable selcteion box styling 311 521 F: 312 522 ~ (elided revisions) 523 + 313 524 S: 314 - │ ○ xnyvmlur ethanboxx 5 months ago push-znvwmrtqnnlq 0deaa0aa 315 - ├─┘ feat: impl `Deref` and `DerefMut` without exposing `Secret` 525 + vzpuwsqtotlxpkxpqqkxzzlrkupknztq 526 + a26efab4741c026b298098bd4ef6f251b9c29945 527 + │ ○ vzpuwsqt eli.jambu@gmail.com 2024-08-18 11:56:20 a26efab4 528 + ├─╯ (empty) ss 316 529 S: 317 - ◆ kkzuqwxo ethanboxx 5 months ago 9aa340cc 318 - │ (empty) Merge pull request #56 from eopb/push-smksztlxprww 530 + zyonzlkqvopymszlpsztlrxqwttyxqoy 531 + 5cf5114617d86a60abe3dc33b77ff1c13ddcc202 532 + ◆ zyonzlkq eli.jambu@gmail.com 2024-08-09 11:44:33 5cf51146 533 + │ Replace tabs with 4 spaces becasue they cause issuse for nottui 319 534 F: 320 - ~ |}] 535 + ~ 536 + |}] 537 + ;; 538 + 539 + let%expect_test "remove_ansi" = 540 + let str = "Hello" in 541 + let str = remove_ansi str in 542 + str |> print_endline; 543 + [%expect {|Hello|}] 544 + ;; 545 + 546 + let%expect_test "count_ansi" = 547 + let str = "Hello" in 548 + let count = count_ansi str in 549 + count |> string_of_int |> print_endline; 550 + [%expect {|2|}] 321 551 ;;
+51
scripts/template-test.sh
··· 1 + #!/usr/bin/env bash 2 + 3 + 4 + # [templates] 5 + # log_node=''' 6 + # coalesce( 7 + # if(!self, label("elided", "~")), 8 + # label( 9 + # separate(" ", 10 + # if(current_working_copy, "working_copy"), 11 + # if(immutable, "immutable"), 12 + # if(conflict, "conflict"), 13 + # ), 14 + # coalesce( 15 + # if(current_working_copy, "@"), 16 + # if(immutable, "◆"), 17 + # if(conflict, "×"), 18 + # if(self.contained_in("private()"), "◌"), 19 + # "○", 20 + # ) 21 + # ) 22 + # )''' 23 + 24 + # This is the start. now we add metadata before and above 25 + # "$$--"++if(!self, "YES")++"--$$\n"++ 26 + # jj log -T ' 27 + # "$$--START--$$"++"|"++change_id++"|"++commit_id++"|\n"++ 28 + # "$$--END--$$\n" 29 + # ' 30 + TMP=' 31 + if(root, 32 + format_root_commit(self), 33 + label(if(current_working_copy, "working_copy"), 34 + concat( 35 + format_short_commit_header(self)++"\n" , 36 + separate(" ", 37 + if(empty, label("empty", "(empty)")), 38 + if(description, 39 + description.first_line(), 40 + label(if(empty, "empty"), description_placeholder), 41 + ), 42 + ) , 43 + ), 44 + ) 45 + )' 46 + 47 + IDS='"|"++++"|"++commit_id++"|"' 48 + TMP="$IDS++$TMP" 49 + jj log -T " 50 + \"\$\$--START--\$\$\"++$TMP++\"\$\$--END--\$\$\" 51 + "