Skip to content

Commit b727a23

Browse files
committed
Wire new date formats to --date=<format> parser.
Now we can use all internally supported date formats with git log --date=<format> syntax. Earlier, we only allowed relative/local/default. Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 73013af commit b727a23

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

revision.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1133,6 +1133,14 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch
11331133
if (!strncmp(arg, "--date=", 7)) {
11341134
if (!strcmp(arg + 7, "relative"))
11351135
revs->date_mode = DATE_RELATIVE;
1136+
else if (!strcmp(arg + 7, "iso8601") ||
1137+
!strcmp(arg + 7, "iso"))
1138+
revs->date_mode = DATE_ISO8601;
1139+
else if (!strcmp(arg + 7, "rfc2822") ||
1140+
!strcmp(arg + 7, "rfc"))
1141+
revs->date_mode = DATE_RFC2822;
1142+
else if (!strcmp(arg + 7, "short"))
1143+
revs->date_mode = DATE_SHORT;
11361144
else if (!strcmp(arg + 7, "local"))
11371145
revs->date_mode = DATE_LOCAL;
11381146
else if (!strcmp(arg + 7, "default"))

0 commit comments

Comments
 (0)