From 3084dc166b8dade44eb4d8f3dc0ee2ddb25a7ef6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Thu, 3 Dec 2020 17:46:04 +0100 Subject: style: use a better alias for "git reference" Since v2.25.0 of git you've been able to use this way of doing it. See git-vcs/git@1f0fc1db85 (pretty: implement 'reference' format, 2019-11-19). So let's use that example, and while I'm at it change the SHA-1 in the example here to the one that landed in the repo, not some pre-rebase version that was only in @pks-t's local repo. --- STYLE.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'STYLE.md') diff --git a/STYLE.md b/STYLE.md index f8fde112c..cfec09ccc 100644 --- a/STYLE.md +++ b/STYLE.md @@ -490,9 +490,9 @@ followed by the commit subject and the commit date. You may create an alias for this to have it easily available: ``` -$ git config alias.reference "log -1 --pretty='tformat:%h (%s, %ad)' --date=short" +$ git config alias.reference "show -s --pretty=reference" $ git reference HEAD -b981a648 (style: Document best practices for commit hygiene, 2020-11-20) +cf7f9ffe5 (style: Document best practices for commit hygiene, 2020-11-20) ``` ### Use interactive rebases to shape your commit series -- cgit v1.2.3