A small shell function which linkifies git log output.
Modified from Ben Almans github version

  • drupalcode.org commit link
  • drupalcode.org blob links
  • drupal.org issue link if the commit message is formatted as Issue #123456

Example of linkified git log

# Git log with per-commit clickable Drupalcode URLs.
# @see https://github.com/cowboy/dotfiles/commit/78fde838a

function gdl() {
  local remote="$(git remote -v | awk '/^origin.*\(push\)$/ {print $2}')"
  [[ "$remote" ]] || return
  local repo="${remote##*/}"
  git log $* --name-status --color | awk "$(cat <<AWK
    /^.*commit [0-9a-f]+/ { sha=substr(\$2,1,7); printf "%s\thttp://drupalcode.org/project/$repo/commit/%s\033[0m\n", \$1, sha; next }
    /^.*Issue #[0-9]+/ { print; issue=substr(\$2,2); printf "\thttps://drupal.org/node/%s\n", issue; next }
    /^[MA]\t/ { printf "%s\thttp://drupalcode.org/project/$repo/blob/%s:/%s\n", \$1, sha, \$2; next }
    /.*/ {print \$0}
AWK
  )" | less -R
}

Note! This has only been tested on Ubuntu. I have a slight feeling less -R might not exist on osx.