path: root/builtin/rev-list.c
diff options
authorJohannes Schindelin <>2017-04-21 10:45:48 (GMT)
committerJunio C Hamano <>2017-04-24 03:19:15 (GMT)
commitcb71f8bdb5a105cd5b66142b887989d9addc82d0 (patch)
treee5d673bfdd396ebfc6fb0957a86dd532c25e995b /builtin/rev-list.c
parent1aeb7e756c82d31e46712ec7557c4cbae37dccd9 (diff)
PRItime: introduce a new "printf format" for timestamps
Currently, Git's source code treats all timestamps as if they were unsigned longs. Therefore, it is okay to write "%lu" when printing them. There is a substantial problem with that, though: at least on Windows, time_t is *larger* than unsigned long, and hence we will want to switch away from the ill-specified `unsigned long` data type. So let's introduce the pseudo format "PRItime" (currently simply being defined to "lu") to make it easier to change the data type used for timestamps. Signed-off-by: Johannes Schindelin <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'builtin/rev-list.c')
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/rev-list.c b/builtin/rev-list.c
index bcf77f0..3b292c9 100644
--- a/builtin/rev-list.c
+++ b/builtin/rev-list.c
@@ -80,7 +80,7 @@ static void show_commit(struct commit *commit, void *data)
if (info->show_timestamp)
- printf("%lu ", commit->date);
+ printf("%"PRItime" ", commit->date);
if (info->header_prefix)
fputs(info->header_prefix, stdout);