DEV Community

Bryce Seefieldt
Bryce Seefieldt

Posted on

Refactoring and Rebasing

This week was a great opportunity to reflect on the work that myself and others have been contributing to ez-txt2html.

After a month and change of adding features with the help of some open-sourse officianados, it was time to refactor and practice using the powerful interactive rebase git functionality.

Working within time constraints to implement new features, there was no shortage of issues to address in this refactoring session.

  • I started with an overall cleanup of all the formatting and logiv suggestions that have been suggested by insightful contributors. This predominantly focused on style adherance and eliminating some of the lingering debug print lines that served their purpose but needed to go.

  • Next I worked on code splitting, taking the opportunity to create some modules that would group some of the utility functions into their own files and cleaning up the main program.

  • I also took a minute to extract functions to eliminate repetitive code, which streamlined a few of the exisiting functions.

  • Finally, I took a walk through and made sure comments were present where needed and revised some of the commentary based on recent changes and new functionality.

I wrapped all of this work up with an interactive rebase git rebase main -i and used the squash option to combine all the commits associated with the above refactoring. This gave me one solid commit to --amend with a concise message listing all the commited changes, which I could then push to my upstream master.

Now that I have a little more comfort with rebase, amemnd and merge, the history of the repo is way easier to follow and work with.

Top comments (0)