File tree 4 files changed +19
-6
lines changed
4 files changed +19
-6
lines changed Original file line number Diff line number Diff line change 5
5
vmount(-l, src, build)
6
6
.SUBDIRS: build
7
7
8
+ section
9
+ vmount(-l, src, debug)
10
+ OCAMLOPTFLAGS += -g
11
+ .SUBDIRS: debug
12
+
8
13
if false
9
14
10
15
section
Original file line number Diff line number Diff line change @@ -84,4 +84,10 @@ Or use a few special commands
84
84
git fs umount
85
85
git fs help
86
86
87
+ Debugging
88
+ ---------
89
+
90
+ MALLOC_CHECK_=3 debug/git-fs debug 2>&1 |tee -a debug.log
91
+
92
+
87
93
Original file line number Diff line number Diff line change @@ -861,7 +861,7 @@ let is_mounted () =
861
861
git_dir_quoted = fsname)
862
862
(mtab_lines () )
863
863
864
- let cmd_mount () =
864
+ let cmd_mount ?( debug = false ) () =
865
865
let lazy mountpoint = mountpoint_lazy in
866
866
let lazy fsname = fsname_lazy in
867
867
(* log fsname;*)
@@ -872,15 +872,16 @@ let cmd_mount () =
872
872
begin try Unix. mkdir mountpoint 0o755
873
873
with Unix. Unix_error (Unix. EEXIST, _ , _ ) -> () end ;
874
874
prerr_endline (Printf. sprintf " Mounting on %S" mountpoint);
875
- let fuse_args = [|
876
- fs_subtype; (* "-f";*)
875
+ let fuse_args = [
877
876
" -o" ; " ro" ;
878
877
(* fuse doesn't guess the subtype anymore, if we give it fsname *)
879
878
" -osubtype=" ^ fs_subtype;
880
879
" -ofsname=" ^ fsname;
881
880
mountpoint;
882
- |] in
883
- Fuse. main fuse_args fuse_ops
881
+ ] in
882
+ let fuse_args = if debug then " -s" ::" -d" ::fuse_args else fuse_args in
883
+ let fuse_args = fs_subtype::fuse_args in
884
+ Fuse. main (Array. of_list fuse_args) fuse_ops
884
885
end
885
886
886
887
let cmd_umount () =
@@ -915,7 +916,8 @@ let cmd_fuse_help () =
915
916
let _ =
916
917
match Sys. argv with
917
918
| [| _ |] -> cmd_mount ()
918
- | [| _; " mount" |] -> cmd_mount ()
919
+ | [| _; " mount" |] -> cmd_mount ~debug: false ()
920
+ | [| _; " debug" |] -> cmd_mount ~debug: true ()
919
921
| [| _; " umount" |] -> cmd_umount ()
920
922
| [| _; " show-mountpoint" |] -> cmd_show_mountpoint ()
921
923
| [| _; " is-mounted" |] -> cmd_is_mounted ()
You can’t perform that action at this time.
0 commit comments