summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiang Xin <worldhello.net@gmail.com>2019-06-04 08:24:28 +0800
committerJiang Xin <worldhello.net@gmail.com>2019-06-04 08:24:28 +0800
commitb50e1c093ca53168abae544d4d7b5d33392c0985 (patch)
tree77e7c0dcb56390331b98ec6730d6134afc30d788
parent1c8ba5f1b32fb1c7ad1a61b143b16b28690f0682 (diff)
parent74583d89127e21255c12dd3c8a3bf60b497d7d03 (diff)
downloadgit-b50e1c093ca53168abae544d4d7b5d33392c0985.tar.gz
Merge branch 'master' of git://git.kernel.org/pub/scm/git/git
* 'master' of git://git.kernel.org/pub/scm/git/git: Git 2.22-rc3 i18n: fix typos found during l10n for git 2.22.0 RelNotes: minor typo fixes in 2.22.0 draft list-objects-filter: disable 'sparse:path' filters
-rw-r--r--Documentation/RelNotes/2.22.0.txt19
-rw-r--r--Documentation/rev-list-options.txt7
-rwxr-xr-xGIT-VERSION-GEN2
-rw-r--r--contrib/completion/git-completion.bash2
-rw-r--r--diff.c2
-rw-r--r--list-objects-filter-options.c10
-rw-r--r--list-objects-filter-options.h2
-rw-r--r--list-objects-filter.c22
-rw-r--r--remote-curl.c4
-rwxr-xr-xt/t5317-pack-objects-filter-objects.sh71
-rwxr-xr-xt/t6112-rev-list-filters-objects.sh39
11 files changed, 54 insertions, 126 deletions
diff --git a/Documentation/RelNotes/2.22.0.txt b/Documentation/RelNotes/2.22.0.txt
index 84e1ba6106..91e6ae9887 100644
--- a/Documentation/RelNotes/2.22.0.txt
+++ b/Documentation/RelNotes/2.22.0.txt
@@ -4,6 +4,13 @@ Git 2.22 Release Notes
Updates since v2.21
-------------------
+Backward compatibility note
+
+ * The filter specification "--filter=sparse:path=<path>" used to
+ create a lazy/partial clone has been removed. Using a blob that is
+ part of the project as sparse specification is still supported with
+ the "--filter=sparse:oid=<blob>" option.
+
UI, Workflows & Features
* "git checkout --no-overlay" can be used to trigger a new mode of
@@ -181,7 +188,7 @@ Performance, Internal Implementation, Development Support etc.
been optimized out.
* Mechanically and systematically drop "extern" from function
- declarlation.
+ declaration.
* The script to aggregate perf result unconditionally depended on
libjson-perl even though it did not have to, which has been
@@ -270,7 +277,7 @@ Fixes since v2.21
* On platforms where "git fetch" is killed with SIGPIPE (e.g. OSX),
the upload-pack that runs on the other end that hangs up after
detecting an error could cause "git fetch" to die with a signal,
- which led to a flakey test. "git fetch" now ignores SIGPIPE during
+ which led to a flaky test. "git fetch" now ignores SIGPIPE during
the network portion of its operation (this is not a problem as we
check the return status from our write(2)s).
(merge 143588949c jk/no-sigpipe-during-network-transport later to maint).
@@ -358,7 +365,7 @@ Fixes since v2.21
(merge b5a0bd694c nd/read-tree-reset-doc later to maint).
* Code clean-up around a much-less-important-than-it-used-to-be
- update_server_info() funtion.
+ update_server_info() function.
(merge b3223761c8 jk/server-info-rabbit-hole later to maint).
* The message given when "git commit -a <paths>" errors out has been
@@ -450,7 +457,7 @@ Fixes since v2.21
* When given a tag that points at a commit-ish, "git replace --graft"
failed to peel the tag before writing a replace ref, which did not
make sense because the old graft mechanism the feature wants to
- mimick only allowed to replace one commit object with another.
+ mimic only allowed to replace one commit object with another.
This has been fixed.
(merge ee521ec4cb cc/replace-graft-peel-tags later to maint).
@@ -500,7 +507,7 @@ Fixes since v2.21
conflicts are resolved in working tree *.h files but before the
resolved results are added to the index. This has been corrected.
- * "git chery-pick" (and "revert" that shares the same runtime engine)
+ * "git cherry-pick" (and "revert" that shares the same runtime engine)
that deals with multiple commits got confused when the final step
gets stopped with a conflict and the user concluded the sequence
with "git commit". Attempt to fix it by cleaning up the state
@@ -535,7 +542,7 @@ Fixes since v2.21
todo-list "rebase -i -r" uses should not be shown as a hex object
name.
- * A prerequiste check in the test suite to see if a working jgit is
+ * A prerequisite check in the test suite to see if a working jgit is
available was made more robust.
(merge abd0f28983 tz/test-lib-check-working-jgit later to maint).
diff --git a/Documentation/rev-list-options.txt b/Documentation/rev-list-options.txt
index ddbc1de43f..71a1fcc093 100644
--- a/Documentation/rev-list-options.txt
+++ b/Documentation/rev-list-options.txt
@@ -725,9 +725,6 @@ specification contained in the blob (or blob-expression) '<blob-ish>'
to omit blobs that would not be not required for a sparse checkout on
the requested refs.
+
-The form '--filter=sparse:path=<path>' similarly uses a sparse-checkout
-specification contained in <path>.
-+
The form '--filter=tree:<depth>' omits all blobs and trees whose depth
from the root tree is >= <depth> (minimum depth if an object is located
at multiple depths in the commits traversed). <depth>=0 will not include
@@ -737,6 +734,10 @@ tree and blobs which are referenced directly by a commit reachable from
<commit> or an explicitly-given object. <depth>=2 is like <depth>=1
while also including trees and blobs one more level removed from an
explicitly-given commit or tree.
++
+Note that the form '--filter=sparse:path=<path>' that wants to read
+from an arbitrary path on the filesystem has been dropped for security
+reasons.
--no-filter::
Turn off any previous `--filter=` argument.
diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN
index 7a228b2a9c..3491a60af5 100755
--- a/GIT-VERSION-GEN
+++ b/GIT-VERSION-GEN
@@ -1,7 +1,7 @@
#!/bin/sh
GVF=GIT-VERSION-FILE
-DEF_VER=v2.22.0-rc2
+DEF_VER=v2.22.0-rc3
LF='
'
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 3eefbabdb1..9f71bcde96 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -1536,7 +1536,7 @@ _git_fetch ()
return
;;
--filter=*)
- __gitcomp "blob:none blob:limit= sparse:oid= sparse:path=" "" "${cur##--filter=}"
+ __gitcomp "blob:none blob:limit= sparse:oid=" "" "${cur##--filter=}"
return
;;
--*)
diff --git a/diff.c b/diff.c
index 2068b1c06e..a654d46f6a 100644
--- a/diff.c
+++ b/diff.c
@@ -5354,7 +5354,7 @@ static void prep_parse_options(struct diff_options *options)
N_("show the given source prefix instead of \"a/\""),
PARSE_OPT_NONEG),
OPT_STRING_F(0, "dst-prefix", &options->b_prefix, N_("<prefix>"),
- N_("show the given source prefix instead of \"b/\""),
+ N_("show the given destination prefix instead of \"b/\""),
PARSE_OPT_NONEG),
OPT_CALLBACK_F(0, "line-prefix", options, N_("<prefix>"),
N_("prepend an additional prefix to every line of output"),
diff --git a/list-objects-filter-options.c b/list-objects-filter-options.c
index c0036f7378..a15d0f7829 100644
--- a/list-objects-filter-options.c
+++ b/list-objects-filter-options.c
@@ -78,9 +78,12 @@ static int gently_parse_list_objects_filter(
return 0;
} else if (skip_prefix(arg, "sparse:path=", &v0)) {
- filter_options->choice = LOFC_SPARSE_PATH;
- filter_options->sparse_path_value = strdup(v0);
- return 0;
+ if (errbuf) {
+ strbuf_addstr(
+ errbuf,
+ _("sparse:path filters support has been dropped"));
+ }
+ return 1;
}
/*
* Please update _git_fetch() in git-completion.bash when you
@@ -136,7 +139,6 @@ void list_objects_filter_release(
{
free(filter_options->filter_spec);
free(filter_options->sparse_oid_value);
- free(filter_options->sparse_path_value);
memset(filter_options, 0, sizeof(*filter_options));
}
diff --git a/list-objects-filter-options.h b/list-objects-filter-options.h
index e3adc78ebf..c54f0000fb 100644
--- a/list-objects-filter-options.h
+++ b/list-objects-filter-options.h
@@ -13,7 +13,6 @@ enum list_objects_filter_choice {
LOFC_BLOB_LIMIT,
LOFC_TREE_DEPTH,
LOFC_SPARSE_OID,
- LOFC_SPARSE_PATH,
LOFC__COUNT /* must be last */
};
@@ -44,7 +43,6 @@ struct list_objects_filter_options {
* choice.
*/
struct object_id *sparse_oid_value;
- char *sparse_path_value;
unsigned long blob_limit_value;
unsigned long tree_exclude_depth;
};
diff --git a/list-objects-filter.c b/list-objects-filter.c
index ee449de3f7..53f90442c5 100644
--- a/list-objects-filter.c
+++ b/list-objects-filter.c
@@ -478,27 +478,6 @@ static void *filter_sparse_oid__init(
return d;
}
-static void *filter_sparse_path__init(
- struct oidset *omitted,
- struct list_objects_filter_options *filter_options,
- filter_object_fn *filter_fn,
- filter_free_fn *filter_free_fn)
-{
- struct filter_sparse_data *d = xcalloc(1, sizeof(*d));
- d->omits = omitted;
- if (add_excludes_from_file_to_list(filter_options->sparse_path_value,
- NULL, 0, &d->el, NULL) < 0)
- die("could not load filter specification");
-
- ALLOC_GROW(d->array_frame, d->nr + 1, d->alloc);
- d->array_frame[d->nr].defval = 0; /* default to include */
- d->array_frame[d->nr].child_prov_omit = 0;
-
- *filter_fn = filter_sparse;
- *filter_free_fn = filter_sparse_free;
- return d;
-}
-
typedef void *(*filter_init_fn)(
struct oidset *omitted,
struct list_objects_filter_options *filter_options,
@@ -514,7 +493,6 @@ static filter_init_fn s_filters[] = {
filter_blobs_limit__init,
filter_trees_depth__init,
filter_sparse_oid__init,
- filter_sparse_path__init,
};
void *list_objects_filter__init(
diff --git a/remote-curl.c b/remote-curl.c
index a1bf4f68c7..051f26629d 100644
--- a/remote-curl.c
+++ b/remote-curl.c
@@ -1117,13 +1117,13 @@ static void parse_fetch(struct strbuf *buf)
const char *q;
if (parse_oid_hex(p, &old_oid, &q))
- die(_("protocol error: expected sha/ref, got %s'"), p);
+ die(_("protocol error: expected sha/ref, got '%s'"), p);
if (*q == ' ')
name = q + 1;
else if (!*q)
name = "";
else
- die(_("protocol error: expected sha/ref, got %s'"), p);
+ die(_("protocol error: expected sha/ref, got '%s'"), p);
ref = alloc_ref(name);
oidcpy(&ref->old_oid, &old_oid);
diff --git a/t/t5317-pack-objects-filter-objects.sh b/t/t5317-pack-objects-filter-objects.sh
index 4c0201c34b..2d2f5d0229 100755
--- a/t/t5317-pack-objects-filter-objects.sh
+++ b/t/t5317-pack-objects-filter-objects.sh
@@ -277,6 +277,10 @@ test_expect_success 'verify normal and blob:limit packfiles have same commits/tr
'
# Test sparse:path=<path> filter.
+# !!!!
+# NOTE: sparse:path filter support has been dropped for security reasons,
+# so the tests have been changed to make sure that using it fails.
+# !!!!
# Use a local file containing a sparse-checkout specification to filter
# out blobs not required for the corresponding sparse-checkout. We do not
# require sparse-checkout to actually be enabled.
@@ -315,73 +319,24 @@ test_expect_success 'verify blob count in normal packfile' '
test_cmp expected observed
'
-test_expect_success 'verify sparse:path=pattern1' '
- git -C r3 ls-files -s dir1/sparse1 dir1/sparse2 >ls_files_result &&
- awk -f print_2.awk ls_files_result |
- sort >expected &&
-
- git -C r3 pack-objects --revs --stdout --filter=sparse:path=../pattern1 >filter.pack <<-EOF &&
+test_expect_success 'verify sparse:path=pattern1 fails' '
+ test_must_fail git -C r3 pack-objects --revs --stdout \
+ --filter=sparse:path=../pattern1 <<-EOF
HEAD
EOF
- git -C r3 index-pack ../filter.pack &&
-
- git -C r3 verify-pack -v ../filter.pack >verify_result &&
- grep blob verify_result |
- awk -f print_1.awk |
- sort >observed &&
-
- test_cmp expected observed
-'
-
-test_expect_success 'verify normal and sparse:path=pattern1 packfiles have same commits/trees' '
- git -C r3 verify-pack -v ../all.pack >verify_result &&
- grep -E "commit|tree" verify_result |
- awk -f print_1.awk |
- sort >expected &&
-
- git -C r3 verify-pack -v ../filter.pack >verify_result &&
- grep -E "commit|tree" verify_result |
- awk -f print_1.awk |
- sort >observed &&
-
- test_cmp expected observed
'
-test_expect_success 'verify sparse:path=pattern2' '
- git -C r3 ls-files -s sparse1 dir1/sparse1 >ls_files_result &&
- awk -f print_2.awk ls_files_result |
- sort >expected &&
-
- git -C r3 pack-objects --revs --stdout --filter=sparse:path=../pattern2 >filter.pack <<-EOF &&
+test_expect_success 'verify sparse:path=pattern2 fails' '
+ test_must_fail git -C r3 pack-objects --revs --stdout \
+ --filter=sparse:path=../pattern2 <<-EOF
HEAD
EOF
- git -C r3 index-pack ../filter.pack &&
-
- git -C r3 verify-pack -v ../filter.pack >verify_result &&
- grep blob verify_result |
- awk -f print_1.awk |
- sort >observed &&
-
- test_cmp expected observed
-'
-
-test_expect_success 'verify normal and sparse:path=pattern2 packfiles have same commits/trees' '
- git -C r3 verify-pack -v ../all.pack >verify_result &&
- grep -E "commit|tree" verify_result |
- awk -f print_1.awk |
- sort >expected &&
-
- git -C r3 verify-pack -v ../filter.pack >verify_result &&
- grep -E "commit|tree" verify_result |
- awk -f print_1.awk |
- sort >observed &&
-
- test_cmp expected observed
'
# Test sparse:oid=<oid-ish> filter.
-# Like sparse:path, but we get the sparse-checkout specification from
-# a blob rather than a file on disk.
+# Use a blob containing a sparse-checkout specification to filter
+# out blobs not required for the corresponding sparse-checkout. We do not
+# require sparse-checkout to actually be enabled.
test_expect_success 'setup r4' '
git init r4 &&
diff --git a/t/t6112-rev-list-filters-objects.sh b/t/t6112-rev-list-filters-objects.sh
index 9c11427719..acd7f5ab80 100755
--- a/t/t6112-rev-list-filters-objects.sh
+++ b/t/t6112-rev-list-filters-objects.sh
@@ -157,6 +157,10 @@ test_expect_success 'verify blob:limit=1m' '
'
# Test sparse:path=<path> filter.
+# !!!!
+# NOTE: sparse:path filter support has been dropped for security reasons,
+# so the tests have been changed to make sure that using it fails.
+# !!!!
# Use a local file containing a sparse-checkout specification to filter
# out blobs not required for the corresponding sparse-checkout. We do not
# require sparse-checkout to actually be enabled.
@@ -176,37 +180,20 @@ test_expect_success 'setup r3' '
echo sparse1 >pattern2
'
-test_expect_success 'verify sparse:path=pattern1 omits top-level files' '
- git -C r3 ls-files -s sparse1 sparse2 >ls_files_result &&
- awk -f print_2.awk ls_files_result |
- sort >expected &&
-
- git -C r3 rev-list --quiet --objects --filter-print-omitted \
- --filter=sparse:path=../pattern1 HEAD >revs &&
- awk -f print_1.awk revs |
- sed "s/~//" |
- sort >observed &&
-
- test_cmp expected observed
+test_expect_success 'verify sparse:path=pattern1 fails' '
+ test_must_fail git -C r3 rev-list --quiet --objects \
+ --filter-print-omitted --filter=sparse:path=../pattern1 HEAD
'
-test_expect_success 'verify sparse:path=pattern2 omits both sparse2 files' '
- git -C r3 ls-files -s sparse2 dir1/sparse2 >ls_files_result &&
- awk -f print_2.awk ls_files_result |
- sort >expected &&
-
- git -C r3 rev-list --quiet --objects --filter-print-omitted \
- --filter=sparse:path=../pattern2 HEAD >revs &&
- awk -f print_1.awk revs |
- sed "s/~//" |
- sort >observed &&
-
- test_cmp expected observed
+test_expect_success 'verify sparse:path=pattern2 fails' '
+ test_must_fail git -C r3 rev-list --quiet --objects \
+ --filter-print-omitted --filter=sparse:path=../pattern2 HEAD
'
# Test sparse:oid=<oid-ish> filter.
-# Like sparse:path, but we get the sparse-checkout specification from
-# a blob rather than a file on disk.
+# Use a blob containing a sparse-checkout specification to filter
+# out blobs not required for the corresponding sparse-checkout. We do not
+# require sparse-checkout to actually be enabled.
test_expect_success 'setup r3 part 2' '
echo dir1/ >r3/pattern &&