summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/scripts
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2024-09-14 19:25:22 +0000
committerKarl Berry <karl@freefriends.org>2024-09-14 19:25:22 +0000
commit6f6bc183a396c556d86e8136f53acc5657382e22 (patch)
treec4a5111d8e006693ff1827e46bc4cb772e028780 /Master/texmf-dist/scripts
parent7d6647d88a7d9b0011e6e2710e98f4560109ae44 (diff)
gitinfo-lua (14sep24)
git-svn-id: svn://tug.org/texlive/trunk@72284 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/scripts')
-rw-r--r--Master/texmf-dist/scripts/gitinfo-lua/gitinfo-lua.lua19
1 files changed, 16 insertions, 3 deletions
diff --git a/Master/texmf-dist/scripts/gitinfo-lua/gitinfo-lua.lua b/Master/texmf-dist/scripts/gitinfo-lua/gitinfo-lua.lua
index 8c346ec3bed..1c4b7b1dcb4 100644
--- a/Master/texmf-dist/scripts/gitinfo-lua/gitinfo-lua.lua
+++ b/Master/texmf-dist/scripts/gitinfo-lua/gitinfo-lua.lua
@@ -23,8 +23,8 @@ end
local module = {
name = 'gitinfo-lua',
info = {
- version = '1.1.0', --TAGVERSION
- date = '2024/04/11', --TAGDATE
+ version = '1.2.0', --TAGVERSION
+ date = '2024/09/14', --TAGDATE
comment = "Git info Lua — Git integration with LaTeX",
author = "Erik Nijenhuis",
license = "free"
@@ -109,10 +109,23 @@ function api:write_version()
end
end
+function api:is_dirty()
+ local files_changed, _ = self.cmd:exec('status --porcelain=1', true)
+ return files_changed and #files_changed > 0
+end
+
+function api:write_is_dirty()
+ if self:is_dirty() then
+ tex.write('1')
+ else
+ tex.write('0')
+ end
+end
+
-- todo: prevent output to stderr
-- todo: add write variant
-- experimental
-function api:is_dirty()
+function api:is_tag()
local ok, _ = self.cmd:exec('describe --tags --exact-match')
return ok == nil
end