From: "Stephen P. Smith" <ischis2@cox.net>
To: git@vger.kernel.org
Cc: Jeff King <peff@peff.net>, Junio C Hamano <gitster@pobox.com>
Subject: [PATCH v2 0/2] Date test code clean-up
Date: Wed, 11 Sep 2019 21:11:00 -0700 [thread overview]
Message-ID: <20190912041102.16266-1-ischis2@cox.net> (raw)
In-Reply-To: <20190909014711.3894-1-ischis2@cox.net>
As part of a previous patch submission[1], a cleanup patch was
suggested to remove a now unnecessary passing of a date environment
variable to the production code.
While the two patches in the set could easily be submitted as a single
patch, I split the removal of the getenv() call into a second
patch. I did that to make the comment about the initialization of `x`
more localized to the change.
[1] https://public-inbox.org/git/xmqq5zuge2y7.fsf@gitster-ct.c.googlers.com
Range Diff:
1: f4170ad553 ! 1: e2b8322d58 Quit passing 'now' to date code
@@ Metadata
## Commit message ##
Quit passing 'now' to date code
- As part of a previous patch set, the get_time() function was added to
- date.c eliminating the need to pass a `now` parameter from the test
- code.
+ Commit b841d4ff43 (Add `human` format to test-tool, 2019-01-28) added
+ a get_time() function which allows $GIT_TEST_DATE_NOW in the
+ environment to override the current time. So we no longer need to
+ interpret that variable in cmd__date().
- This patch removes the unneeded `now` parameter.
+ Therefore, we can stop passing the "now" parameter down through the
+ date functions, since nobody uses them. Note that we do need to make
+ sure all of the previous callers that took a "now" parameter are
+ correctly using get_time().
## cache.h ##
@@ cache.h: struct date_mode {
2: 3c7c4f1f55 ! 2: 18ec5b3b3d test_date.c: Remove reference to GIT_TEST_DATE_NOW
@@ Commit message
test_date.c: Remove reference to GIT_TEST_DATE_NOW
Remove the reference to the GIT_TEST_DATE_NOW which is done in date.c.
- The intialization of variable x with the value from GIT_TEST_DATE_NOW
- is unneeded since x is initalized by skip_prefix().
+ We can't get rid of the "x" variable, since it serves as a generic
+ scratch variable for parsing later in the function.
## t/helper/test-date.c ##
@@ t/helper/test-date.c: static void getnanos(const char **argv)
Stephen P. Smith (2):
Quit passing 'now' to date code
test_date.c: Remove reference to GIT_TEST_DATE_NOW
cache.h | 5 ++---
date.c | 27 +++++++++++++--------------
t/helper/test-date.c | 27 +++++++++------------------
3 files changed, 24 insertions(+), 35 deletions(-)
--
2.23.0
next prev parent reply other threads:[~2019-09-12 4:11 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-09 1:47 [PATCH 0/2] Date test code clean-up Stephen P. Smith
2019-09-09 1:47 ` [PATCH 1/2] Quit passing 'now' to date code Stephen P. Smith
2019-09-09 17:28 ` Jeff King
2019-09-09 1:47 ` [PATCH 2/2] test_date.c: Remove reference to GIT_TEST_DATE_NOW Stephen P. Smith
2019-09-09 17:29 ` Jeff King
2019-09-09 19:44 ` Junio C Hamano
2019-09-09 18:32 ` [PATCH 0/2] Date test code clean-up Junio C Hamano
2019-09-12 4:11 ` Stephen P. Smith [this message]
2019-09-12 4:11 ` [PATCH v2 1/2] Quit passing 'now' to date code Stephen P. Smith
2019-09-12 4:11 ` [PATCH v2 2/2] test_date.c: Remove reference to GIT_TEST_DATE_NOW Stephen P. Smith
2019-09-13 5:08 ` [PATCH v2 0/2] Date test code clean-up Jeff King
2019-09-13 17:25 ` 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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190912041102.16266-1-ischis2@cox.net \
--to=ischis2@cox.net \
--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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).