local utils = require("utils") local git = require("git_commands") local request = require("request") ngx.say([[]]) ngx.say("
") ngx.print("")
local parsed_uri = request.parse_uri()
utils.print_table(parsed_uri)
ngx.say("
")
local name = parsed_uri.parts[1]
--local name = "ncurses-minesweeper"
--local name = "lognestmonster"
--local name = "auto-plow"
--local name = "joshstock.in"
local repo = "/home/josh/repos/"..name
local headname = git.get_head(repo)
ngx.say("< DESCRIPTION GOES HERE >
") ngx.print("") ngx.print("Refs | ") ngx.print("Commit Log | ") ngx.print("Files | ") ngx.print("README | ") ngx.print("LICENSE") ngx.print("
Time | ") ngx.print("Hash | ") ngx.print("Subject | ") ngx.print("Author | ") ngx.print("# | ") ngx.print("(+) | ") ngx.print("(-) | ") ngx.print([[GPG? | ]]) ngx.print("|
---|---|---|---|---|---|---|---|---|
",utils.iso8601(commit.timestamp)," | ") ngx.print("",commit.shorthash," | ") ngx.print("",commit.subject:gsub("<","<")," | ") ngx.print("",commit.author," | ") ngx.print("",commit.email," | ") ngx.print("",commit.diff.num," | ") ngx.print("commit.diff.minus and " style=\"color:green;font-weight:bold\"" or "",">",commit.diff.plus~=0 and commit.diff.plus or ""," | ") ngx.print("commit.diff.plus and " style=\"color:red;font-weight:bold\"" or "",">",commit.diff.minus~=0 and commit.diff.minus or ""," | ") ngx.print("",commit.gpggood," | ") ngx.say("
Object | Latest Commit Subject | Time | Hash | ") ngx.say("
---|---|---|---|
",iconfolder,"",v," | ") local lastedit = git.log(repo, "@ -1", v, 1, 0, false)[1] ngx.print("",lastedit.subject," | ") ngx.print("",utils.iso8601(lastedit.timestamp)," | ") ngx.print("",lastedit.shorthash," | ") ngx.say("
",iconfile,"",v," | ") local lastedit = git.log(repo, "@ -1", v, 1, 0, false)[1] ngx.print("",lastedit.subject," | ") ngx.print("",utils.iso8601(lastedit.timestamp)," | ") ngx.print("",lastedit.shorthash," | ") ngx.say("