diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2024-05-24 19:18:11 +0000 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2024-05-24 19:18:11 +0000 |
commit | ff7ed8f586589d620a806c3758fac4a47a8e7e15 (patch) | |
tree | 729bbcb92231538fa61dab6c3d890b025484b7f5 /scripts/git-log-pretty-since.sh | |
parent | 376914f419eb08fdf4c1a63a77e1f035898a0f10 (diff) | |
parent | 28c04948a1c887a1cc0cb64de79fa32631700466 (diff) | |
download | rneovim-ff7ed8f586589d620a806c3758fac4a47a8e7e15.tar.gz rneovim-ff7ed8f586589d620a806c3758fac4a47a8e7e15.tar.bz2 rneovim-ff7ed8f586589d620a806c3758fac4a47a8e7e15.zip |
Merge remote-tracking branch 'upstream/master' into mix_20240309
Diffstat (limited to 'scripts/git-log-pretty-since.sh')
-rwxr-xr-x | scripts/git-log-pretty-since.sh | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/scripts/git-log-pretty-since.sh b/scripts/git-log-pretty-since.sh deleted file mode 100755 index 95dcee23f5..0000000000 --- a/scripts/git-log-pretty-since.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/usr/bin/env bash - -# Prints a nicely-formatted commit history. -# - Commits are grouped below their merge-commit. -# - Issue numbers are moved next to the commit-id. -# -# Parameters: -# $1 "since" commit -# $2 "inverse match" regex pattern - -set -e -set -u -set -o pipefail - -__SINCE=$1 -__INVMATCH=$2 - -is_merge_commit() { - git rev-parse "$1" >/dev/null 2>&1 \ - || { echo "ERROR: invalid commit: $1"; exit 1; } - git log "$1"^2 >/dev/null 2>&1 && return 0 || return 1 -} - -# Removes parens from issue/ticket/PR numbers. -# -# Example: -# in: 3340e08becbf foo (#9423) -# out: 3340e08becbf foo #9423 -_deparen() { - sed 's/(\(\#[0-9]\{3,\}\))/\1/g' -} - -# Cleans up issue/ticket/PR numbers in the commit descriptions. -# -# Example: -# in: 3340e08becbf foo (#9423) -# out: 3340e08becbf #9423 foo -_format_ticketnums() { - nvim -Es +'g/\v(#[0-9]{3,})/norm! ngEldE0ep' +'%p' | _deparen -} - -for commit in $(git log --format='%H' --first-parent "$__SINCE"..HEAD); do - if is_merge_commit "${commit}" ; then - if [ -z "$__INVMATCH" ] || ! git log --oneline "${commit}^1..${commit}^2" \ - | >/dev/null 2>&1 grep -E "$__INVMATCH" ; then - git log -1 --oneline "${commit}" - git log --format=' %h %s' "${commit}^1..${commit}^2" - fi - else - git log -1 --oneline "${commit}" - fi -done | _format_ticketnums |