Re-roll of 'human' date format patch set
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v4 Latest5 patches 0 repliesNew
- v3 posting 2/25 patches 1 replySuperseded
- v3 posting 1/25 patches 2 repliesSuperseded
Earlier versions · 2
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v2 | 5 patches | 7 replies | Superseded | |
| v1 | 3 patches | 18 replies | Superseded |
Patches in v4 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/5 | Add 'human' date formatbuiltin/ cache.h date.c | +115 | 0 replies | |
| 2/5 | Replace the proposed 'auto' mode with 'auto:'date.c | +8 | 0 replies | |
| 3/5 | Add 'human' date format documentationDocumentation/ Documentation/ | +11 | 0 replies | |
| 4/5 | Add `human` format to test-toolcache.h date.c t/ +1 more | +33 | 0 replies | |
| 5/5 | Add `human` date format tests.t/ | +18 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v4 yet.
Cover letter [PATCH v4 0/5] Re-roll of 'human' date format patch set
Changed the binary and test to rename TEST_DATE_NOW environment variable. Changed the 'human' test to test_i18ncmp.
Updates for the relative date format will be done in a follow-on patch.
Range-diff relative to v3:
1: ee75d9002d = 1: ee75d9002d Add 'human' date format
2: 722c3319cd = 2: 722c3319cd Replace the proposed 'auto' mode with 'auto:'
3: 67cb73edb4 = 3: 67cb73edb4 Add 'human' date format documentation
4: 1562e7c713 ! 4: a3f6f820b2 Add `human` format to test-tool
@@ -2,15 +2,19 @@
Add `human` format to test-tool
- Add the human format support to the test tool so that TEST_DATE_NOW
- can be used to specify the current time.
+ Add the human format support to the test tool so that
+ GIT_TEST_DATE_NOW can be used to specify the current time.
The get_time() helper function was created and and checks the
- TEST_DATE_NOW environment variable. If TEST_DATE_NOW is set, then
- that date is used instead of the date returned by by gettimeofday().
+ GIT_TEST_DATE_NOW environment variable. If GIT_TEST_DATE_NOW is set,
+ then that date is used instead of the date returned by by
+ gettimeofday().
All calls to gettimeofday() were replaced by calls to get_time().
+ Renamed occurances of TEST_DATE_NOW to GIT_TEST_DATE_NOW since the
+ variable is now used in the get binary and not just in the test-tool.
+
diff --git a/cache.h b/cache.h
--- a/cache.h
+++ b/cache.h
@@ -35,7 +39,7 @@
+{
+ const char *x;
+
-+ x = getenv("TEST_DATE_NOW");
++ x = getenv("GIT_TEST_DATE_NOW");
+ if (x) {
+ now->tv_sec = atoi(x);
+ now->tv_usec = 0;
@@ -110,6 +114,15 @@
static void show_dates(const char **argv, const char *format)
{
struct date_mode mode;
+@@
+ struct timeval now;
+ const char *x;
+
+- x = getenv("TEST_DATE_NOW");
++ x = getenv("GIT_TEST_DATE_NOW");
+ if (x) {
+ now.tv_sec = atoi(x);
+ now.tv_usec = 0;
@@
usage(usage_msg);
if (!strcmp(*argv, "relative"))
@@ -119,3 +132,20 @@
else if (skip_prefix(*argv, "show:", &x))
show_dates(argv+1, x);
else if (!strcmp(*argv, "parse"))
+
+ diff --git a/t/t0006-date.sh b/t/t0006-date.sh
+ --- a/t/t0006-date.sh
+ +++ b/t/t0006-date.sh
+@@
+ . ./test-lib.sh
+
+ # arbitrary reference time: 2009-08-30 19:20:00
+-TEST_DATE_NOW=1251660000; export TEST_DATE_NOW
++GIT_TEST_DATE_NOW=1251660000; export GIT_TEST_DATE_NOW
+
+ check_relative() {
+- t=$(($TEST_DATE_NOW - $1))
++ t=$(($GIT_TEST_DATE_NOW - $1))
+ echo "$t -> $2" >expect
+ test_expect_${3:-success} "relative date ($2)" "
+ test-tool date relative $t >actual &&
5: 5e6b5705fd ! 5: 87d3a81e8a Add `human` date format tests.
@@ -19,11 +19,11 @@
check_approxidate '2009-12-01' '2009-12-01 19:20:00'
+check_date_format_human() {
-+ t=$(($TEST_DATE_NOW - $1))
++ t=$(($GIT_TEST_DATE_NOW - $1))
+ echo "$t -> $2" >expect
+ test_expect_success "human date $t" '
-+ test-tool date human $t >actual &&
-+ test_cmp expect actual
++ test-tool date human $t >actual &&
++ test_i18ncmp expect actual
+'
+}
+Linus Torvalds (1):
Add 'human' date format
Stephen P. Smith (4):
Replace the proposed 'auto' mode with 'auto:'
Add 'human' date format documentation
Add human format to test-tool
Add human date format tests.
Documentation/git-log.txt | 4 + Documentation/rev-list-options.txt | 7 ++ builtin/blame.c | 4 + cache.h | 3 + date.c | 148 ++++++++++++++++++++++++----- t/helper/test-date.c | 13 ++- t/t0006-date.sh | 22 ++++- 7 files changed, 176 insertions(+), 25 deletions(-)
Signature · 1 line
2.20.1.2.gb21ebb671b