X-Git-Url: http://git.pjr.cc/?p=gwvp-mini.git;a=blobdiff_plain;f=gwvpmini%2Fgwvpmini_gitrepo.php;fp=gwvpmini%2Fgwvpmini_gitrepo.php;h=01a686214312df67156dc307f2bcc8c40e4774f6;hp=e20532eae9dbefa0e10607629d2bc8b61fbf9852;hb=c05c510242a32b196d0c943a36f2514075e3e73d;hpb=f4aa66bfa1ab7c6de7ee8e043384e50b6948ca00 diff --git a/gwvpmini/gwvpmini_gitrepo.php b/gwvpmini/gwvpmini_gitrepo.php index e20532e..01a6862 100644 --- a/gwvpmini/gwvpmini_gitrepo.php +++ b/gwvpmini/gwvpmini_gitrepo.php @@ -351,5 +351,48 @@ function gwvpmini_CompressCommitId($cid) return $compressedcid; } + +function gwvpmini_GetCommitDetail($repo, $commitid) +{ + global $cmd_line_tool,$git_cli_cmd,$php_cli_cmd; + + $repo_base = gwvpmini_getConfigVal("repodir"); + + $cmd = "$cmd_line_tool --git-dir=$repo_base/$repo.git log $commitid -1 --format='%an'"; + exec($cmd, $commitername, $returnvar); + + $cmd = "$cmd_line_tool --git-dir=$repo_base/$repo.git log $commitid -1 --format='%ae'"; + exec($cmd, $commiteremail, $returnvar); + + $cmd = "$cmd_line_tool --git-dir=$repo_base/$repo.git log $commitid -1 --format='%ct'"; + exec($cmd, $commitertime, $returnvar); + + $cmd = "$cmd_line_tool --git-dir=$repo_base/$repo.git log $commitid -1 --format='%s'"; + exec($cmd, $commiterlog, $returnvar); + + $cmd = "$cmd_line_tool --git-dir=$repo_base/$repo.git log $commitid -1 --format='%b'"; + exec($cmd, $commiterbody, $returnvar); +} + +function gwvpmini_GetCommitList($repo, $branch, $num=20) +{ + global $cmd_line_tool,$git_cli_cmd,$php_cli_cmd; + + $repo_base = gwvpmini_getConfigVal("repodir"); + + $cmd = "$cmd_line_tool --git-dir=$repo_base/$repo.git log $commitid -1 --format='%an'"; + exec($cmd, $commitername, $returnvar); + +} + +function gwvpmini_GetRefList($repo) +{ + global $cmd_line_tool,$git_cli_cmd,$php_cli_cmd; + + $repo_base = gwvpmini_getConfigVal("repodir"); + + $cmd = "$cmd_line_tool --git-dir=$repo_base/$repo.git for-each-ref $commitid --format='%(objecttype):%(objectname):%(refname)'"; + exec($cmd, $reflist, $returnvar); +} ?> \ No newline at end of file