DEV Community

Cover image for Working on Different Branches in Parallel
dbelokon
dbelokon

Posted on

Working on Different Branches in Parallel

For this lab I continued my contribution to glazed-donut. I have learned a couple of new commands. One of them was to create a new branch:

git branch branchName
Enter fullscreen mode Exit fullscreen mode

I also learned how to checkout (aka changing/going to) to a specific branch:

git checkout branchName
Enter fullscreen mode Exit fullscreen mode

It was super cool to see how we can work on same branches at the same time. The process of it was effortless, just type in one command and you are good to go😋😎 I also had no idea that Visual Studio IDE had a merging conflict editor! Woah!

New Features

Feature 1: --lang

This time, I've added two features for Glazed-Donut. It now supports the --lang (or simply -l) command, where you can specify a language tag (ex: fr-CA for Canadian French) and it will set the lang attribute in the generated HTML files to whatever value you put. By default, it will set the lang attribute to en-CA. It is done so that the browser can know what language the contents of the file are, and how it can better interpret them.

Implementation Thought Process for --lang

The way I approached the implementation was that I added a new command to ArgumentParser and then modified the HTML skeleton that I was generating by adding the lang attribute and a placeholder for its value.

Feature 2: <hr>

Another feature I've implemented was supporting the horizontal rule in Markdown files. Basically how the program works now is that whenever it finds 3 or more dashes surrounded by empty spaces, it will replace them with the <hr> element in the generated HTML file(s).

Implementation Thought Process for <hr>

Then, I changed the parsing algorithm for markdown files so that I could identify whether a line had only 3 dashes or more while allowing white spaces before or after them.

Merging Process

The first feature got merged without any conflicts. Everything failed when I was trying to merge the second feature. I had merging conflicts in my README.md file. There was also a conflict in the Program.cs file because it couldn't figure out what line of code to choose. In my case, I just had to choose what lines I wanted from both sides and remove the one that was no longer relevant to the updated code. Luckily, all the merge conflicts (ad2b74c) were resolved successfully.

The End

Overall it was nice to see how powerful Git, GitHub, and Visual Studio are for software development. It was amazing to learn more about each of these tools.

Top comments (0)