From 135d59f37cd49f8a57f7404893a0477d1b29154e Mon Sep 17 00:00:00 2001 From: Sanchayan Maity Date: Tue, 16 Jul 2024 19:52:20 +0530 Subject: [PATCH] fish: functions/gl: Fix object ID ambiguous error 7 digit hash is sometimes not enough to correctly show the commit. --- fish/.config/fish/functions/gl.fish | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fish/.config/fish/functions/gl.fish b/fish/.config/fish/functions/gl.fish index de74031..46e6cc1 100644 --- a/fish/.config/fish/functions/gl.fish +++ b/fish/.config/fish/functions/gl.fish @@ -4,7 +4,7 @@ function gl --description 'Git browse commits' return 0 end - set -l log_line_to_hash "echo {} | grep -o '[a-f0-9]\{7\}' | head -1" + set -l log_line_to_hash "echo {} | grep -o '[a-f0-9]\{9\}' | head -1" set -l view_commit "$log_line_to_hash | xargs -I % sh -c 'git show --color=always % | bat -ldiff'" set -l view_commit_nvim "$log_line_to_hash | xargs -I % sh -c 'git show %'" set -l copy_commit_hash "$log_line_to_hash | wl-copy"