login
Header Space

 
 

[PATCH 2/2] Wire new date formats to --date=<format> parser.

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <git@...>
Cc: Robin Rosenberg <robin.rosenberg@...>
Date: Saturday, July 14, 2007 - 2:43 am

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>
---
 revision.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/revision.c b/revision.c
index 27cce09..28b5f2e 100644
--- a/revision.c
+++ b/revision.c
@@ -1133,6 +1133,14 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch
 			if (!strncmp(arg, "--date=", 7)) {
 				if (!strcmp(arg + 7, "relative"))
 					revs->date_mode = DATE_RELATIVE;
+				else if (!strcmp(arg + 7, "iso8601") ||
+					 !strcmp(arg + 7, "iso"))
+					revs->date_mode = DATE_ISO8601;
+				else if (!strcmp(arg + 7, "rfc2822") ||
+					 !strcmp(arg + 7, "rfc"))
+					revs->date_mode = DATE_RFC2822;
+				else if (!strcmp(arg + 7, "short"))
+					revs->date_mode = DATE_SHORT;
 				else if (!strcmp(arg + 7, "local"))
 					revs->date_mode = DATE_LOCAL;
 				else if (!strcmp(arg + 7, "default"))
-- 
1.5.3.rc1.4.gaf83


-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] Support output ISO 8601 format dates, Robin Rosenberg, (Fri Jul 13, 4:22 pm)
Re: [PATCH] Support output ISO 8601 format dates, Jan Hudec, (Sun Jul 15, 5:23 pm)
Re: [PATCH] Support output ISO 8601 format dates, Robin Rosenberg, (Sun Jul 15, 7:19 pm)
Re: [PATCH] Support output ISO 8601 format dates, Linus Torvalds, (Sun Jul 15, 7:57 pm)
Re: [PATCH] Support output ISO 8601 format dates, Junio C Hamano, (Sun Jul 15, 6:14 pm)
Re: [PATCH] Support output ISO 8601 format dates, Junio C Hamano, (Fri Jul 13, 6:11 pm)
[PATCH] Support output ISO 8601 format dates, Robin Rosenberg, (Fri Jul 13, 7:00 pm)
[PATCH] Document new --date=&lt;format&gt;, Junio C Hamano, (Sat Jul 14, 2:49 am)
[PATCH 2/2] Wire new date formats to --date=<format> parser., Junio C Hamano, (Sat Jul 14, 2:43 am)
Re: [PATCH 2/2] Wire new date formats to --date=&lt;format&g..., Jan-Benedict Glaw, (Sat Jul 14, 2:44 am)
speck-geostationary