New CLI to Find Out Why the @*$% That Code Exists!

Written by steffitanner | Published 2017/09/18
Tech Story Tags: git | jira | programming | command-line

TLDRvia the TL;DR App

Have you ever uttered (or yelled) the words “Why the @*$% does this code exist?” Chances are, you probably have. Many times in a developer’s career, they will stumble upon code that just doesn’t make sense. What decisions led up to this code being here? Who decided this was the right way to solve the problem? Why, why, why?

There are plenty of ways to get more information about a specific line of code. You can easily run git blame that can show you the last person who touched the code and their commit message. You can run git history or git log to go further back into the history of a file or a section of code. You can even sort through years of historical data in your go-to project management system in the hopes of gleaning information about what was going on at the time. Many of these options take time, and developers are busy (and a little bit lazy). So, I’m introducing Tribe, a new command line interface to help you understand a little bit more about why that @*$%ing code exists.

Tribe gives you quick access to all of the relevant work items and issues across your git history. You already tie your work directly to your commits to make it easier during the deployment process. Now, we’re making it easy for you to understand the historical context of your current work.

tribe blame -L<start line>,<end line> <filename>

With this simple command, you can unlock both the git and the work history from either Jira or Agile Central. See who frequently contributes to this file, the ten last commits to the file or section, and the value that was being delivered at the time. Documentation around the work exists, but it’s extremely hard to navigate and sift through, hidden underneath years of cruft. We bring it to the surface.

Tribe is a first increment, and we’d love to make it better. Check out the github source here, and give us some feedback about what you find valuable and what you don’t. We know that you have additional use cases that we haven’t thought of and we’d love to hear about them. Perhaps there’s some information you’ve been dying to get quick access to. Submit a pull request if you have some ideas.

Our vision is to build a map of your codebase to help you and all developers understand the why behind every line of code. Help us on this journey!

Thanks for reading. If you enjoyed this article, please click and hold the 👏 to say “thanks!” and help others find this article.


Published by HackerNoon on 2017/09/18