Skip to content

Commit af66366

Browse files
dschogitster
authored andcommitted
Teach approxidate() to understand "never"
If you want to keep the reflogs around for a really long time, you should be able to say so: $ git config gc.reflogExpire never Now it works, too. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 7b69b87 commit af66366

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

date.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -660,6 +660,14 @@ static void date_am(struct tm *tm, int *num)
660660
tm->tm_hour = (hour % 12);
661661
}
662662

663+
static void date_never(struct tm *tm, int *num)
664+
{
665+
tm->tm_mon = tm->tm_wday = tm->tm_yday
666+
= tm->tm_hour = tm->tm_min = tm->tm_sec = 0;
667+
tm->tm_year = 70;
668+
tm->tm_mday = 1;
669+
}
670+
663671
static const struct special {
664672
const char *name;
665673
void (*fn)(struct tm *, int *);
@@ -670,6 +678,7 @@ static const struct special {
670678
{ "tea", date_tea },
671679
{ "PM", date_pm },
672680
{ "AM", date_am },
681+
{ "never", date_never },
673682
{ NULL }
674683
};
675684

0 commit comments

Comments
 (0)