From: John Keeping <john@keeping.me.uk>
To: git@vger.kernel.org
Cc: Jeff King <peff@peff.net>, Junio C Hamano <gitster@pobox.com>,
John Keeping <john@keeping.me.uk>
Subject: [PATCH v2 4/6] t6300: make UTC and local dates different
Date: Tue, 1 Sep 2015 22:55:42 +0100 [thread overview]
Message-ID: <ea99176ca84d865e22fa09afd38d2495e0837b67.1441144343.git.john@keeping.me.uk> (raw)
In-Reply-To: <cover.1441144343.git.john@keeping.me.uk>
In-Reply-To: <cover.1441144343.git.john@keeping.me.uk>
By setting the UTC time to 23:18:43 the date in +0200 is the following
day, 2006-07-04. This will ensure that the test for "short-local" to be
added in a following patch tests for different output from the "short"
format.
Signed-off-by: John Keeping <john@keeping.me.uk>
---
t/t6300-for-each-ref.sh | 48 ++++++++++++++++++++++++------------------------
1 file changed, 24 insertions(+), 24 deletions(-)
diff --git a/t/t6300-for-each-ref.sh b/t/t6300-for-each-ref.sh
index 5fdb964..9e0096f 100755
--- a/t/t6300-for-each-ref.sh
+++ b/t/t6300-for-each-ref.sh
@@ -8,8 +8,8 @@ test_description='for-each-ref test'
. ./test-lib.sh
. "$TEST_DIRECTORY"/lib-gpg.sh
-# Mon Jul 3 15:18:43 2006 +0000
-datestamp=1151939923
+# Mon Jul 3 23:18:43 2006 +0000
+datestamp=1151968723
setdate_and_increment () {
GIT_COMMITTER_DATE="$datestamp +0200"
datestamp=$(expr "$datestamp" + 1)
@@ -61,21 +61,21 @@ test_atom head object ''
test_atom head type ''
test_atom head '*objectname' ''
test_atom head '*objecttype' ''
-test_atom head author 'A U Thor <author@example.com> 1151939924 +0200'
+test_atom head author 'A U Thor <author@example.com> 1151968724 +0200'
test_atom head authorname 'A U Thor'
test_atom head authoremail '<author@example.com>'
-test_atom head authordate 'Mon Jul 3 17:18:44 2006 +0200'
-test_atom head committer 'C O Mitter <committer@example.com> 1151939923 +0200'
+test_atom head authordate 'Tue Jul 4 01:18:44 2006 +0200'
+test_atom head committer 'C O Mitter <committer@example.com> 1151968723 +0200'
test_atom head committername 'C O Mitter'
test_atom head committeremail '<committer@example.com>'
-test_atom head committerdate 'Mon Jul 3 17:18:43 2006 +0200'
+test_atom head committerdate 'Tue Jul 4 01:18:43 2006 +0200'
test_atom head tag ''
test_atom head tagger ''
test_atom head taggername ''
test_atom head taggeremail ''
test_atom head taggerdate ''
-test_atom head creator 'C O Mitter <committer@example.com> 1151939923 +0200'
-test_atom head creatordate 'Mon Jul 3 17:18:43 2006 +0200'
+test_atom head creator 'C O Mitter <committer@example.com> 1151968723 +0200'
+test_atom head creatordate 'Tue Jul 4 01:18:43 2006 +0200'
test_atom head subject 'Initial'
test_atom head contents:subject 'Initial'
test_atom head body ''
@@ -96,7 +96,7 @@ test_atom tag parent ''
test_atom tag numparent ''
test_atom tag object $(git rev-parse refs/tags/testtag^0)
test_atom tag type 'commit'
-test_atom tag '*objectname' '67a36f10722846e891fbada1ba48ed035de75581'
+test_atom tag '*objectname' 'ea122842f48be4afb2d1fc6a4b96c05885ab7463'
test_atom tag '*objecttype' 'commit'
test_atom tag author ''
test_atom tag authorname ''
@@ -107,18 +107,18 @@ test_atom tag committername ''
test_atom tag committeremail ''
test_atom tag committerdate ''
test_atom tag tag 'testtag'
-test_atom tag tagger 'C O Mitter <committer@example.com> 1151939925 +0200'
+test_atom tag tagger 'C O Mitter <committer@example.com> 1151968725 +0200'
test_atom tag taggername 'C O Mitter'
test_atom tag taggeremail '<committer@example.com>'
-test_atom tag taggerdate 'Mon Jul 3 17:18:45 2006 +0200'
-test_atom tag creator 'C O Mitter <committer@example.com> 1151939925 +0200'
-test_atom tag creatordate 'Mon Jul 3 17:18:45 2006 +0200'
-test_atom tag subject 'Tagging at 1151939927'
-test_atom tag contents:subject 'Tagging at 1151939927'
+test_atom tag taggerdate 'Tue Jul 4 01:18:45 2006 +0200'
+test_atom tag creator 'C O Mitter <committer@example.com> 1151968725 +0200'
+test_atom tag creatordate 'Tue Jul 4 01:18:45 2006 +0200'
+test_atom tag subject 'Tagging at 1151968727'
+test_atom tag contents:subject 'Tagging at 1151968727'
test_atom tag body ''
test_atom tag contents:body ''
test_atom tag contents:signature ''
-test_atom tag contents 'Tagging at 1151939927
+test_atom tag contents 'Tagging at 1151968727
'
test_atom tag HEAD ' '
@@ -163,11 +163,11 @@ test_date () {
}
test_expect_success 'Check unformatted date fields output' '
- test_date "" "Mon Jul 3 17:18:43 2006 +0200" "Mon Jul 3 17:18:44 2006 +0200" "Mon Jul 3 17:18:45 2006 +0200"
+ test_date "" "Tue Jul 4 01:18:43 2006 +0200" "Tue Jul 4 01:18:44 2006 +0200" "Tue Jul 4 01:18:45 2006 +0200"
'
test_expect_success 'Check format "default" formatted date fields output' '
- test_date default "Mon Jul 3 17:18:43 2006 +0200" "Mon Jul 3 17:18:44 2006 +0200" "Mon Jul 3 17:18:45 2006 +0200"
+ test_date default "Tue Jul 4 01:18:43 2006 +0200" "Tue Jul 4 01:18:44 2006 +0200" "Tue Jul 4 01:18:45 2006 +0200"
'
# Don't know how to do relative check because I can't know when this script
@@ -181,23 +181,23 @@ test_expect_success 'Check format "relative" date fields output' '
'
test_expect_success 'Check format "short" date fields output' '
- test_date short 2006-07-03 2006-07-03 2006-07-03
+ test_date short 2006-07-04 2006-07-04 2006-07-04
'
test_expect_success 'Check format "local" date fields output' '
- test_date local "Mon Jul 3 15:18:43 2006" "Mon Jul 3 15:18:44 2006" "Mon Jul 3 15:18:45 2006"
+ test_date local "Mon Jul 3 23:18:43 2006" "Mon Jul 3 23:18:44 2006" "Mon Jul 3 23:18:45 2006"
'
test_expect_success 'Check format "iso8601" date fields output' '
- test_date iso8601 "2006-07-03 17:18:43 +0200" "2006-07-03 17:18:44 +0200" "2006-07-03 17:18:45 +0200"
+ test_date iso8601 "2006-07-04 01:18:43 +0200" "2006-07-04 01:18:44 +0200" "2006-07-04 01:18:45 +0200"
'
test_expect_success 'Check format "rfc2822" date fields output' '
- test_date rfc2822 "Mon, 3 Jul 2006 17:18:43 +0200" "Mon, 3 Jul 2006 17:18:44 +0200" "Mon, 3 Jul 2006 17:18:45 +0200"
+ test_date rfc2822 "Tue, 4 Jul 2006 01:18:43 +0200" "Tue, 4 Jul 2006 01:18:44 +0200" "Tue, 4 Jul 2006 01:18:45 +0200"
'
test_expect_success 'Check format of strftime date fields' '
- echo "my date is 2006-07-03" >expected &&
+ echo "my date is 2006-07-04" >expected &&
git for-each-ref \
--format="%(authordate:format:my date is %Y-%m-%d)" \
refs/heads >actual &&
@@ -515,8 +515,8 @@ body contents
$sig"
cat >expected <<EOF
-$(git rev-parse refs/tags/master) <committer@example.com> refs/tags/master
$(git rev-parse refs/tags/bogo) <committer@example.com> refs/tags/bogo
+$(git rev-parse refs/tags/master) <committer@example.com> refs/tags/master
EOF
test_expect_success 'Verify sort with multiple keys' '
--
2.5.0.466.g9af26fa
next prev parent reply other threads:[~2015-09-01 21:56 UTC|newest]
Thread overview: 59+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-30 13:54 [RFC/PATCH] date: allow any format to display local time John Keeping
2015-08-31 17:28 ` Junio C Hamano
2015-08-31 18:50 ` Jeff King
2015-08-31 18:56 ` Jeff King
2015-08-31 19:57 ` Junio C Hamano
2015-08-31 20:00 ` John Keeping
2015-08-31 20:44 ` Jeff King
2015-08-31 20:47 ` [PATCH 1/2] fast-import: switch crash-report date to iso8601 Jeff King
2015-08-31 20:48 ` [PATCH 2/2] date: make "local" orthogonal to date format Jeff King
2015-08-31 21:27 ` John Keeping
2015-08-31 21:33 ` Jeff King
2015-08-31 22:05 ` Jeff King
2015-09-01 8:37 ` John Keeping
2015-09-01 21:55 ` [PATCH v2 0/6] Make " John Keeping
2015-09-01 21:55 ` [PATCH v2 1/6] fast-import: switch crash-report date to iso8601 John Keeping
2015-09-01 21:55 ` [PATCH v2 2/6] date: make "local" orthogonal to date format John Keeping
2015-09-01 22:16 ` Junio C Hamano
2015-09-01 22:25 ` Jeff King
2015-09-01 22:33 ` John Keeping
2015-09-01 22:39 ` Jeff King
2015-09-01 22:41 ` Junio C Hamano
2015-09-02 17:36 ` Junio C Hamano
2015-09-01 21:55 ` [PATCH v2 3/6] t6300: introduce test_date() helper John Keeping
2015-09-01 22:19 ` Junio C Hamano
2015-09-01 22:26 ` Eric Sunshine
2015-09-01 22:31 ` Jeff King
2015-09-01 22:40 ` John Keeping
2015-09-01 22:41 ` Jeff King
2015-09-01 21:55 ` John Keeping [this message]
2015-09-01 21:55 ` [PATCH v2 5/6] t6300: add test for "raw" date format John Keeping
2015-09-01 21:55 ` [PATCH v2 6/6] t6300: add tests for "-local" date formats John Keeping
2015-09-01 22:44 ` [PATCH v2 0/6] Make "local" orthogonal to date format Jeff King
2015-09-02 7:48 ` John Keeping
2015-09-02 8:05 ` Jeff King
2015-09-02 15:16 ` Junio C Hamano
2015-09-02 19:49 ` John Keeping
2015-09-02 20:11 ` Junio C Hamano
2015-09-02 20:21 ` John Keeping
2015-09-02 20:29 ` Junio C Hamano
2015-09-02 21:27 ` Jeff King
2015-09-03 21:48 ` [PATCH v3 00/11] " John Keeping
2015-09-03 21:48 ` [PATCH v3 01/11] Documentation/blame-options: don't list date formats John Keeping
2015-09-03 21:48 ` [PATCH v3 02/11] Documentation/config: " John Keeping
2015-09-03 21:48 ` [PATCH v3 03/11] Documentation/git-for-each-ref: " John Keeping
2015-09-03 21:48 ` [PATCH v3 04/11] Documentation/rev-list: " John Keeping
2015-09-03 22:36 ` Junio C Hamano
2015-09-03 21:48 ` [PATCH v3 05/11] fast-import: switch crash-report date to iso8601 John Keeping
2015-09-03 21:48 ` [PATCH v3 06/11] t6300: introduce test_date() helper John Keeping
2015-09-03 21:48 ` [PATCH v3 07/11] t6300: add test for "raw" date format John Keeping
2015-09-03 21:48 ` [PATCH v3 08/11] date: check for "local" before anything else John Keeping
2015-09-03 22:45 ` Junio C Hamano
2015-09-03 21:48 ` [PATCH v3 09/11] date: make "local" orthogonal to date format John Keeping
2015-09-03 21:49 ` [PATCH v3 10/11] t6300: make UTC and local dates different John Keeping
2015-09-03 21:49 ` [PATCH v3 11/11] t6300: add tests for "-local" date formats John Keeping
2015-09-08 7:53 ` [PATCH v3 00/11] Make "local" orthogonal to date format Jeff King
2015-09-02 17:41 ` [PATCH 2/2] date: make " Junio C Hamano
2015-09-02 21:30 ` Jeff King
2015-09-02 22:07 ` John Keeping
2015-09-03 15:54 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ea99176ca84d865e22fa09afd38d2495e0837b67.1441144343.git.john@keeping.me.uk \
--to=john@keeping.me.uk \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=peff@peff.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).