Skip to content

Commit 93318cb

Browse files
committed
Rename "refilter" to "repair"
1 parent f5b5cf9 commit 93318cb

File tree

10 files changed

+40
-39
lines changed

10 files changed

+40
-39
lines changed

Documentation/fetch-options.txt

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -163,12 +163,13 @@ endif::git-pull[]
163163
setting. See linkgit:git-config[1].
164164

165165
ifndef::git-pull[]
166-
--refilter::
167-
Reapply a partial clone filter from configuration or `--filter=`, such
168-
as when the filter definition has changed. Instead of negotiating with
169-
the server to avoid transferring commits and associated objects that are
170-
already present locally, this option fetches all objects that match the
171-
filter.
166+
--repair::
167+
Fetch all objects that match the filter, regardless of current state.
168+
Can be used to reapply a partial clone filter from configuration or
169+
`--filter=`, such as when the filter definition has changed. Instead of
170+
negotiating with the server to avoid transferring commits and associated
171+
objects that are already present locally, this option fetches all objects
172+
that match the filter.
172173
endif::git-pull[]
173174

174175
--refmap=<refspec>::

Documentation/technical/partial-clone.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ Fetching Missing Objects
181181
currently fetches all objects referred to by the requested objects, even
182182
though they are not necessary.
183183

184-
- Fetching with `--refilter` will request a complete new filtered packfile from
184+
- Fetching with `--repair` will request a complete new filtered packfile from
185185
the remote, which can be used to change a filter without needing to
186186
dynamically fetch missing objects.
187187

