git: 2c2f741363a9 - main - mfc-candidates: Improve hash expansion

From: Ed Maste <emaste_at_FreeBSD.org>
Date: Sat, 16 Nov 2024 14:57:15 UTC
The branch main has been updated by emaste:

URL: https://cgit.FreeBSD.org/src/commit/?id=2c2f741363a9dde7b855b05785b36d6d979c97ae

commit 2c2f741363a9dde7b855b05785b36d6d979c97ae
Author:     Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2024-11-15 21:29:50 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2024-11-16 14:56:07 +0000

    mfc-candidates: Improve hash expansion
    
    `git rev-parse` is the canonical way to turn a short hash (or other
    commit-ish) into a full hash.
    
    Sponsored by:   The FreeBSD Foundation
---
 tools/tools/git/mfc-candidates.lua | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/tools/git/mfc-candidates.lua b/tools/tools/git/mfc-candidates.lua
index b29f1ad4d121..d2865a892971 100755
--- a/tools/tools/git/mfc-candidates.lua
+++ b/tools/tools/git/mfc-candidates.lua
@@ -77,7 +77,7 @@ local function read_exclude(filename)
 			-- Hashes are 40 chars; if less, expand short hash.
 			if #hash < 40 then
 				hash = exec_command(
-				    "git show --pretty=%H --no-patch " .. hash)
+				    "git rev-parse " .. hash)
 			end
 			table.insert(content, hash)
 		end