Skip to content

Commit b50e1c0

Browse files
committed
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
2 parents 1c8ba5f + 74583d8 commit b50e1c0

11 files changed

+54
-126
lines changed

Documentation/RelNotes/2.22.0.txt

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ Git 2.22 Release Notes
44
Updates since v2.21
55
-------------------
66

7+
Backward compatibility note
8+
9+
* The filter specification "--filter=sparse:path=<path>" used to
10+
create a lazy/partial clone has been removed. Using a blob that is
11+
part of the project as sparse specification is still supported with
12+
the "--filter=sparse:oid=<blob>" option.
13+
714
UI, Workflows & Features
815

916
* "git checkout --no-overlay" can be used to trigger a new mode of
@@ -181,7 +188,7 @@ Performance, Internal Implementation, Development Support etc.
181188
been optimized out.
182189

183190
* Mechanically and systematically drop "extern" from function
184-
declarlation.
191+
declaration.
185192

186193
* The script to aggregate perf result unconditionally depended on
187194
libjson-perl even though it did not have to, which has been
@@ -270,7 +277,7 @@ Fixes since v2.21
270277
* On platforms where "git fetch" is killed with SIGPIPE (e.g. OSX),
271278
the upload-pack that runs on the other end that hangs up after
272279
detecting an error could cause "git fetch" to die with a signal,
273-
which led to a flakey test. "git fetch" now ignores SIGPIPE during
280+
which led to a flaky test. "git fetch" now ignores SIGPIPE during
274281
the network portion of its operation (this is not a problem as we
275282
check the return status from our write(2)s).
276283
(merge 143588949c jk/no-sigpipe-during-network-transport later to maint).
@@ -358,7 +365,7 @@ Fixes since v2.21
358365
(merge b5a0bd694c nd/read-tree-reset-doc later to maint).
359366

360367
* Code clean-up around a much-less-important-than-it-used-to-be
361-
update_server_info() funtion.
368+
update_server_info() function.
362369
(merge b3223761c8 jk/server-info-rabbit-hole later to maint).
363370

364371
* The message given when "git commit -a <paths>" errors out has been
@@ -450,7 +457,7 @@ Fixes since v2.21
450457
* When given a tag that points at a commit-ish, "git replace --graft"
451458
failed to peel the tag before writing a replace ref, which did not
452459
make sense because the old graft mechanism the feature wants to
453-
mimick only allowed to replace one commit object with another.
460+
mimic only allowed to replace one commit object with another.
454461
This has been fixed.
455462
(merge ee521ec4cb cc/replace-graft-peel-tags later to maint).
456463

@@ -500,7 +507,7 @@ Fixes since v2.21
500507
conflicts are resolved in working tree *.h files but before the
501508
resolved results are added to the index. This has been corrected.
502509

503-
* "git chery-pick" (and "revert" that shares the same runtime engine)
510+
* "git cherry-pick" (and "revert" that shares the same runtime engine)
504511
that deals with multiple commits got confused when the final step
505512
gets stopped with a conflict and the user concluded the sequence
506513
with "git commit". Attempt to fix it by cleaning up the state
@@ -535,7 +542,7 @@ Fixes since v2.21
535542
todo-list "rebase -i -r" uses should not be shown as a hex object
536543
name.
537544

538-
* A prerequiste check in the test suite to see if a working jgit is
545+
* A prerequisite check in the test suite to see if a working jgit is
539546
available was made more robust.
540547
(merge abd0f28983 tz/test-lib-check-working-jgit later to maint).
541548

Documentation/rev-list-options.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -725,9 +725,6 @@ specification contained in the blob (or blob-expression) '<blob-ish>'
725725
to omit blobs that would not be not required for a sparse checkout on
726726
the requested refs.
727727
+
728-
The form '--filter=sparse:path=<path>' similarly uses a sparse-checkout
729-
specification contained in <path>.
730-
+
731728
The form '--filter=tree:<depth>' omits all blobs and trees whose depth
732729
from the root tree is >= <depth> (minimum depth if an object is located
733730
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
737734
<commit> or an explicitly-given object. <depth>=2 is like <depth>=1
738735
while also including trees and blobs one more level removed from an
739736
explicitly-given commit or tree.
737+
+
738+
Note that the form '--filter=sparse:path=<path>' that wants to read
739+
from an arbitrary path on the filesystem has been dropped for security
740+
reasons.
740741

741742
--no-filter::
742743
Turn off any previous `--filter=` argument.

GIT-VERSION-GEN

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/sh
22

33
GVF=GIT-VERSION-FILE
4-
DEF_VER=v2.22.0-rc2
4+
DEF_VER=v2.22.0-rc3
55

66
LF='
77
'

contrib/completion/git-completion.bash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1536,7 +1536,7 @@ _git_fetch ()
15361536
return
15371537
;;
15381538
--filter=*)
1539-
__gitcomp "blob:none blob:limit= sparse:oid= sparse:path=" "" "${cur##--filter=}"
1539+
__gitcomp "blob:none blob:limit= sparse:oid=" "" "${cur##--filter=}"
15401540
return
15411541
;;
15421542
--*)

