[PATCH 1/2] git-log (internal): add approxidate.
From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:20
Subsystem:
the rest · Maintainer:
Linus Torvalds
Next will be the pretty-print format. Signed-off-by: Junio C Hamano <redacted> --- Linus Torvalds [off-list ref] writes: > I didn't add the logic for --before/--after flags, but that should be > pretty trivial, and is independent of this anyway. > > Perhaps more importantly, I didn't remove the tests that now start > failing, nor did I remove the actual code to do --merge-order ;/ I've done the janitorial, and have two more on top. Here is the first one. I'd appreciate comments on the second one. revision.c | 20 ++++++++++++++++++++ 1 files changed, 20 insertions(+), 0 deletions(-) 2eba658eaffdf4c5c9d0767b49e4c27d7281cda6
diff --git a/revision.c b/revision.c
index c84f146..4885871 100644
--- a/revision.c
+++ b/revision.c@@ -492,6 +492,26 @@ int setup_revisions(int argc, const char revs->limited = 1; continue; } + if (!strncmp(arg, "--since=", 8)) { + revs->max_age = approxidate(arg + 8); + revs->limited = 1; + continue; + } + if (!strncmp(arg, "--after=", 8)) { + revs->max_age = approxidate(arg + 8); + revs->limited = 1; + continue; + } + if (!strncmp(arg, "--before=", 9)) { + revs->min_age = approxidate(arg + 9); + revs->limited = 1; + continue; + } + if (!strncmp(arg, "--until=", 8)) { + revs->min_age = approxidate(arg + 8); + revs->limited = 1; + continue; + } if (!strcmp(arg, "--all")) { handle_all(revs, flags); continue;
--
1.2.3.g9425