Merging isn't bad
Tags: opensource
Published: 2021-10-01 20:47:08

I'll be honest - I looked at lab 3 the day before the due date. I didn't realize it actually existed. Forgot. Anyways, today I expected a lot of struggles and there were none. I'm not sure if I was very lucky, or it wasn't supposed to be hard.

I decided to add 3 out of 4 features, since all 3 I knew exactly how to implement. Besides, the more you do - the more experience you get. 

### [Language support](https://github.com/sirinoks/SSGNode/pull/25/commits/c1e5c4f1260c2bcab1825f2c6076c0b5742623c5)
...was probably the most complex one, however it used the same tools I already implemented before. [Adding more options for parameters](https://github.com/sirinoks/SSGNode/pull/25/commits/c1e5c4f1260c2bcab1825f2c6076c0b5742623c5#diff-e727e4bdf3657fd1d798edcd6b099d6e092f8573cba266154583a746bba0f346R240-R243), [catching that extra parameter](https://github.com/sirinoks/SSGNode/pull/25/commits/c1e5c4f1260c2bcab1825f2c6076c0b5742623c5#diff-e727e4bdf3657fd1d798edcd6b099d6e092f8573cba266154583a746bba0f346R204-R211), [adding it to the actual generated page](https://github.com/sirinoks/SSGNode/pull/25/commits/c1e5c4f1260c2bcab1825f2c6076c0b5742623c5#diff-e727e4bdf3657fd1d798edcd6b099d6e092f8573cba266154583a746bba0f346L103-R104).. that's it. Wasn't tough at all. And that was the toughest of the three!

### [Exit codes](https://github.com/sirinoks/SSGNode/pull/26/commits/41a214cbafed94770cb480c3e6cea49033b4c602)
It's literally one line. I looked for a place where my program gets to if it runs properly and put exit(0) there.

Now, why is it just this line? Well, you see, I have just worked on another feature, or, rather... [issue](https://github.com/sirinoks/SSGNode/issues/17). Before this I tried to fix it along with two other ones: [default paths](https://github.com/sirinoks/SSGNode/issues/16), [callbacks](https://github.com/sirinoks/SSGNode/issues/13). I took on too many tasks and when in the end nothing worked - my code became too spaghetti to really understand where my problem was. I had to delete the branch and start over from master. That's how I learned to instead tackle one problem at a time. 

So I [tried again](https://github.com/sirinoks/SSGNode/pull/21). This time only caring about error handling and general structure improvements. I'm not sure if I did it right. I added a shit ton of try{}catch with custom messages. Idk if I overdid them. It makes my code much less readable for me, maybe I'm just not used to it. I also placed my functions in order of their calls. So you can follow the program easier... Hopefully. Here's the [result](https://github.com/sirinoks/SSGNode/pull/21/commits/7829353fd1a0839348f6f660cf1bac88996ccb73).

After fixing that issue where I already added exit codes (-1) to try{}catch blocks, the only one left to add was exit(0). 

### [hr support](https://github.com/sirinoks/SSGNode/issues/24)
My partner for lab 2 used a different [approach](https://github.com/sirinoks/SSGNode/commit/3317d95fcb453b7b130015e67800f1f8c9b9bc6c#diff-e727e4bdf3657fd1d798edcd6b099d6e092f8573cba266154583a746bba0f346R64-R65) to handle .md files. So any code in that area has a different style. I decided to follow that same style, since I learned to tackle things one by one. I might get back to this and re-structure it for my taste, however it's not even required. It would be just for the sake of style continuity. Technically, it's just [one line](https://github.com/sirinoks/SSGNode/commit/3317d95fcb453b7b130015e67800f1f8c9b9bc6c#diff-e727e4bdf3657fd1d798edcd6b099d6e092f8573cba266154583a746bba0f346R65) again, however I decided to change my [hr css](https://github.com/sirinoks/SSGNode/commit/3317d95fcb453b7b130015e67800f1f8c9b9bc6c#diff-380b7b38760dd442e897eb0164c58f6a17da966ccaca6318017a468c163979b1R33-R35), since you couldn't see the default one.

One place where I actually messed up - I created issue branches from another branch, instead of master. So I had to delete them and re-create again.

## No conflicts??
I think this lab was supposed to show me how to resolve merge conflicts. However, I never got any. It auto merged just fine. I have dealt with some conflicts in lab 2 I think.. So I somewhat know what to do. I think it auto merged well becacuse I already did my [error handling and structure improvements](https://github.com/sirinoks/SSGNode/pull/21/commits/7829353fd1a0839348f6f660cf1bac88996ccb73) before starting those other issues. 
Here are those 3 successful merges: 
* [Language support](https://github.com/sirinoks/SSGNode/pull/25)
* [Exit code](https://github.com/sirinoks/SSGNode/pull/26)
* [hr support](https://github.com/sirinoks/SSGNode/pull/27)

Look at how nice they slid in my master. Oh yeah.