introduce "format" date-mode

This feeds the format directly to strftime. Besides being a
little more flexible, the main advantage is that your system
strftime may know more about your locale's preferred format
(e.g., how to spell the days of the week).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Jeff King
2015-06-25 12:55:45 -04:00
committed by Junio C Hamano
parent a5481a6c94
commit aa1462cc3d
8 changed files with 61 additions and 1 deletions

View File

@ -344,6 +344,11 @@ extern void strbuf_commented_addf(struct strbuf *sb, const char *fmt, ...);
__attribute__((format (printf,2,0)))
extern void strbuf_vaddf(struct strbuf *sb, const char *fmt, va_list ap);
/**
* Add the time specified by `tm`, as formatted by `strftime`.
*/
extern void strbuf_addftime(struct strbuf *sb, const char *fmt, const struct tm *tm);
/**
* Read a given size of data from a FILE* pointer to the buffer.
*