Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH] _git: add support for more pretty format specifiers
- X-seq: zsh-workers 54091
- From: Arseny Maslennikov <ar@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Cc: Arseny Maslennikov <ar@xxxxxxxxx>
- Subject: [PATCH] _git: add support for more pretty format specifiers
- Date: Mon, 17 Nov 2025 18:02:20 +0300
- Archived-at: <https://zsh.org/workers/54091>
- List-id: <zsh-workers.zsh.org>
The specifiers are taken from the git-log(1) man page.
The %[ac]h specifier matches the behaviour of git rev-list --date=human.
---
Arguably the most useful are %as (%cs), which prints author (committer)
date in "short" YYYY-MM-DD format, and %ah (%ch), which somewhat mimics
GNU ls. I use them occasionally and forget the exact spelling, so
it'd be nice to see them in the completion menu.
Completion/Unix/Command/_git | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
index 93275124d..89f78ecb3 100644
--- a/Completion/Unix/Command/_git
+++ b/Completion/Unix/Command/_git
@@ -8270,12 +8270,16 @@ __git_format_placeholders() {
N:'name (use .mailmap)'
e:'email'
E:'email (use .mailmap)'
+ l:'email local part'
+ L:'email local part (use .mailmap)'
d:'date'
D:'date, RFC2822 style'
r:'date, relative'
t:'date, UNIX timestamp'
i:'date, like ISO 8601'
I:'date, strict ISO 8601'
+ s:'date, YYYY-MM-DD'
+ h:'date, human'
)
placeholders=( $match[1]$^placeholders )
else
--
2.51.0
Messages sorted by:
Reverse Date,
Date,
Thread,
Author