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.

Use git to generate a version number on build

+26
+16
jj_tui/bin/dune
··· 23 23 (static 24 24 (flags 25 25 (:standard -cclib -static -cclib -no-pie)))) 26 + 27 + ;; Generate a small OCaml module `version.ml` at build time containing: 28 + ;; let version = "<git-describe-or-fallback>" 29 + ;; The command prefers an explicitly-provided GIT_DESCRIBE environment variable 30 + ;; (useful in CI), otherwise falls back to `git describe`. If neither is 31 + ;; available, it writes "unknown". This uses only shell builtins and common 32 + ;; utilities (no python required). 33 + (rule 34 + (targets version.ml) 35 + (action 36 + (with-stdout-to version.ml 37 + (run sh -c 38 + "v=${GIT_DESCRIBE:-$(git describe --tags --always --dirty 2>/dev/null || echo unknown)}; 39 + esc=$(printf '%s' \"$v\" | sed 's/\\\\/\\\\\\\\/g; s/\"/\\\\\\\"/g'); 40 + printf 'let version = \"%s\"\\n' \"$esc\"" 41 + ))))
+10
jj_tui/bin/main.ml
··· 5 5 open Picos_std_structured 6 6 open Jj_tui.Logging 7 7 let () = 8 + (* Handle --version / -v early. A module `Version` is expected to be 9 + available (provided by `version.ml`, generated at build-time or present 10 + as a fallback). It should expose `val version : string`. Use 11 + `Version.version` here so the code refers to that module explicitly. *) 12 + if Array.length Sys.argv > 1 then 13 + match Sys.argv.(1) with 14 + | "--version" | "-v" -> 15 + print_endline Version.version; 16 + exit 0 17 + | _ -> (); 8 18 Ui.global_config.border_style<-Nottui.Ui.Border.unicode_rounded; 9 19 Ui.global_config.border_style_focused<-Nottui.Ui.Border.unicode_rounded; 10 20 (* Ui.global_config.border_attr<-A.empty; *)