Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
# 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.