Git Rebase
This week in OSD-600, more git features were introduced to me, the main focus of the week and the lab is on the rebase feature of Git, this is an extremely powerful tool and what it is capable of doing is amazing. Once again, I was asked to modify the DLCheck tool project codes to further improve it, not only improvements in the codes, but also improvements in the git commit history.
To begin the improvement attempt, I took a close look into my project, and it didn't take long for me to find a couple issues. The first issue was obvious and I have thought about making this change for a while, that is to move some of the functions into an independent file instead of leaving them in index.js. Therefore, I created another file called displayMessage.js, moved the display message functions into that file and exported them using module.exports, now the index.js file looks cleaner and it still has access to those functions. The second change I made to the project is simply changing a variable name iList to ignoreList, this was used by my partner from the previous lab and I found it to be a little confusing, I read the code block for a bit and realized that it was a list of ignored objects, therefore the name was changed since it's more descriptive. The last change was changing one of the check conditions, the check condition used "==" instead of "===", this was also implemented by my previous lab partner, in my check conditions for command line arguments, I've used "===" for all, to keep the consistency, I changed his code to match my style.
After all the updates were committed, now it's the rebase part, the interactive rebase was easy to use, by using squash method, It was able to combine three different commits into one without any problem, this was amazing. After the commits were combined, I used "git commit -amend" to update the commit message and merged the updates into the master branch, then finally pushed the updates onto the origin on GitHub.
GitHub Commit: https://github.com/Wei-J-Huang/dlcheck/commit/8209ed617da49df6e059b7486de5ecbb10aac6f3
Comments
Post a Comment