diff.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5354,7 +5354,7 @@ static void prep_parse_options(struct diff_options *options)
53545354
N_("show the given source prefix instead of \"a/\""),
53555355
PARSE_OPT_NONEG),
53565356
OPT_STRING_F(0, "dst-prefix", &options->b_prefix, N_("<prefix>"),
5357-
N_("show the given source prefix instead of \"b/\""),
5357+
N_("show the given destination prefix instead of \"b/\""),
53585358
PARSE_OPT_NONEG),
53595359
OPT_CALLBACK_F(0, "line-prefix", options, N_("<prefix>"),
53605360
N_("prepend an additional prefix to every line of output"),

list-objects-filter-options.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,12 @@ static int gently_parse_list_objects_filter(
7878
return 0;
7979

8080
} else if (skip_prefix(arg, "sparse:path=", &v0)) {
81-
filter_options->choice = LOFC_SPARSE_PATH;
82-
filter_options->sparse_path_value = strdup(v0);
83-
return 0;
81+
if (errbuf) {
82+
strbuf_addstr(
83+
errbuf,
84+
_("sparse:path filters support has been dropped"));
85+
}
86+
return 1;
8487
}
8588
/*
8689
* Please update _git_fetch() in git-completion.bash when you
@@ -136,7 +139,6 @@ void list_objects_filter_release(
136139
{
137140
free(filter_options->filter_spec);
138141
free(filter_options->sparse_oid_value);
139-
free(filter_options->sparse_path_value);
140142
memset(filter_options, 0, sizeof(*filter_options));
141143
}
142144

list-objects-filter-options.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ enum list_objects_filter_choice {
1313
LOFC_BLOB_LIMIT,
1414
LOFC_TREE_DEPTH,
1515
LOFC_SPARSE_OID,
16-
LOFC_SPARSE_PATH,
1716
LOFC__COUNT /* must be last */
1817
};
1918

@@ -44,7 +43,6 @@ struct list_objects_filter_options {
4443
* choice.
4544
*/
4645
struct object_id *sparse_oid_value;
47-
char *sparse_path_value;
4846
unsigned long blob_limit_value;
4947
unsigned long tree_exclude_depth;
5048
};

list-objects-filter.c

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -478,27 +478,6 @@ static void *filter_sparse_oid__init(
478478
return d;
479479
}
480480

