Skip to main content

Don't worry about commit message

 

Starting...

This lab is to practice about the advanced skills on git such as rebase, squashing, and amend. What I had done before I learned this way to handle my incorrect committed message was like that, just doing reset and doing it again. I can say that I really love this skill especially about rebase and interactive amend mode.

Progressing...

Actually, This task is very simple and I understand the main purpose is not refactoring my code, but using the advanced git skills for my future journal in the code world. With the instruction of osd600, I made 3 commit messages to try to rebase for squashing three messages.

pick b77bdc5 applied three refactoring like used function, getting rid of global variables and removing duplicated regex and rename the methods
squash 28059dd got rid of global variables
squash 66e551b removed duplicated regex and rename the methods

# Rebase 367104a..66e551b onto 367104a (3 commands)
#
# Commands:
# p, pick = use commit
# r, reword = use commit, but edit the commit message
# e, edit = use commit, but stop for amending
# s, squash = use commit, but meld into previous commit
# f, fixup = like "squash", but discard this commit's log message
# x, exec = run command (the rest of the line) using shell
# d, drop = remove commit
#
# These lines can be re-ordered; they are executed from top to bottom.
#
# If you remove a line here THAT COMMIT WILL BE LOST.
#
# However, if you remove everything, the rebase will be aborted.
#
# Note that empty commits are commented out


My log message after rebase.

The good thing is that after rebasing my all of commit messages with squashing,  I also can modify my commit message with the command, git commit --amend, which is modifying the last commit message.
Refactoring http-parser to improve code maintainability:

  * used function instead of variable
  * got rid of global variables
  * removed duplicated regex and rename the methods

# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# Date:      Fri Oct 23 00:38:43 2020 -0400
#
# On branch refactoring-duplication
# Your branch and 'origin/refactoring-duplication' have diverged,
# and have 1 and 3 different commits each, respectively.
#   (use "git pull" to merge the remote branch into yours)
#
# Changes to be committed:
modified:   index.js
modified:   service/fileService.js
#

My log message after amend

Conclusion

To be honest, for me, understanding the concept of this advanced git lab part is less difficult than the fetch one. Actually, I love this feature of git since it provides a lot of less work than the one I did like using reset, forced push and so on. 

Comments

Popular posts from this blog

Getting more difficult?

  Release 0.2.4 Now I am at almost the end of release 0.2 and I chose the telescope as the final contribution. To be honest, this is huge, well organized and great project and it is first time to take a look. Unlike my previous assignment during the previous terms, there are tons of what I have never seen. First, docker compose is great and the document for contribution is very clear. Of course, I had no idea when read it first, but every time as my professor mentioned, there was a great guy, helper?, helping me a lot to set up the project. Although I had no idea about Elastic-search and Redis-cache server, I was happy to take a time to look though the codes and to understand. Again, trying to understand an issue is always hard for me and sometimes I am really not happy when somebody does not understand my question. This happened again. The reason why I attached the picture is that I am still confused about the whole process of this project especially about why frontend didn't get ...

Finally, release my first open source.

  Starting... This lab is to release my product to install easily. Instead of cloning or downloading and setting it up manually, it provides a lot of convenience for users to install it. I chose NPM since I used nodejs. NPM  is a great site to help develpers to release their git repository in the site.  Progressing... First, I signed up on npmjs.com and logged in the site on the console to release my repository. I had to set up a lot of things like 'npm init', modifying readme and package.json to be ready.  Second, I tried to release my repository by the command, 'npm publish --access public'. Unfortunately, the name, http-parser, was already taken, so I needed to change my name. I chose my name as http-checker and tried to release it again. At this time, I got 403, forbidden error. I spent a lot of time to figure out but it was actually due to not verified account. Once I got the verified email account, finally, I got the release version of my repository. Here is my...

Elastic search and more

  Release 0.3.1 Now it is time to learn what is Elastic search since the chosen issue is about adding more fields for our model in telescope.  This is very new for me so I was very scared when I started to work for this but now I think I am more confident. First, Elastic search is such a great supportive database especially for index search. The good thing is that it is not only the index search for whole value but, partial keyword as well. Of course, it may be wrong since I also just started to study it. Anyway, It was very careful when I read codes one line by one. Following the official document ,  I tried to add some fields, but it made some test failed so I needed to fix them. The below content is from the official document: Mapping edit Mapping is the process of defining how a document, and the fields it contains, are stored and indexed. For instance, use mappings to define: which string fields should be treated as full text fields. which fields contain numbers, dat...