Merge pull request 'include if git worktree was dirty' (#3) from git-describe into main

Reviewed-on: robur/blog.robur.coop#3
This commit is contained in:
Reynir Björnsson 2023-11-16 11:06:10 +00:00
commit 09d23602df

View file

@ -127,7 +127,10 @@ let run_git_config key = function
let run_git_rev_parse default = let run_git_rev_parse default =
let open Bos in let open Bos in
let value = OS.Cmd.run_out Cmd.(v "git" % "rev-parse" % "HEAD") in let value = OS.Cmd.run_out
Cmd.(v "git" % "describe" % "--always" % "--dirty"
% "--exclude=*" % "--abbrev=0")
in
match OS.Cmd.out_string value with match OS.Cmd.out_string value with
| Ok (value, (_, `Exited 0)) -> value | Ok (value, (_, `Exited 0)) -> value
| Ok (value, (run_info, _)) -> | Ok (value, (run_info, _)) ->