[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Monotone-devel] Monotone Lua Hook for debian/changelog
From: |
Richard Laager |
Subject: |
[Monotone-devel] Monotone Lua Hook for debian/changelog |
Date: |
Wed, 05 Nov 2008 17:18:11 -0600 |
The following hook, which I'm posting in case it's useful to anyone
else, grabs the top entry from debian/changelog to use as a commit
message.
Richard
==========
default_edit_comment = edit_comment
function edit_comment(basetext, user_log_message)
local debian_changelog = io.open("debian/changelog")
if (debian_changelog ~= nil) then
if (not string.find(basetext, "patched debian/changelog")) then
io.stderr:write("mtn: misuse: debian/changelog exists,
but was not modified\n")
return nil
end
local res = ""
local line = debian_changelog:read()
while(line ~= nil) do
res = res .. line .. "\n"
if (string.find(line, "^ --")) then
return res
end
line = debian_changelog:read()
end
io.stderr:write("mtn: misuse: error parsing debian/changelog\n")
return nil
end
return default_edit_comment(basetext, user_log_message)
end
signature.asc
Description: This is a digitally signed message part
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Monotone-devel] Monotone Lua Hook for debian/changelog,
Richard Laager <=