{"id":137,"date":"2019-03-06T09:35:21","date_gmt":"2019-03-06T01:35:21","guid":{"rendered":"http:\/\/adeqing.com\/?p=137"},"modified":"2019-03-06T09:39:37","modified_gmt":"2019-03-06T01:39:37","slug":"git%e4%bb%a3%e7%a0%81%e8%a1%8c%e7%bb%9f%e8%ae%a1%e5%91%bd%e4%bb%a4%e9%9b%86","status":"publish","type":"post","link":"https:\/\/adeqing.com\/index.php\/2019\/03\/06\/default\/137\/","title":{"rendered":"git\u4ee3\u7801\u884c\u7edf\u8ba1\u547d\u4ee4\u96c6"},"content":{"rendered":"<div>\n<h2>\u67e5\u770bgit\u4e0a\u4e2a\u4eba\u4ee3\u7801\u91cf<\/h2>\n<\/div>\n<blockquote>\n<pre>git log --author=\"username\" --pretty=tformat: --numstat | awk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf \"added lines: %s, removed lines: %s, total lines: %s\\n\", add, subs, loc }' -<\/pre>\n<\/blockquote>\n<div>\n<h2>\u7edf\u8ba1\u6bcf\u4e2a\u4eba\u7684\u589e\u5220\u884c\u6570<\/h2>\n<blockquote>\n<pre>git log --format='%aN' | sort -u | while read name; do echo -en \"$name\\t\"; git log --author=\"$name\" --pretty=tformat: --numstat | awk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf \"added lines: %s, removed lines: %s, total lines: %s\\n\", add, subs, loc }' -; done<\/pre>\n<\/blockquote>\n<h2>\u67e5\u770b\u4ed3\u5e93\u63d0\u4ea4\u8005\u6392\u540d\u524d 5<\/h2>\n<blockquote>\n<pre>git log --pretty='%aN' | sort | uniq -c | sort -k1 -n -r | head -n 5<\/pre>\n<\/blockquote>\n<h2>\u8d21\u732e\u8005\u7edf\u8ba1\uff1a<\/h2>\n<blockquote>\n<pre>git log --pretty='%aN' | sort -u | wc -l<\/pre>\n<\/blockquote>\n<h2>\u63d0\u4ea4\u6570\u7edf\u8ba1\uff1a<\/h2>\n<blockquote>\n<pre>git log --oneline | wc -l<\/pre>\n<\/blockquote>\n<h2>\u6dfb\u52a0\u6216\u4fee\u6539\u7684\u4ee3\u7801\u884c\u6570\uff1a<\/h2>\n<blockquote>\n<pre>\r\n<del>git log --stat|perl -ne 'END { print $c } $c += $1 if \/(\\d+) insertions\/;<\/del><\/pre>\n<\/blockquote>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u67e5\u770bgit\u4e0a\u4e2a\u4eba\u4ee3\u7801\u91cf git log &#8211;author=&#8221;username&#8221; &#8211;pretty=tforma [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/adeqing.com\/index.php\/wp-json\/wp\/v2\/posts\/137"}],"collection":[{"href":"https:\/\/adeqing.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/adeqing.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/adeqing.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/adeqing.com\/index.php\/wp-json\/wp\/v2\/comments?post=137"}],"version-history":[{"count":4,"href":"https:\/\/adeqing.com\/index.php\/wp-json\/wp\/v2\/posts\/137\/revisions"}],"predecessor-version":[{"id":141,"href":"https:\/\/adeqing.com\/index.php\/wp-json\/wp\/v2\/posts\/137\/revisions\/141"}],"wp:attachment":[{"href":"https:\/\/adeqing.com\/index.php\/wp-json\/wp\/v2\/media?parent=137"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/adeqing.com\/index.php\/wp-json\/wp\/v2\/categories?post=137"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/adeqing.com\/index.php\/wp-json\/wp\/v2\/tags?post=137"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}