Week 6
Redemption
In continuation from my 4th week’s blog, this is a chance to re-acquaint myself with Git workflow – more advanced than last time. And this time, I shall not fail. Or will I? We shall see.
The dreaded task
The task is simple.
- Fork your teammate’s repo
- Make changes and push it
- When they do the same, merge them and resolve any conflicts.
At first glance, it seems overtly simple. However, keep in mind that I am a complete beginner in all this and I have never done something as strenuous as resolving merge conflicts. I mean, how do you even decide which changes to keep? What about indentation?
Being Pushy
After many hours of procrastination, I decided to ask a teammate on how to proceed with the assignment in a text message. He warned me about the merge conflicts and the general style of the code. Additionally, he mentioned a bug resulting from a typo in the original repository.
I decided that it would be best to fork everyone’s repository first and pull the changes made to my repository afterwards. “This would be easier to do, if the previous assignment is any indication”, I thought to myself. So, in true fashion, I forked Chocolate-Spaghet, johncgenere and gutierrezjdr’s repositories. Then I added a corny oddity in the English language from a list, per the instruction. I very quickly made the allotted changes and issued pull requests. Whilst making the changes on my forks, I noticed that all of them had already accepted pull requests from the other teammates who were punctual – this helped with the indentation and styling of my contributions as well.
Pull it up!
I was not about to fail this time. My brilliant teammates had already made sure that the pull requests arrived on time to my repository – I just had to accept them. I decided that it would be best if I made my own edits to my repository before accepting changes from the pull requests. So I made my change and pushed the commit onto master
. Thence, I looked at my good friend Chocolate-Spaghet’s pull request. It was nicely done and I followed the command line instructions to take it down to my local machine, test it using the provided makefile and make a merge commit. I proceeded to make sure Github recognized that his pull request was merged. Alas. I mucked it up again – when I downloaded the pull request onto my machine, I gave it a different branch name from the one Github required for automatic merge detection. Sorry, mate. It appears you’ll be my guinea pig.
After that painful lesson and Chocolate-Spaghet’s sacrifice, I made sure to accurately merge all the pull-requests after testing them thoroughly. As I was doing the assignment, I had an epiphany that I should have had from all the readings – branching is so convenient on git. “I’ll make sure to use this all the time”, I thought.