481-
static void *filter_sparse_path__init(
482-
struct oidset *omitted,
483-
struct list_objects_filter_options *filter_options,
484-
filter_object_fn *filter_fn,
485-
filter_free_fn *filter_free_fn)
486-
{
487-
struct filter_sparse_data *d = xcalloc(1, sizeof(*d));
488-
d->omits = omitted;
489-
if (add_excludes_from_file_to_list(filter_options->sparse_path_value,
490-
NULL, 0, &d->el, NULL) < 0)
491-
die("could not load filter specification");
492-
493-
ALLOC_GROW(d->array_frame, d->nr + 1, d->alloc);
494-
d->array_frame[d->nr].defval = 0; /* default to include */
495-
d->array_frame[d->nr].child_prov_omit = 0;
496-
497-
*filter_fn = filter_sparse;
498-
*filter_free_fn = filter_sparse_free;
499-
return d;
500-
}
501-
502481
typedef void *(*filter_init_fn)(
503482
struct oidset *omitted,
504483
struct list_objects_filter_options *filter_options,
@@ -514,7 +493,6 @@ static filter_init_fn s_filters[] = {
514493
filter_blobs_limit__init,
515494
filter_trees_depth__init,
516495
filter_sparse_oid__init,
517-
filter_sparse_path__init,
518496
};
519497

520498
void *list_objects_filter__init(

remote-curl.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1117,13 +1117,13 @@ static void parse_fetch(struct strbuf *buf)
11171117
const char *q;
11181118

11191119
if (parse_oid_hex(p, &old_oid, &q))
1120-
die(_("protocol error: expected sha/ref, got %s'"), p);
1120+
die(_("protocol error: expected sha/ref, got '%s'"), p);
11211121
if (*q == ' ')
11221122
name = q + 1;
11231123
else if (!*q)
11241124
name = "";
11251125
else
1126-
die(_("protocol error: expected sha/ref, got %s'"), p);
1126+
die(_("protocol error: expected sha/ref, got '%s'"), p);
11271127

11281128
ref = alloc_ref(name);
11291129
oidcpy(&ref->old_oid, &old_oid);

t/t5317-pack-objects-filter-objects.sh

Lines changed: 13 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,10 @@ test_expect_success 'verify normal and blob:limit packfiles have same commits/tr
277277
'
278278

279279
# Test sparse:path=<path> filter.
280+
# !!!!
281+
# NOTE: sparse:path filter support has been dropped for security reasons,
282+
# so the tests have been changed to make sure that using it fails.
283+
# !!!!
280284
# Use a local file containing a sparse-checkout specification to filter
281285
# out blobs not required for the corresponding sparse-checkout. We do not
282286
# require sparse-checkout to actually be enabled.
@@ -315,73 +319,24 @@ test_expect_success 'verify blob count in normal packfile' '
315319
test_cmp expected observed
316320
'
317321

318-
test_expect_success 'verify sparse:path=pattern1' '
319-
git -C r3 ls-files -s dir1/sparse1 dir1/sparse2 >ls_files_result &&
320-
awk -f print_2.awk ls_files_result |
321-
sort >expected &&
322-
323-
git -C r3 pack-objects --revs --stdout --filter=sparse:path=../pattern1 >filter.pack <<-EOF &&
322+
test_expect_success 'verify sparse:path=pattern1 fails' '
323+
test_must_fail git -C r3 pack-objects --revs --stdout \
324+
--filter=sparse:path=../pattern1 <<-EOF
324325
HEAD
325326
EOF
326-
git -C r3 index-pack ../filter.pack &&
327-
328-
git -C r3 verify-pack -v ../filter.pack >verify_result &&
329-
grep blob verify_result |
330-
awk -f print_1.awk |
331-
sort >observed &&
332-
333-
test_cmp expected observed
334-
'
335-
336-
test_expect_success 'verify normal and sparse:path=pattern1 packfiles have same commits/trees' '
337-
git -C r3 verify-pack -v ../all.pack >verify_result &&
338-
grep -E "commit|tree" verify_result |
339-
awk -f print_1.awk |
340-
sort >expected &&
341-
342-
git -C r3 verify-pack -v ../filter.pack >verify_result &&
343-
grep -E "commit|tree" verify_result |
344-
awk -f print_1.awk |
345-
sort >observed &&
346-
347-
test_cmp expected observed
348327
'
349328

350-
test_expect_success 'verify sparse:path=pattern2' '
351-
git -C r3 ls-files -s sparse1 dir1/sparse1 >ls_files_result &&
352-
awk -f print_2.awk ls_files_result |
353-
sort >expected &&
354-
355-
git -C r3 pack-objects --revs --stdout --filter=sparse:path=../pattern2 >filter.pack <<-EOF &&
329+
test_expect_success 'verify sparse:path=pattern2 fails' '
330+
test_must_fail git -C r3 pack-objects --revs --stdout \
331+
--filter=sparse:path=../pattern2 <<-EOF
356332
HEAD
357333
EOF
358-
git -C r3 index-pack ../filter.pack &&
359-
360-
git -C r3 verify-pack -v ../filter.pack >verify_result &&
361-
grep blob verify_result |
362-
awk -f print_1.awk |
363-
sort >observed &&
364-
365-
test_cmp expected observed
366-
'
367-
368-
test_expect_success 'verify normal and sparse:path=pattern2 packfiles have same commits/trees' '
369-
git -C r3 verify-pack -v ../all.pack >verify_result &&
370-
grep -E "commit|tree" verify_result |
371-
awk -f print_1.awk |
372-
sort >expected &&
373-
374-
git -C r3 verify-pack -v ../filter.pack >verify_result &&
375-
grep -E "commit|tree" verify_result |
376-
awk -f print_1.awk |
377-
sort >observed &&
378-
379-
test_cmp expected observed
380334
'
381335

382336
# Test sparse:oid=<oid-ish> filter.
383-
# Like sparse:path, but we get the sparse-checkout specification from
384-
# a blob rather than a file on disk.
337+
# Use a blob containing a sparse-checkout specification to filter
338+
# out blobs not required for the corresponding sparse-checkout. We do not
339+
# require sparse-checkout to actually be enabled.
385340

386341
test_expect_success 'setup r4' '
387342
git init r4 &&

0 commit comments

Comments
 (0)