Skip to content
Browse files

mtn-hooks: use proposed convention

  John Snow <john@snow.com> = John Snow <john@snow.com>
  John Snow = John Snow <unknown>
  <john@snow.com> = john <john@snow.com>
  john@snow.com = john <john@snow.com>

http://mid.gmane.org/1337745203.4388.65.camel@watermelon.coderich.net

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
  • Loading branch information...
1 parent 9ab9ac3 commit a213df2eaccc0988c90493bdee4d33dff5f47b82 @felipec committed May 27, 2012
Showing with 11 additions and 2 deletions.
  1. +11 −2 mtn-hooks.lua
View
13 mtn-hooks.lua
@@ -1,12 +1,12 @@
function unmapped_git_author(author)
name = author:match("^([^<>]+)@[^<>]+$")
if name then
- return "Unknown <" .. author .. ">"
+ return name .. " <" .. author .. ">"
end
name = author:match("^<([^<>]+)@[^<>]+>$")
if name then
- return "Unknown " .. author
+ return name .. " " .. author
end
name = author:match("^[^<>@]+$")
@@ -16,3 +16,12 @@ function unmapped_git_author(author)
return author
end
+
+-- function test(author)
+-- print(author .. " = " .. unmapped_git_author(author))
+-- end
+--
+-- test('John Snow <john@snow.com>')
+-- test('John Snow')
+-- test('<john@snow.com>')
+-- test('john@snow.com')

0 comments on commit a213df2

Please sign in to comment.
Something went wrong with that request. Please try again.