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("

"..name.." / "..headname.name.."

") 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("

") local commits_head = git.log(repo, "@", "", 1, 0, true) ngx.say("

Latest Commit

") ngx.print("") ngx.print("") ngx.print("") ngx.print("") ngx.print("") ngx.print("") ngx.print("") ngx.print("") ngx.print("") ngx.print([[]]) ngx.print("") for i,commit in pairs(commits_head) do ngx.print("") ngx.print("") ngx.print("") ngx.print("") ngx.print("") ngx.print("") ngx.print("") ngx.print("") ngx.print("") ngx.print("") ngx.say("") end ngx.say("
TimeHashSubjectAuthorEmail#(+)(-)GPG?
",utils.iso8601(commit.timestamp),"",commit.shorthash,"",commit.subject:gsub("<","<"),"",commit.author,"",commit.email,"",commit.diff.num,"commit.diff.minus and " style=\"color:green;font-weight:bold\"" or "",">",commit.diff.plus~=0 and commit.diff.plus or "","commit.diff.plus and " style=\"color:red;font-weight:bold\"" or "",">",commit.diff.minus~=0 and commit.diff.minus or "","",commit.gpggood,"
") ngx.say("
") ngx.say("

Files

") ngx.print("") ngx.print("") ngx.say("") local files = git.list_tree(repo, "@", "") local iconfolder = [[]] local iconfile = [[]] for i,v in pairs(files.dirs) do ngx.print("") ngx.print("") local lastedit = git.log(repo, "@ -1", v, 1, 0, false)[1] ngx.print("") ngx.print("") ngx.print("") ngx.say("") end for i,v in pairs(files.files) do ngx.print("") ngx.print("") local lastedit = git.log(repo, "@ -1", v, 1, 0, false)[1] ngx.print("") ngx.print("") ngx.print("") ngx.say("") end ngx.say("
ObjectLatest Commit SubjectTimeHash
",iconfolder,"",v,"",lastedit.subject,"",utils.iso8601(lastedit.timestamp),"",lastedit.shorthash,"
",iconfile,"",v,"",lastedit.subject,"",utils.iso8601(lastedit.timestamp),"",lastedit.shorthash,"
") ngx.say("

README

") local README = git.show_file(repo, "@", "README.md") ngx.say(utils.markdown(README)) ngx.say("
") ngx.say("") ngx.exit(ngx.HTTP_OK)