builtin/fetch-pack.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,8 @@ int cmd_fetch_pack(int argc, const char **argv, const char *prefix)
155155
args.from_promisor = 1;
156156
continue;
157157
}
158-
if (!strcmp("--refilter", arg)) {
159-
args.refilter = 1;
158+
if (!strcmp("--repair", arg)) {
159+
args.repair = 1;
160160
continue;
161161
}
162162
if (skip_prefix(arg, ("--" CL_ARG__FILTER "="), &arg)) {

builtin/fetch.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ static int prune_tags = -1; /* unspecified */
5858

5959
static int all, append, dry_run, force, keep, multiple, update_head_ok;
6060
static int write_fetch_head = 1;
61-
static int verbosity, deepen_relative, set_upstream, refilter;
61+
static int verbosity, deepen_relative, set_upstream, repair;
6262
static int progress = -1;
6363
static int enable_auto_gc = 1;
6464
static int tags = TAGS_DEFAULT, unshallow, update_shallow, deepen;
@@ -188,7 +188,7 @@ static struct option builtin_fetch_options[] = {
188188
OPT_SET_INT_F(0, "unshallow", &unshallow,
189189
N_("convert to a complete repository"),
190190
1, PARSE_OPT_NONEG),
191-
OPT_SET_INT_F(0, "refilter", &refilter,
191+
OPT_SET_INT_F(0, "repair", &repair,
192192
N_("re-fetch with a modified filter"),
193193
1, PARSE_OPT_NONEG),
194194
{ OPTION_STRING, 0, "submodule-prefix", &submodule_prefix, N_("dir"),
@@ -1288,13 +1288,13 @@ static int check_exist_and_connected(struct ref *ref_map)
12881288
return -1;
12891289

12901290
/*
1291-
* Similarly, if we need to refilter a partial clone we already have
1291+
* Similarly, if we need to repair a partial clone we already have
12921292
* these commits reachable. Running rev-list here will return with
12931293
* a good (0) exit status and we'll bypass the fetch that we
12941294
* really need to perform. Claiming failure now will ensure
12951295
* we perform the network exchange to reapply the filter.
12961296
*/
1297-
if (refilter)
1297+
if (repair)
12981298
return -1;
12991299

13001300

@@ -1493,8 +1493,8 @@ static struct transport *prepare_transport(struct remote *remote, int deepen)
14931493
set_option(transport, TRANS_OPT_DEEPEN_RELATIVE, "yes");
14941494
if (update_shallow)
14951495
set_option(transport, TRANS_OPT_UPDATE_SHALLOW, "yes");
1496-
if (refilter)
1497-
set_option(transport, TRANS_OPT_REFILTER, "yes");
1496+
if (repair)
1497+
set_option(transport, TRANS_OPT_REPAIR, "yes");
14981498
if (filter_options.choice) {
14991499
const char *spec =
15001500
expand_list_objects_filter_spec(&filter_options);

fetch-pack.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ static int find_common(struct fetch_negotiator *negotiator,
311311
const char *remote_hex;
312312
struct object *o;
313313

314-
if (!args->refilter) {
314+
if (!args->repair) {
315315
/*
316316
* If that object is complete (i.e. it is an ancestor of a
317317
* local ref), we tell them we have it but do not have to
@@ -695,7 +695,7 @@ static void mark_complete_and_common_ref(struct fetch_negotiator *negotiator,
695695

696696
save_commit_buffer = 0;
697697

698-
if (args->refilter)
698+
if (args->repair)
699699
return;
700700

701701
trace2_region_enter("fetch-pack", "parse_remote_refs_and_find_cutoff", NULL);
@@ -1024,7 +1024,7 @@ static struct ref *do_fetch_pack(struct fetch_pack_args *args,
10241024
int agent_len;
10251025
struct fetch_negotiator negotiator_alloc;
10261026
struct fetch_negotiator *negotiator;
1027-
unsigned is_refiltering = 0;
1027+
unsigned is_repairing = 0;
10281028

10291029
sort_ref_list(&ref, ref_compare_name);
10301030
QSORT(sought, nr_sought, cmp_ref_by_name);
@@ -1094,12 +1094,12 @@ static struct ref *do_fetch_pack(struct fetch_pack_args *args,
10941094
if (server_supports("filter")) {
10951095
server_supports_filtering = 1;
10961096
print_verbose(args, _("Server supports %s"), "filter");
1097-
} else if (args->filter_options.choice || args->refilter) {
1097+
} else if (args->filter_options.choice || args->repair) {
10981098
warning("filtering not recognized by server, ignoring");
10991099
}
11001100

1101-
if (server_supports_filtering && args->refilter) {
1102-
is_refiltering = 1;
1101+
if (server_supports_filtering && args->repair) {
1102+
is_repairing = 1;
11031103
}
11041104

11051105
if (server_supports("deepen-since")) {
@@ -1120,15 +1120,15 @@ static struct ref *do_fetch_pack(struct fetch_pack_args *args,
11201120
die(_("Server does not support this repository's object format"));
11211121

11221122
negotiator = &negotiator_alloc;
1123-
if (is_refiltering) {
1123+
if (is_repairing) {
11241124
fetch_negotiator_init_noop(negotiator);
11251125
} else {
11261126
fetch_negotiator_init(r, negotiator);
11271127
}
11281128

11291129
mark_complete_and_common_ref(negotiator, args, &ref);
11301130
filter_refs(args, &ref, sought, nr_sought);
1131-
if (!is_refiltering && everything_local(args, &ref)) {
1131+
if (!is_repairing && everything_local(args, &ref)) {
11321132
packet_flush(fd[1]);
11331133
goto all_done;
11341134
}
@@ -1586,7 +1586,7 @@ static struct ref *do_fetch_pack_v2(struct fetch_pack_args *args,
15861586
struct strvec index_pack_args = STRVEC_INIT;
15871587

15881588
negotiator = &negotiator_alloc;
1589-
if (args->refilter)
1589+
if (args->repair)
15901590
fetch_negotiator_init_noop(negotiator);
15911591
else
15921592
fetch_negotiator_init(r, negotiator);
@@ -1615,7 +1615,7 @@ static struct ref *do_fetch_pack_v2(struct fetch_pack_args *args,
16151615
/* Filter 'ref' by 'sought' and those that aren't local */
16161616
mark_complete_and_common_ref(negotiator, args, &ref);
16171617
filter_refs(args, &ref, sought, nr_sought);
1618-
if (!args->refilter && everything_local(args, &ref))
1618+
if (!args->repair && everything_local(args, &ref))
16191619
state = FETCH_DONE;
16201620
else
16211621
state = FETCH_SEND_REQUEST;

fetch-pack.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ struct fetch_pack_args {
4242
unsigned update_shallow:1;
4343
unsigned reject_shallow_remote:1;
4444
unsigned deepen:1;
45-
unsigned refilter:1;
45+
unsigned repair:1;
4646

4747
/*
4848
* Indicate that the remote of this request is a promisor remote. The

t/t5616-partial-clone.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -184,23 +184,23 @@ test_expect_success 'push new commits to server for file.4.txt' '
184184
git -C src push -u srv main
185185
'
186186

187-
# Do partial fetch to fetch smaller files; then verify that without --refilter
187+
# Do partial fetch to fetch smaller files; then verify that without --repair
188188
# applying a new filter does not refetch missing large objects. Then use
189-
# --refilter to apply the new filter on existing commits. Test it under both
189+
# --repair to apply the new filter on existing commits. Test it under both
190190
# protocol v2 & v0.
191-
test_expect_success 'apply a different filter using --refilter' '
191+
test_expect_success 'apply a different filter using --repair' '
192192
git -C pc1 fetch --filter=blob:limit=999 origin &&
193193
git -C pc1 rev-list --quiet --objects --missing=print \
194194
main..origin/main >observed &&
195195
test_line_count = 4 observed &&
196196
197-
git -C pc1 fetch --filter=blob:limit=19999 --refilter origin &&
197+
git -C pc1 fetch --filter=blob:limit=19999 --repair origin &&
198198
git -C pc1 rev-list --quiet --objects --missing=print \
199199
main..origin/main >observed &&
200200
test_line_count = 2 observed &&
201201
202202
git -c protocol.version=0 -C pc1 fetch --filter=blob:limit=29999 \
203-
--refilter origin &&
203+
--repair origin &&
204204
git -C pc1 rev-list --quiet --objects --missing=print \
205205
main..origin/main >observed &&
206206
test_line_count = 0 observed

transport-helper.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -739,8 +739,8 @@ static int fetch_refs(struct transport *transport,
739739
if (data->transport_options.update_shallow)
740740
set_helper_option(transport, "update-shallow", "true");
741741

742-
if (data->transport_options.refilter)
743-
set_helper_option(transport, "refilter", "true");
742+
if (data->transport_options.repair)
743+
set_helper_option(transport, "repair", "true");
744744

745745
if (data->transport_options.filter_options.choice) {
746746
const char *spec = expand_list_objects_filter_spec(

transport.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,8 @@ static int set_git_option(struct git_transport_options *opts,
243243
list_objects_filter_die_if_populated(&opts->filter_options);
244244
parse_list_objects_filter(&opts->filter_options, value);
245245
return 0;
246-
} else if (!strcmp(name, TRANS_OPT_REFILTER)) {
247-
opts->refilter = !!value;
246+
} else if (!strcmp(name, TRANS_OPT_REPAIR)) {
247+
opts->repair = !!value;
248248
return 0;
249249
} else if (!strcmp(name, TRANS_OPT_REJECT_SHALLOW)) {
250250
opts->reject_shallow = !!value;
@@ -380,7 +380,7 @@ static int fetch_refs_via_pack(struct transport *transport,
380380
args.update_shallow = data->options.update_shallow;
381381
args.from_promisor = data->options.from_promisor;
382382
args.filter_options = data->options.filter_options;
383-
args.refilter = data->options.refilter;
383+
args.repair = data->options.repair;
384384
args.stateless_rpc = transport->stateless_rpc;
385385
args.server_options = transport->server_options;
386386
args.negotiation_tips = data->options.negotiation_tips;

transport.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ struct git_transport_options {
1616
unsigned update_shallow : 1;
1717
unsigned reject_shallow : 1;
1818
unsigned deepen_relative : 1;
19-
unsigned refilter : 1;
19+
unsigned repair : 1;
2020

2121
/* see documentation of corresponding flag in fetch-pack.h */
2222
unsigned from_promisor : 1;
@@ -217,8 +217,8 @@ void transport_check_allowed(const char *type);
217217
/* Filter objects for partial clone and fetch */
218218
#define TRANS_OPT_LIST_OBJECTS_FILTER "filter"
219219

220-
/* Refilter a previous partial clone */
221-
#define TRANS_OPT_REFILTER "refilter"
220+
/* Fetch everything that matches filter, regardless of current state */
221+
#define TRANS_OPT_REPAIR "repair"
222222

223223
/* Request atomic (all-or-nothing) updates when pushing */
224224
#define TRANS_OPT_ATOMIC "atomic"

0 commit comments

Comments
 (0)