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.

dry run before git commit

+26 -14
+22 -10
jj_tui/bin/graph_view.ml
··· 181 181 ; cmd = 182 182 Fun 183 183 (fun _ -> 184 + let subcmds = 185 + [ 186 + { 187 + key = 'y' 188 + ; description = "proceed" 189 + ; cmd = Cmd [ "git"; "push" ] 190 + } 191 + ; { 192 + key = 'n' 193 + ; description = "exit" 194 + ; cmd = 195 + Fun 196 + (fun _ -> 197 + ui_state.input $= `Normal; 198 + ui_state.show_popup $= None) 199 + } 200 + ] 201 + in 184 202 let log = 185 - jj_no_log [ "git"; "push"; "--dry-run" ]^"hi\n" 203 + jj_no_log ~get_stderr:true [ "git"; "push"; "--dry-run" ] 186 204 |> AnsiReverse.colored_string 187 205 |> Ui.atom 188 206 |> Lwd.pure 189 207 in 190 - ui_state.show_popup $= Some (log, "Git push will:"); 191 - let subcmd = 192 - { 193 - key = 'y' 194 - ; description = "proceed" 195 - ; cmd = Cmd [ "git"; "push" ] 196 - } 197 - in 198 - ui_state.input $= `Mode (command_input ~is_sub:true [subcmd])) 208 + let ui = W.vbox [ log; commands_list_ui subcmds ] in 209 + ui_state.show_popup $= Some (ui, "Git push will:"); 210 + ui_state.input $= `Mode (command_input ~is_sub:true subcmds)) 199 211 } 200 212 ; { key = 'f'; description = "git fetch"; cmd = Cmd [ "git"; "fetch" ] } 201 213 ]
+4 -4
jj_tui/bin/jj_process.ml
··· 6 6 end 7 7 8 8 exception JJError of string * string 9 + 9 10 module Make (Vars : Global_vars.Vars) = struct 10 11 (** Makes a new process that has acess to all input and output 11 12 This should be used for running other tui sub-programs *) ··· 31 32 ~f:(fun x -> 32 33 (match x.exit_status with 33 34 | `Exited i -> 34 - if i == 0 then `Ok x.stdout else `BadExit (i, x.stderr) 35 + if i == 0 then `Ok (x.stdout, x.stderr) else `BadExit (i, x.stderr) 35 36 | `Signaled i -> 36 37 `BadExit (i, x.stderr)) 37 38 |> Base.Or_error.return) ··· 76 77 res 77 78 ;; 78 79 79 - 80 80 (** Run a jj command without outputting to the command_log. 81 81 @param ?snapshot=true 82 82 When true snapshots the state when running the command and also aquires a lock before running it. Set to false for commands you wish to run concurrently. like those for generating content in the UI 83 83 @param ?color=true When true output will have terminal escape codes for color *) 84 - let jj_no_log ?(snapshot = true) ?(color = true) args = 84 + let jj_no_log ?(get_stderr = false) ?(snapshot = true) ?(color = true) args = 85 85 match jj_no_log_errorable ~snapshot ~color args with 86 86 | Ok a -> 87 - a 87 + if get_stderr then a |> snd else a |> fst 88 88 | Error (`BadExit (code, str)) -> 89 89 raise 90 90 (JJError