Hacker News new | past | comments | ask | show | jobs | submit login

A few slightly better aliases with graphs on the left:

lg50 = "!git log --graph --abbrev-commit --date=relative --pretty=format:'%x00%h%x00%s%x00%cd%x00%an%x00%d' | gawk -F '\\0' '{ printf \"%s\\033[31m%s\\033[0m %-50s \\033[32m%14s\\033[0m \\033[30;1m%s\\033[0m\\033[33m%s\\n\", $1, $2, gensub(/(.{49}).{2,}/, \"\\\\1…\",\"g\",$3), $4, $5, $6 }' | less -R"

lg80 = "!git log --graph --abbrev-commit --date=relative --pretty=format:'%x00%h%x00%s%x00%cd%x00%an%x00%d' | gawk -F '\\0' '{ printf \"%s\\033[31m%s\\033[0m %-80s \\033[32m%14s\\033[0m \\033[30;1m%s\\033[0m\\033[33m%s\\n\", $1, $2, gensub(/(.{79}).{2,}/, \"\\\\1…\",\"g\",$3), $4, $5, $6 }' | less -R"

Note: i've been using them for some time, i don't even remember who was the original source...

On an unrelated note, does someone remember how to add code sections? :)




I got them from here: http://pyrtsa.posterous.com/aligning-your-git-logs (which also has the list-not-graph versions).

[Which is what I was going to comment, but you beat me to it.]


Try indenting by a few spaces (I think it is four).


Two spaces.


When I use these the commit comment lines are not truncated. Is this the normal behavior ?


Sadly, yes..




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: