From a8f7d182cd94ec1198ff3ef6c48909dcc7038d1a Mon Sep 17 00:00:00 2001 From: Jeremy Kaplan Date: Tue, 18 Mar 2025 16:06:04 -0400 Subject: [PATCH] gh: Add commit alias --- gh/config.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gh/config.yml b/gh/config.yml index 361fdef..db67ccf 100644 --- a/gh/config.yml +++ b/gh/config.yml @@ -12,4 +12,6 @@ aliases: co: > !(ref="$(gh pr view "$1" --json 'headRefName' --jq '.headRefName')" && git fetch-branch "$ref" && git switch "$ref") prw: pr view -w + commit: > + !(repo=$(gh repo view --json url --jq .url) && ref="${1-HEAD}" && commit=$(git rev-parse "$ref") && open "${repo}/commit/${commit}") version: "1"