Tag: log

How to use the arrows in the View History graphs in Visual Studio – 078

There was a saying back in Mountaineering Search and Rescue* in Seattle about why you should *never* pack cotton-based clothes in your cold-weather gear. It went like, “No matter how far down you pack cotton in your bag, water will find it.”  I feel the same about Visual Studio. “If there is a clickable pixel somewhere in Visual Studio, no matter how small or obscure you place it, I will find it.”

As I was prep’ing yesterday’s tip, I noticed that the View History graph showed these arrows pointing in various directions. TBH I had to ask someone to explain what the arrows meant.

Graph with arrows pointing down

If you click on this downward-facing arrow, a connector line will appear!

graph connecting line shown going offscreen

The connector line will go all the way down off screen until it reaches its commit.

connecting line reaching its commit

The idea behind these arrows is to show you that they connect to a commit that’s not currently visible on the screen.

BTW, the arrows can also point upwards as well, reaching back up to its counterpart in the graph.

arrows pointing in either direction

*So yeah, about search and rescue, well over 10 years ago, genius here wanted to volunteer to learn more about hiking and volunteer my time and whatever skills to helping out, since I love the outdoors so much. Only one small problem… I hate the cold! And I had never camped in the cold before, and at that time anything below 70 was considered cold to my NOLA standards. Anyways, it was 27 degrees one particular weekend of training. I made it the first night, but was never able to get to sleep. The second night I dropped out so my partner (who was kicking butt and taking names) could find other same skill-level people so she could pass. But yeah I still laugh at the thought of me thinking I could go find people lost in the woods when I get lost driving down the street!

How to view a git log graph from the command line that looks like Visual Studio View History – 076

It feels like there are 100 different ways to do a git log. Here’s one possible way… I’m using the OpenLiveWriter repo to demo since it has lots of branching going on.

P.S. The way to exit these log commands is to press ‘q’ when the colon appears, if you are following along at home.

let’s start with git log –graph.

git log --graph command line

But it’s too wordy to show the graph.

Let’s try git log –graph –pretty=oneline

git log --graph --pretty=oneline

Better, but the long commit IDs are throwing everything off.

Let’s try git log –graph –pretty=oneline –graph –abbrev-commit

git log --graph --pretty=oneline --graph --abbrev-commit

And that’s about as close as I can get to a graph that looks like the graph in Visual Studio.

If you know of a better way, please share with the group! 🙂