From 479bc17a4a62dfaefb0179edab74aeb58f95ce53 Mon Sep 17 00:00:00 2001 From: Paul Irish Date: Tue, 1 Jul 2025 11:50:28 -0700 Subject: [PATCH 1/2] adapt cmds to be more cross-shell compatible --- git-recent | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/git-recent b/git-recent index 927ede2..1c41699 100755 --- a/git-recent +++ b/git-recent @@ -33,9 +33,10 @@ commits_format="%C(red bold)%h %C(bold blue)%an %C(bold green)%ad %Creset%s" # TODO: some branch mgmt approaches don't work well with this. And may prefer `git log --pretty=format:%H --merges -n 1`. See https://github.com/paulirish/git-recent/issues/28 diff_base=$(cat $(git rev-parse --show-cdup).git/refs/remotes/origin/HEAD | awk '{print $2}') -uniqcommits_cmd="branch_name=\$(echo {1} | cut -d' ' -f1) git log --date=human --color=always --format='$commits_format' --no-merges $diff_base..\$branch_name" +# the cut drops anything after the branch name, like the Chromium link. These commands need to work in all shells (bash, fish, etc) +uniqcommits_cmd="git log --date=human --color=always --format='$commits_format' --no-merges $diff_base..\$(echo {1} | cut -d' ' -f1)" +diffbranch_cmd="git diff --color=always $diff_base...\$(echo {1} | cut -d' ' -f1)" -diffbranch_cmd="branch_name=\$(echo {1} | cut -d' ' -f1) git diff --color=always $diff_base...\$branch_name" # Progressive enhancement if you have delta or diff-so-fancy if command -v delta >/dev/null 2>&1; then diffbranch_cmd="$diffbranch_cmd | delta" From 6322cde317a477f9bf0c566c0adbfd48a8428539 Mon Sep 17 00:00:00 2001 From: Paul Irish Date: Fri, 4 Jul 2025 11:26:14 -0700 Subject: [PATCH 2/2] 2.0.4 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0f0878d..ea08667 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "git-recent", - "version": "2.0.2", + "version": "2.0.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "git-recent", - "version": "2.0.2", + "version": "2.0.4", "license": "MIT", "bin": { "git-recent": "git-recent" diff --git a/package.json b/package.json index 9c43fa5..658dd78 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "git-recent", - "version": "2.0.2", + "version": "2.0.4", "description": "List recent git branches, select one for checkout. See branch commits and diffs, all formatted so fancy", "bin": { "git-recent": "git-recent",