aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools
diff options
context:
space:
mode:
authorGravatar Ed Baunton <edbaunton@gmail.com>2018-05-24 05:07:47 -0700
committerGravatar Copybara-Service <copybara-piper@google.com>2018-05-24 05:08:57 -0700
commit70733df000fe72b8d06abdb92ce129be934d622b (patch)
treec61b02e848723cf7796a3a65ea419004297fbc94 /tools
parent3c9cd82b847f3ece8ec04b2029bd5e8ad0eb7502 (diff)
shallow_since tests and doc improvements
This changeset introduces tests for the `shallow_since` functionality that was introduced in 6496b1d1d25025f33406b1eaf9949cab126f08bd. We test that if the user specifies a tag as well as a `shallow_since` that it fails since they are incompatible. We also verify that specifying a commit before the `shallow_since` date causes the clone to fail (albeit currently with a non-useful error message; perhaps that could be improved at a later date). It also documents more clearly how to use the feature by explaining the format of the 'since' string. Closes #5183. PiperOrigin-RevId: 197875727
Diffstat (limited to 'tools')
-rw-r--r--tools/build_defs/repo/git.bzl12
1 files changed, 6 insertions, 6 deletions
diff --git a/tools/build_defs/repo/git.bzl b/tools/build_defs/repo/git.bzl
index c522956ee4..4972037d47 100644
--- a/tools/build_defs/repo/git.bzl
+++ b/tools/build_defs/repo/git.bzl
@@ -35,7 +35,7 @@ def _clone_or_update(ctx):
shallow='--shallow-since=%s' % ctx.attr.shallow_since
if (ctx.attr.verbose):
- print('git.bzl: Cloning or updating%s repository %s using strip_prefix of [%s]' %
+ print('git.bzl: Cloning or updating %s repository %s using strip_prefix of [%s]' %
(' (%s)' % shallow if shallow else '',
ctx.name,
ctx.attr.strip_prefix if ctx.attr.strip_prefix else 'None',
@@ -188,11 +188,11 @@ Args:
commit: specific commit to be checked out
Either tag or commit must be specified.
- shallow_since: an optional date, not after the specified commit; the
- argument is not allowed if a tag is specified (which allows cloning
- with depth 1). Setting such a date close to the specified commit
- allows for a more shallow clone of the repository, saving bandwith and
- wall-clock time.
+ shallow_since: an optional date in the form YYYY-MM-DD, not after
+ the specified commit; the argument is not allowed if a tag is specified
+ (which allows cloning with depth 1). Setting such a date close to the
+ specified commit allows for a more shallow clone of the repository, saving
+ bandwith and wall-clock time.
strip_prefix: A directory prefix to strip from the extracted files.