[RFC/PATCH 4/4] name-rev: respect core.clockskew
- From
Jeff King <peff@peff.net>
- Date
- Jul 5, 2010, 12:36 UTC
- Message-ID
- <20100705123653.GD25699@sigill.intra.peff.net>
- In-Reply-To
- <20100705122723.GB21146@sigill.intra.peff.net>
Before core.clockskew existed, we were just hard-coded to 86400 seconds. This allows users to tweak the value as appropriate.
Signed-off-by: Jeff King <peff@peff.net> --- I think it makes sense to adapt this to core.clockskew. Especially if our default stays at 86400, then there is no change in behavior. But even if it does change, I think having it tweakable (and especially if we automatically calculate per-repo skew) makes sense.
builtin/name-rev.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/builtin/name-rev.c b/builtin/name-rev.c index 06a38ac..5c6d712 100644 --- a/builtin/name-rev.c +++ b/builtin/name-rev.c @@ -5,8 +5,6 @@ #include "refs.h" #include "parse-options.h" -#define CUTOFF_DATE_SLOP 86400 /* one day */ - typedef struct rev_name { const char *tip_name; int generation; @@ -270,8 +268,10 @@ int cmd_name_rev(int argc, const char **argv, const char *prefix) add_object_array((struct object *)commit, *argv, &revs); } - if (cutoff) - cutoff = cutoff - CUTOFF_DATE_SLOP; + if (cutoff && core_clock_skew >= 0) + cutoff = cutoff - core_clock_skew; + else + cutoff = 0; for_each_ref(name_ref, &data); if (transform_stdin) {
-- 1.7.2.rc1.209.g2a36c