{"id":554,"date":"2024-08-14T14:57:36","date_gmt":"2024-08-14T06:57:36","guid":{"rendered":"https:\/\/thereisno.top:4430\/?p=554"},"modified":"2024-08-14T14:57:37","modified_gmt":"2024-08-14T06:57:37","slug":"git-log%e6%9f%a5%e7%9c%8b","status":"publish","type":"post","link":"https:\/\/thereisno.top\/?p=554","title":{"rendered":"Git log\u67e5\u770b"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u68c0\u67e5\u67d0\u4eba\u63d0\u4ea4\u6587\u4ef6<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">git log &#8211;author=&#8221;wangxingjing&#8221;&nbsp; &#8211;stat<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6309\u5173\u952e\u8bcd\u641c\u7d22<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><mark style=\"background-color:#fcb900\" class=\"has-inline-color\">git log &#8211;grep=comment\u6ce8\u91ca\u7684\u5173\u952e\u8bcd<\/mark><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\/\/ \u67e5\u8be2\u6240\u6709\u63d0\u4ea4\u8005<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">git log &#8211;since ==2018-12-25 &#8211;until=2019-09-28 &#8211;format=&#8217;%aN&#8217; | sort -u |<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">while read name;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;do echo -en &#8220;$name\\t&#8221;;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;git log &#8211;author=&#8221;$name&#8221; &#8211;pretty=tformat: &#8211;numstat | awk &#8216;{ add += $1; subs += $2; loc += $1 + $2 } END { printf &#8220;added lines: %s, removed lines: %s, total lines: %s\\n&#8221;, add, subs, loc }&#8217; -;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Done<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\/\/\u5355\u884c\u683c\u5f0f<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">git log &#8211;since ==2018-12-25 &#8211;until=2019-09-28 &#8211;format=&#8217;%aN&#8217; | sort -u | while read name;do echo -en &#8220;$name\\t&#8221;;git log &#8211;author=&#8221;$name&#8221; &#8211;pretty=tformat: &#8211;numstat | awk &#8216;{ add += $1; subs += $2; loc += $1 + $2 } END { printf &#8220;added lines: %s, removed lines: %s, total lines: %s\\n&#8221;, add, subs, loc }&#8217; -; done<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\/\/-\u8868\u793a\u4e0a\u4e00\u4e2a\u8fc7\u7a0b\u7684\u8f93\u51fa<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\/\/ \u67e5\u8be2\u5355\u4eba<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">git log &#8211;since=2018-09-01 &#8211;until=2019-09-28 &#8211;author=&#8221;author-name&#8221; &#8211;pretty=tformat: &#8211;numstat<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;| gawk &#8216;{ add += $1 ; subs += $2 ; loc += $1 &#8211; $2 } END { printf &#8220;added lines: %s removed lines : %s total lines: %s\\n&#8221;,add,subs,loc }&#8217; &#8211;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u9ed8\u8ba4\u4e0d\u7528\u4efb\u4f55\u53c2\u6570\u7684\u8bdd\uff0cgit log \u4f1a\u6309\u63d0\u4ea4\u65f6\u95f4\u5217\u51fa\u6240\u6709\u7684\u66f4\u65b0\uff0c\u6700\u8fd1\u7684\u66f4\u65b0\u6392\u5728\u6700\u4e0a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&#8211;pretty \u9009\u9879\uff0c\u53ef\u4ee5\u6307\u5b9a\u4f7f\u7528\u5b8c\u5168\u4e0d\u540c\u4e8e\u9ed8\u8ba4\u683c\u5f0f\u7684\u65b9\u5f0f\u5c55\u793a\u63d0\u4ea4\u5386\u53f2\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">format\uff0c\u53ef\u4ee5\u5b9a\u5236\u8981\u663e\u793a\u7684\u8bb0\u5f55\u683c\u5f0f\uff0c\u8fd9\u6837\u7684\u8f93\u51fa\u4fbf\u4e8e\u540e\u671f\u7f16\u7a0b\u63d0\u53d6\u5206\u6790\uff0c\u50cf\u8fd9\u6837\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;$ git log &#8211;pretty=format:&#8221;%h &#8211; %an, %ar : %s&#8221;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">ca82a6d &#8211; Scott Chacon, 11 months ago : changed the version number<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">085bb3b &#8211; Scott Chacon, 11 months ago : removed unnecessary test code<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">a11bef0 &#8211; Scott Chacon, 11 months ago : first commit<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e0b\u8868\u5217\u51fa\u4e86\u5e38\u7528\u7684\u683c\u5f0f\u5360\u4f4d\u7b26\u5199\u6cd5\u53ca\u5176\u4ee3\u8868\u7684\u610f\u4e49\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"668\" height=\"535\" src=\"https:\/\/thereisno.top\/wp-content\/uploads\/2024\/08\/image-37.png\" alt=\"\" class=\"wp-image-557\" srcset=\"https:\/\/thereisno.top\/wp-content\/uploads\/2024\/08\/image-37.png 668w, https:\/\/thereisno.top\/wp-content\/uploads\/2024\/08\/image-37-300x240.png 300w\" sizes=\"auto, (max-width: 668px) 100vw, 668px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u5e38\u7528\u7684\u683c\u5f0f\u5360\u4f4d\u7b26<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">git log \u547d\u4ee4\u652f\u6301\u7684\u5e38\u7528\u9009\u9879\u53ca\u5176\u91ca\u4e49\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"663\" height=\"427\" src=\"https:\/\/thereisno.top\/wp-content\/uploads\/2024\/08\/image-38.png\" alt=\"\" class=\"wp-image-556\" srcset=\"https:\/\/thereisno.top\/wp-content\/uploads\/2024\/08\/image-38.png 663w, https:\/\/thereisno.top\/wp-content\/uploads\/2024\/08\/image-38-300x193.png 300w\" sizes=\"auto, (max-width: 663px) 100vw, 663px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u9009\u9879\u53ca\u91ca\u4e49<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">git log\u5e38\u7528\u641c\u7d22\u6761\u4ef6<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"668\" height=\"535\" src=\"https:\/\/thereisno.top\/wp-content\/uploads\/2024\/08\/image-37.png\" alt=\"\" class=\"wp-image-555\" srcset=\"https:\/\/thereisno.top\/wp-content\/uploads\/2024\/08\/image-37.png 668w, https:\/\/thereisno.top\/wp-content\/uploads\/2024\/08\/image-37-300x240.png 300w\" sizes=\"auto, (max-width: 668px) 100vw, 668px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>\u68c0\u67e5\u67d0\u4eba\u63d0\u4ea4\u6587\u4ef6 git log &#8211;author=&#8221;wangxingjing&#038;#822 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/thereisno.top\/?p=554\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">\u201cGit log\u67e5\u770b\u201d<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15],"tags":[2],"class_list":["post-554","post","type-post","status-publish","format-standard","hentry","category-git","tag-git"],"_links":{"self":[{"href":"https:\/\/thereisno.top\/index.php?rest_route=\/wp\/v2\/posts\/554","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thereisno.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thereisno.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thereisno.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/thereisno.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=554"}],"version-history":[{"count":1,"href":"https:\/\/thereisno.top\/index.php?rest_route=\/wp\/v2\/posts\/554\/revisions"}],"predecessor-version":[{"id":558,"href":"https:\/\/thereisno.top\/index.php?rest_route=\/wp\/v2\/posts\/554\/revisions\/558"}],"wp:attachment":[{"href":"https:\/\/thereisno.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=554"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thereisno.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=554"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thereisno.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=554"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}