This week's post is a few days late, and will be shorter than usual.
My Project: ctil
- Issue 5, Horizontal Break Conversion: https://github.com/rjwignar/ctil/issues/5
- Issue 7, Code Block Conversion: https://github.com/rjwignar/ctil/issues/7
In my Open Source class, we had another lab exercise designed to give us experience working on parallel branches and merging branches. This exercise would ultimately give experience in the following:
- creating many branches to work on new features and fix bugs
- working on many code changes in parallel on separate topic branches
- adding features to existing code
- fixing merge conflicts
- finding and identifying commits on GitHub
For the exercise, we had to work on adding two separate features to our project in parallel branches. For my project, ctil, I decided to add the following Markdown-to-HTML conversion features:
- Horizontal Break Conversion
- Code Block Conversion
I also wanted to add support for a language flag that would modify the lang attribute on the root
<html> element of generated HTML documents, but decided to work on it another time as I am still trying to implement flag support.
For this exercise I worked on each feature one at a time. Implementing the above conversion features was manageable, largely because I was able to implement similar logic provided by a classmate who contributed to ctil earlier.
Properly merging both branches into my main branch was a challenge. The initial
fast-forward merge of the Horizontal Break conversion was successful and did not give any issues. However, merging my second addition required a
three-way recursive, which was a little challenging. The features I wanted to add were different, but I think because the additions were made to the same files that merge conflicts arose. This was an issue because I wanted to accept both sets of code while preserving the integrity of both additions inside the main branch (without changing the code order of any method) Although
Visual Studio 2022 provides a Merge Editor to help resolve conflicts, I was unable to accept both sets of code without properly reserving my added methods. If the merge conflict involved code that a colleague wrote, I would have aborted the merge attempt and reattempted it with the colleague around. However, since I wrote all the code involved and knew what the code should look like and do, I decided to accept the three-way recursive merge and manually fix the broken code (available at a36c6bd).