From 5c36a37ecdb7881a8215421bb2a5ae7c55150e47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reynir=20Bj=C3=B6rnsson?= Date: Thu, 16 Nov 2023 08:57:33 +0100 Subject: [PATCH] include if git worktree was dirty --- src/blogger.ml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/blogger.ml b/src/blogger.ml index ca1edf7..8c73e39 100644 --- a/src/blogger.ml +++ b/src/blogger.ml @@ -127,7 +127,10 @@ let run_git_config key = function let run_git_rev_parse default = 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 | Ok (value, (_, `Exited 0)) -> value | Ok (value, (run_info, _)) ->