Friday, December 25, 2015

Git one liners

Here is my collection of git commands that saved my day, I hope it will also save yours

Q: What's the freaking branch with that commit number?
A: git branch --contains commit#.
Applicability: You're overwhelmed with bugfix branches, alternating between half a dozen, while awaiting for your reviewers' comments. Naturally, you get their feedback and as always, there is  something to make better. Just when you're inclined to do so, you realize that you don't even remember what local branch your commit was in.
What to do if it is not there? Fear not, the twin sister git branch -r --contains commit# is here to the rescue.
Having found your remote branch, now run
git remote show 'remote-repo'
if no local branch is tracking the remote one with your commit, then you must have created it from another git project. That was my problem anyways.

Functional Java: Hate the player not the game

We've all heard it over and over, Java 8 is not really functional programming. I admit that features like tail call optimization, closu...