Skip to content

Commit af21222

Browse files
committed
Change log formatting
1 parent 616f2ca commit af21222

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

scripts/gitinfo-lua.lua

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ function api:cs_for_authors(csname, conjunction, sort_by_contrib)
178178
tex.error(err)
179179
end
180180
else
181-
tex.error('ERROR: \\' .. csname .. ' not defined')
181+
tex.error('ERROR: ' .. csname .. ' not defined')
182182
end
183183
end
184184

@@ -199,7 +199,7 @@ function api:cs_commit(csname, rev, format)
199199
tex.error('ERROR: ' .. (err or 'nil'))
200200
end
201201
else
202-
tex.error('ERROR: \\' .. csname .. ' not defined')
202+
tex.error('ERROR: ' .. csname .. ' not defined')
203203
end
204204
end
205205

@@ -208,7 +208,7 @@ function api:cs_last_commit(csname, format)
208208
end
209209

210210
local parse_commit_opts = luakeys.define({
211-
rev_spec = { data_type = 'string', pick = 'string' },
211+
rev_spec = { pick = 'string' },
212212
files = { data_type = 'list' },
213213
cwd = { data_type = 'string' },
214214
flags = {
@@ -233,15 +233,18 @@ function api:cs_for_commit(csname, args, format)
233233
if token.is_defined(csname) then
234234
local tok = token.create(csname)
235235
local opts = parse_commit_opts(args)
236-
-- Something is going wrong with the parsing of rev_spec with pick, which ends up to be missing
237-
-- This is a walkaround to ensure the old API would still work
236+
-- Something is going wrong with the parsing of rev_spec with pick, which ends up to be missing.
237+
-- This is a workaround to ensure the old API would still work.
238+
-- This will be fixed after luakeys version >0.13.0
238239
if type(opts.rev_spec) ~= 'string' then
239240
local i = string.find(args, ',')
240241
if i then
241242
opts.rev_spec = string.sub(args, 1, i-1)
242243
else
243244
opts.rev_spec = args
244245
end
246+
else
247+
opts.rev_spec = string.gsub(opts.rev_spec, '[\'"]', '')
245248
end
246249
local log, err = self.cmd:log(format, opts.rev_spec, parse_flags(opts.flags), opts.cwd, opts['files'])
247250
if log then
@@ -252,10 +255,10 @@ function api:cs_for_commit(csname, args, format)
252255
end
253256
end
254257
else
255-
tex.error('ERROR:\\' .. err)
258+
tex.error('ERROR: ' .. err)
256259
end
257260
else
258-
tex.error('ERROR: \\' .. csname .. ' not defined')
261+
tex.error('ERROR: ' .. csname .. ' not defined')
259262
end
260263
end
261264

@@ -293,7 +296,7 @@ function api:cs_tag(csname, format_spec, tag, target_dir)
293296
end
294297
end
295298
else
296-
tex.error('ERROR:\\' .. csname .. ' not defined')
299+
tex.error('ERROR: ' .. csname .. ' not defined')
297300
end
298301
end
299302

@@ -309,10 +312,10 @@ function api:cs_for_tag(csname, format_spec, target_dir)
309312
end
310313
end
311314
else
312-
tex.error('ERROR:\\' .. err)
315+
tex.error('ERROR: ' .. err)
313316
end
314317
else
315-
tex.error('ERROR:\\' .. csname .. ' not defined')
318+
tex.error('ERROR: ' .. csname .. ' not defined')
316319
end
317320
end
318321

@@ -330,10 +333,10 @@ function api:cs_for_tag_sequence(csname, target_dir)
330333
end
331334
end
332335
else
333-
tex.error('ERROR:\\' .. (err or 'Unknown error'))
336+
tex.error('ERROR: ' .. (err or 'Unknown error'))
334337
end
335338
else
336-
tex.error('ERROR:\\' .. csname .. ' not defined')
339+
tex.error('ERROR: ' .. csname .. ' not defined')
337340
end
338341
end
339342

0 commit comments

Comments
 (0)