# # # patch "git.ml" # from [9b05e45086efa259a14cf38a91d2c43b0d43f80d] # to [0d2d113ddd6a03a9182542e9ebf6e2bc62a440ac] # ============================================================ --- git.ml 9b05e45086efa259a14cf38a91d2c43b0d43f80d +++ git.ml 0d2d113ddd6a03a9182542e9ebf6e2bc62a440ac @@ -46,23 +46,18 @@ let fetch_history base id = fetch_dir_of_ids git_dir "refs/tags" let fetch_history base id = - log "exec" "### exec: Running git-rev-tree %s'" id ; + log "exec" "### exec: Running git-rev-list %s'" id ; match Gspawn.sync ~working_directory:base ~flags:[`SEARCH_PATH] - ["git-rev-tree"; id] with + ["git-rev-list"; "--parents" ; id] with | Gspawn.EXITSTATUS 0, stdout, _ -> stdout | _, _, stderr -> - Viz_types.errorf "git-rev-tree invocation failed: '%s'" stderr + Viz_types.errorf "git-rev-list invocation failed: '%s'" stderr let scan_history data = - let get_id s = - match string_split ~max_elem:2 ':' s with - | id :: _ -> id - | _ -> raise Not_found in - let rec proc ag i = if i >= String.length data then ag @@ -71,9 +66,7 @@ let scan_history data = let l = String.sub data i (j - i) in let ag = match string_split ' ' l with - | _ :: node :: parents -> - let id = get_id node in - let parents = List.map get_id parents in + | id :: parents -> let node = { id = id ; kind = if List.length parents > 1 then MERGE else REGULAR ; family = List.map (fun i -> i, PARENT) parents } in @@ -113,7 +106,7 @@ let scan_commit_object co = | "" -> raise Exit | l -> p := !p + String.length l + 1 ; - match string_split ~max_elem:2 ' ' l with + match string_split ~max_elem:2 ' ' l with | ["tree"; id] -> tree := id | ["parent"; id] -> parents := id :: !parents | ["author"; v] -> author := v