{"id":42,"date":"2016-07-05T11:10:00","date_gmt":"2016-07-05T11:10:00","guid":{"rendered":"\/colin\/morethanfour\/post\/Git-Obtaining-a-useful-log-of-recent-check-ins"},"modified":"2016-07-05T11:10:00","modified_gmt":"2016-07-05T11:10:00","slug":"git-obtaining-a-useful-log-of-recent-check-ins","status":"publish","type":"post","link":"https:\/\/spacefold.com\/colin\/morethanfour\/2016\/07\/05\/git-obtaining-a-useful-log-of-recent-check-ins\/","title":{"rendered":"Git: Obtaining a useful log of recent check-ins"},"content":{"rendered":"<p>This is mostly for my own reference, so I don&#8217;t lose it.<\/p>\n<div id=\"codeSnippetWrapper\">\n<pre id=\"codeSnippet\" style=\"border-top-style: none; font-size: 8pt; overflow: visible; border-left-style: none; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4\">C:&gt; set path=C:\\Programs\\Git\\bin;%PATH%<br>C:&gt; D:<br>D:&gt; cd \/source_control\/ABACAB\/github\/zyxx_db<br>D:&gt; git log --name-status -10 &gt; last_ten_updates.txt<\/pre>\n<p><\/div>\n<p>So long as the current path is under the right repository directory, the <strong>git log<\/strong> command seems to pick up the right information, without being told what repository to interrogate.<\/p>\n<p>The output is useful, but the default formatting isn&#8217;t ideal. I&#8217;m not so interested in the git-svn-id or commit id. There&#8217;s a comprehensive list of options&#8230;<\/p>\n<p>Try:<\/p>\n<div id=\"codeSnippetWrapper\">\n<pre id=\"codeSnippet\" style=\"border-top-style: none; font-size: 8pt; overflow: visible; border-left-style: none; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4\">git log --name-status --pretty=format:<span style=\"color: #006080\">\"%cd - %cn : %s\"<\/span> --date=iso<\/pre>\n<p><\/div>\n<p>The results are close to what I&#8217;m used to with Subversion:<\/p>\n<div id=\"codeSnippetWrapper\">\n<pre id=\"codeSnippet\" style=\"border-top-style: none; font-size: 8pt; overflow: visible; border-left-style: none; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4\">2016-06-25 21:54:13 -0700 - Colin Nicholls : Synchronizing with latest SVN version<br>M zyxx\/db\/trunk\/DW\/DIRECT_DW.pkb<br>M zyxx\/db\/trunk\/DW\/SAMPLE_DATA.pck<br>:<br>M zyxx\/db\/trunk\/environments\/PROD\/db_build_UAT.config<br>M zyxx\/db\/trunk\/environments\/UAT\/db_build.config<br>  <br>2016-06-02 17:41:59 +0000 - cnicholls : Re-run previous report asynch; clear STATUS_TEXT on re-run<br>M zyxx\/db\/trunk\/RIX\/RIX.pck<br>  <br>2016-06-01 23:05:29 +0000 - cnicholls : Added V_Rix_Run_Log<br>M zyxx\/db\/trunk\/RIX\/create_views.sql<br> <br>2016-06-01 09:12:36 +0000 - fred : Prepare deployment <span style=\"color: #0000ff\">script<\/span>.<br>M zyxx\/db\/trunk\/deployment_scripts\/49\/during_DW.sql<br> <br>2016-06-01 02:27:39 +0000 - zeng : INH-1139: Offer Issue - DW Should handle the <span style=\"color: #006080\">\"Link\"<\/span> action <span style=\"color: #0000ff\">for<\/span> Tag. Fix bug.<br>M zyxx\/db\/trunk\/DW\/ABACAB_RI.pkb<\/pre>\n<p><\/div>\n<p>What I don&#8217;t yet know is why the most recent change has a time zone of &#8220;-0700&#8221; and the others &#8220;-0000&#8221;. It may have something to do with the way the previous entries were imported. Notice the committer name is different in the most recent check-in, which was the first one I did from my working copy, after the initial import.<\/p>\n<h3>Update<\/h3>\n<p>My current format of choice:<\/p>\n<div id=\"codeSnippetWrapper\">\n<pre id=\"codeSnippet\" style=\"border-top-style: none; font-size: 8pt; overflow: visible; border-left-style: none; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4\">git log --name-status --pretty=format:<span style=\"color: #006080\">\"%cd - %cn : %s\"<\/span> --reverse --date-order --date=local<\/pre>\n<p><\/div>\n<p>However, &#8220;local&#8221; doesn&#8217;t seem to mean &#8220;my local time zone&#8221;. So, not sure what the best date format is.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is mostly for my own reference, so I don&#8217;t lose it. C:&gt; set path=C:\\Programs\\Git\\bin;%PATH%C:&gt; D:D:&gt; cd \/source_control\/ABACAB\/github\/zyxx_dbD:&gt; git log &#8211;name-status -10 &gt; last_ten_updates.txt So long as the current path is under the right repository directory, the git log command seems to pick up the right information, without being told what repository to interrogate. The [&hellip;]<\/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":[],"class_list":["post-42","post","type-post","status-publish","format-standard","hentry","category-source-control","post-preview"],"_links":{"self":[{"href":"https:\/\/spacefold.com\/colin\/morethanfour\/wp-json\/wp\/v2\/posts\/42","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/spacefold.com\/colin\/morethanfour\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/spacefold.com\/colin\/morethanfour\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/spacefold.com\/colin\/morethanfour\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/spacefold.com\/colin\/morethanfour\/wp-json\/wp\/v2\/comments?post=42"}],"version-history":[{"count":0,"href":"https:\/\/spacefold.com\/colin\/morethanfour\/wp-json\/wp\/v2\/posts\/42\/revisions"}],"wp:attachment":[{"href":"https:\/\/spacefold.com\/colin\/morethanfour\/wp-json\/wp\/v2\/media?parent=42"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/spacefold.com\/colin\/morethanfour\/wp-json\/wp\/v2\/categories?post=42"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/spacefold.com\/colin\/morethanfour\/wp-json\/wp\/v2\/tags?post=42"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}