summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSZEDER Gábor <szeder@ira.uka.de>2015-10-07 18:28:25 +0200
committerJunio C Hamano <gitster@pobox.com>2015-10-07 10:56:07 -0700
commitb69e2e6344de05f9851201b4d52566670619908b (patch)
tree977592c109beb73f7d1d1a2700bf0bca5b538cce
parenta5481a6c9438cbd9c246cfa59ff49c31a0926fb6 (diff)
downloadgit-sg/pretty-more-date-mode-format.tar.gz
pretty: add format specifiers for short and raw date formatssg/pretty-more-date-mode-format
Other date formats already have their format specifiers and so should these, so they will be available in pretty format aliases as well. Signed-off-by: SZEDER Gábor <szeder@ira.uka.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--Documentation/pretty-formats.txt4
-rw-r--r--pretty.c6
2 files changed, 10 insertions, 0 deletions
diff --git a/Documentation/pretty-formats.txt b/Documentation/pretty-formats.txt
index dc865cbb27..f3f2024e51 100644
--- a/Documentation/pretty-formats.txt
+++ b/Documentation/pretty-formats.txt
@@ -120,6 +120,8 @@ The placeholders are:
- '%at': author date, UNIX timestamp
- '%ai': author date, ISO 8601-like format
- '%aI': author date, strict ISO 8601 format
+- '%as': author date, short format
+- '%aR': author date, raw format
- '%cn': committer name
- '%cN': committer name (respecting .mailmap, see
linkgit:git-shortlog[1] or linkgit:git-blame[1])
@@ -132,6 +134,8 @@ The placeholders are:
- '%ct': committer date, UNIX timestamp
- '%ci': committer date, ISO 8601-like format
- '%cI': committer date, strict ISO 8601 format
+- '%cs': committer date, short format
+- '%cR': committer date, raw format
- '%d': ref names, like the --decorate option of linkgit:git-log[1]
- '%D': ref names without the " (", ")" wrapping.
- '%e': encoding
diff --git a/pretty.c b/pretty.c
index 151c2ae312..e3ea2c03b0 100644
--- a/pretty.c
+++ b/pretty.c
@@ -723,6 +723,12 @@ static size_t format_person_part(struct strbuf *sb, char part,
case 'I': /* date, ISO 8601 strict */
strbuf_addstr(sb, show_ident_date(&s, DATE_MODE(ISO8601_STRICT)));
return placeholder_len;
+ case 's': /* date, short */
+ strbuf_addstr(sb, show_ident_date(&s, DATE_MODE(SHORT)));
+ return placeholder_len;
+ case 'R': /* date, raw */
+ strbuf_addstr(sb, show_ident_date(&s, DATE_MODE(RAW)));
+ return placeholder_len;
}
skip: