commits.dcgi - gophercgis - Collection of gopher CGI/DCGI for geomyidae
 (HTM) hg clone https://bitbucket.org/iamleot/gophercgis
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
       commits.dcgi
       ---
            1 #!/bin/sh
            2 
            3 . ../common/config.sh
            4 
            5 ISSUE_CGI="${CGI_BASEDIR}/github/issue.dcgi"
            6 ISSUES_CGI="${CGI_BASEDIR}/github/issues.dcgi"
            7 COMMITS_CGI="${CGI_BASEDIR}/github/commits.dcgi"
            8 PULLS_CGI="${CGI_BASEDIR}/github/pulls.dcgi"
            9 PULL_CGI="${CGI_BASEDIR}/github/pull.dcgi"
           10 
           11 
           12 case "$2" in
           13 */*)
           14         owner=${2%%/*}
           15         repo=${2##*/}
           16         ;;
           17 *)
           18         exit 1
           19         ;;
           20 esac
           21 
           22 
           23 url="https://api.github.com/repos/${owner}/${repo}/commits"
           24 curl -Lgs -- "${url}" |
           25     jq -r '
           26     "t",
           27     "tGitHub - '"${owner}/${repo}"' commits",
           28     "t",
           29     ( .[] |
           30         "[h|\(.commit.message | gsub("\n"; " ") | gsub("\\|"; "\\|"))|" +
           31             "URL:\(.html_url).patch|server|port]",
           32         "t@\(.author.login) authored \(.commit.author.date[0:10])",
           33         "t@\(.committer.login) authored \(.commit.committer.date[0:10])",
           34         "t"
           35     )
           36 '