Skip to content

Instantly share code, notes, and snippets.

@datagrok
datagrok / git-branch-simplify.md
Last active December 22, 2023 14:46
How to simplify the graph produced by git log --graph

Ideas for improvements to git log --graph

I will maybe someday get around to dusting off my C and making these changes myself unless someone else does it first.

Make the graph for --topo-order less wiggly

Imagine a long-running development branch periodically merges from master. The git log --graph --all --topo-order is not as simple as it could be, as of git version 1.7.10.4.

It doesn't seem like a big deal in this example, but when you're trying to follow the history trails in ASCII and you've got several different branches displayed at once, it gets difficult quickly.

@seveas
seveas / gitconfig.sh
Created April 20, 2012 20:47
Git config from ldap (/etc/profile.d/gitconfig.sh)
# Set git user/email based on ldap values
test -x /usr/bin/git || return
test -x /usr/bin/ldapsearch || return
git config --global user.name > /dev/null || {
name=$(ldapsearch -x -LLL "(uid=$USER)" cn | sed -ne 's/^cn: //p')
test -n "$name" && git config --global user.name "$name"
}