{"id":17,"date":"2021-06-08T14:49:11","date_gmt":"2021-06-08T14:49:11","guid":{"rendered":"https:\/\/blogs.scummvm.org\/twan\/?p=17"},"modified":"2021-06-20T12:55:34","modified_gmt":"2021-06-20T12:55:34","slug":"first-day-of-gsoc-not-what-i-have-expected","status":"publish","type":"post","link":"https:\/\/blogs.scummvm.org\/twan\/2021\/06\/08\/first-day-of-gsoc-not-what-i-have-expected\/","title":{"rendered":"First day of GSoC: Not what I have expected"},"content":{"rendered":"\n<p>After reading my blog, criezy generously suggested that I took time learning git commands and even discussed with him. Sev also repasted <a href=\"https:\/\/git-scm.com\/book\/en\/v2\" data-type=\"URL\" data-id=\"https:\/\/git-scm.com\/book\/en\/v2\">the git pro book<\/a>, and suggested that the first 3 chapter would do. So basically, although I thought is was not a good idea to resolve something like this at <em>the very first day<\/em> of GSoC coding period, that&#8217;s what I did. Read the docs.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The Surprise<\/h2>\n\n\n\n<p>What&#8217;s amazing was it was actually useful. Very useful. Much effective than what I have expected. Probably because after finding out how to do it with the GUI, there is no pressure on me that I cannot commit something (although I would have to give every file a separate commit). It was also probably because it was the right time to read the git pro book. Compared to the me 2 months ago, it&#8217;s kind of different after 32  &#8220;<code>git add &amp;&amp; git commit -m \"GRIFFON: Commit message\" &amp;&amp; git push<\/code> &#8220;es.<\/p>\n\n\n\n<p>So after griffon I can understand the first three chapters of git pro. The magic is, after git pro, I understand the tutorial <a href=\"https:\/\/app.pluralsight.com\/course-player?clipId=0e31d18b-7060-47e3-b053-e1f7e947973c\" data-type=\"URL\" data-id=\"https:\/\/app.pluralsight.com\/course-player?clipId=0e31d18b-7060-47e3-b053-e1f7e947973c\">how git works<\/a> (the tutorial I have been watching since the <a href=\"https:\/\/blogs.scummvm.org\/twan\/2021\/06\/05\/the-last-weekend-before-coding-period-starts\/\" data-type=\"URL\" data-id=\"https:\/\/blogs.scummvm.org\/twan\/2021\/06\/05\/the-last-weekend-before-coding-period-starts\/\">weekend<\/a>). <\/p>\n\n\n\n<p>It&#8217;s astonishing how my understanding went from 1% to 90% (and imagine that I regarded that 1% of learning as some highly recommended material, and you would understand what I went through). As if the language the lecturer was speaking had changed. (From something like French to English, while I recognize like 150 vocabularies of the former language, and will only understand anything typed on the terminal, shown in the animation, or demonstrated non-verbally.)<br><br>Git is amazing in the way it is both simple and not easy at the same time. I feel git is something most people get only by playing with and studying for a period of time. That&#8217;s why it is not introduced to google docs or any other things. I wish we had that. No more &#8220;duplicate files&#8221;, &#8220;All changes saved to drive&#8221;, &#8220;Oh we have a conflict pick a version!&#8221;.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Small Notes<\/h2>\n\n\n\n<p>Below are some notes to what I have learned from git. <\/p>\n\n\n\n<p>The funny thing is that what you &#8220;know&#8221; before and after you &#8220;really know&#8221; is the same. It feels dump yet magical as I look at what I type. <br><br><strong>Git exists <\/strong>for this purpose<br>To manage files that are similar but not the same. To edit while keep tracking, separately or together, and unifying versions when we want to.<br><br><strong>Existing files have this problem<\/strong><br>There is only space to store the file content, but no one is responsible for tracking changes &#8211; git is responsible and accomplishes it by hashing and matching lines to detect change<br><br><strong>commit <\/strong>&#8211; a change<br><strong>branch <\/strong>&#8211; a series of changes. The current branch tracks new commits. <br><strong>head <\/strong>&#8211; a pointer to the branch that is tracking new commits<br><br><strong>switch<\/strong> &#8211; change the branch the head is pointing at. Your working directory and its content are changed to the lastest commit at that branch<br><strong>merge<\/strong> &#8211; combine changes by manually resolving conflicts<br><strong>rebase<\/strong> &#8211; change the base of a branch. Specify a branch A to be rebased and branch B to be rebased to. Starting from the place the the files&#8217; content diverge, move branch A to following after branch B<br><strong>merge and rebase<\/strong> are used for similar purposes but work differently. If you use merge you will need to resolve conflict. If you use rebase you will need to . If you rebase a commit that has been updated to the internet, things get screwed up.<\/p>\n\n\n\n<p>(beginners can ignore these three for a while, just know that check-out is like switch because it&#8217;s often referred)<br><strong>*check-out<\/strong> &#8211; everything in switch, but including checking out a commit. When you checkout a commit, nothing strange happens, but that it doesn&#8217;t belong to a branch. You can make a series of commits, just like in a branch. However, you cannot come back to the series of commits once you switch back to a real branch, and the commits are lost when a garbage collector comes by, unless you switch back in time, and created a branch (surely, check-out is not a bug, must be another killing feature)<br>*<strong>fast-forward<\/strong> &#8211; you have already done the merge\/rebase, go to merged\/rebased place<br>*<strong>tag<\/strong> &#8211; branch that doesn&#8217;t update once it is created (same comment as check-out)<br><br><strong>remote copy<\/strong> &#8211; taylorzhancher\/scummvm. Not to be confused with local copy (files on the computer)<br><strong>origin<\/strong> &#8211; the default name of a remote copy (every copy is a remote copy) on the local copy<br><strong>fetch<\/strong> &#8211; get the branches from the internet to local copy<br><strong>pull<\/strong> &#8211; fetch then merge<\/p>\n\n\n\n<p><strong>upstream <\/strong>&#8211; the default name the main repository on the local copy<\/p>\n\n\n\n<p><code>git config --global pull.rebase true<\/code>  make <code>git pull<\/code> do fetch then rebase instead<\/p>\n\n\n\n<p><br><strong>Some questions to answer in the future<\/strong><br>So what if we do a rebase, and go back to branch A, then do a merge? Does a fast forward happen?<br>Not clear with what is a change. How do you define two lines as the same? Is delete considered a change? If so, what if I propose a blank file to merge with a new one? What happens when I try to merge an unrelated file to a repository?<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Good things take times<\/h2>\n\n\n\n<p>While studying, it was pretty irritating to see the time ticking, and nothing done except something referred as &#8220;the second quadrant activity&#8221; in <em>The Seven Habits of Highly Effective People<\/em> &#8211; Things that are important but not urgent, and are usually the long term things that counts the most but gets ignored.<\/p>\n\n\n\n<p>For some reason, the feeling was especially prominent during the last chapter of git pro and the last half an hour of how git works. I wanted to tell myself it&#8217;s only a few minutes left, and still I had to rewatch or re-read it a few times because I kept losing my attention. Maybe the excitement of understanding documentation that I hardly comprehend before was wearing off, more likely because I can&#8217;t help thinking what to do next. <\/p>\n\n\n\n<p>I do understand though, after taking and looking at the notes, that I have a lot to learn, even though it&#8217;s the basics, and I have put so much time in it. Happy developing.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Another Surprise<\/h2>\n\n\n\n<p>Sev reviewed my code, so I have something to commit today without making progress on finding secret code to specifying GUI options on the sci engine. After publishing this post I will be typing command to my terminal and praying that they will work. Then I will make commits to fix the code, hopefully. (Actually no hope. Uggh!!)<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Final words<\/h2>\n\n\n\n<p>Although I haven&#8217;t fully seen the impact of blockchain in anything else than crypto, here is a good example of hashing and tracking.<\/p>\n\n\n\n<p>I think it&#8217;s just beautiful.<\/p>\n\n\n\n<p><br><\/p>\n","protected":false},"excerpt":{"rendered":"<p>After reading my blog, criezy generously suggested that I took time learning git commands and even discussed with him. Sev also repasted the git pro book, and suggested that the first 3 chapter would do. So basically, although I thought is was not a good idea to resolve something like this at the very first &#8230; <a title=\"First day of GSoC: Not what I have expected\" class=\"read-more\" href=\"https:\/\/blogs.scummvm.org\/twan\/2021\/06\/08\/first-day-of-gsoc-not-what-i-have-expected\/\">Read more<span class=\"screen-reader-text\">First day of GSoC: Not what I have expected<\/span><\/a><\/p>\n","protected":false},"author":9,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[6,11],"class_list":["post-17","post","type-post","status-publish","format-standard","hentry","category-codingprogress","tag-dreamweb","tag-laurabow2"],"_links":{"self":[{"href":"https:\/\/blogs.scummvm.org\/twan\/wp-json\/wp\/v2\/posts\/17","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.scummvm.org\/twan\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.scummvm.org\/twan\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.scummvm.org\/twan\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.scummvm.org\/twan\/wp-json\/wp\/v2\/comments?post=17"}],"version-history":[{"count":4,"href":"https:\/\/blogs.scummvm.org\/twan\/wp-json\/wp\/v2\/posts\/17\/revisions"}],"predecessor-version":[{"id":107,"href":"https:\/\/blogs.scummvm.org\/twan\/wp-json\/wp\/v2\/posts\/17\/revisions\/107"}],"wp:attachment":[{"href":"https:\/\/blogs.scummvm.org\/twan\/wp-json\/wp\/v2\/media?parent=17"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.scummvm.org\/twan\/wp-json\/wp\/v2\/categories?post=17"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.scummvm.org\/twan\/wp-json\/wp\/v2\/tags?post=17"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}