[PATCH 1/5] pretty: allow formatting DATE_SHORT

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



There's no way to do this short of "%ad" and --date=short,
but that limits you to having a single date format in the
output.

This would possibly be better done with something more like
"%ad(short)".

Signed-off-by: Jeff King <peff@xxxxxxxx>
---
 pretty.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/pretty.c b/pretty.c
index 493edb0..c532c17 100644
--- a/pretty.c
+++ b/pretty.c
@@ -727,6 +727,9 @@ 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':
+		strbuf_addstr(sb, show_ident_date(&s, DATE_MODE(SHORT)));
+		return placeholder_len;
 	}
 
 skip:
-- 
2.10.0.566.g5365f87




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]