revision: rename bit to `do_not_die_on_missing_objects`
The bit `do_not_die_on_missing_tree` is used in revision.h to ensure the revision walker does not die when encountering a missing tree. This is currently exclusively set within `builtin/rev-list.c` to ensure the `--missing` option works with missing trees. In the upcoming commits, we will extend `--missing` to also support missing commits. So let's rename the bit to `do_not_die_on_missing_objects`, which is object type agnostic and can be used for both trees/commits. Signed-off-by: Karthik Nayak <karthik.188@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Karthik Nayak committed
Oct 26, 2023 at 12:11 UTC
ca556f47076932a07590c62aad772cfc89491614
4 files changed
+12
-11
builtin/reflog.c
+1
-1
@@ -298,7 +298,7 @@ static int cmd_reflog_expire(int argc, const char **argv, const char *prefix)
298
struct rev_info revs;
299
300
repo_init_revisions(the_repository, &revs, prefix);
301
- revs.do_not_die_on_missing_tree = 1;
301
+ revs.do_not_die_on_missing_objects = 1;
302
revs.ignore_missing = 1;
303
revs.ignore_missing_links = 1;
304
if (verbose)
builtin/rev-list.c
+1
-1
@@ -561,7 +561,7 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix)
561
}
562
563
if (arg_missing_action)
564
- revs.do_not_die_on_missing_tree = 1;
564
+ revs.do_not_die_on_missing_objects = 1;
565
566
argc = setup_revisions(argc, argv, &revs, &s_r_opt);
567
list-objects.c
+1
-1
@@ -177,7 +177,7 @@ static void process_tree(struct traversal_context *ctx,
177
is_promisor_object(&obj->oid))
178
return;
179
180
- if (!revs->do_not_die_on_missing_tree)
180
+ if (!revs->do_not_die_on_missing_objects)
181
die("bad tree object %s", oid_to_hex(&obj->oid));
182
}
183
revision.h
+9
-8
@@ -212,18 +212,19 @@ struct rev_info {
212
213
/*
214
* Blobs are shown without regard for their existence.
215
- * But not so for trees: unless exclude_promisor_objects
215
+ * But not so for trees/commits: unless exclude_promisor_objects
216
* is set and the tree in question is a promisor object;
217
* OR ignore_missing_links is set, the revision walker
218
- * dies with a "bad tree object HASH" message when
219
- * encountering a missing tree. For callers that can
220
- * handle missing trees and want them to be filterable
218
+ * dies with a "bad <type> object HASH" message when
219
+ * encountering a missing object. For callers that can
220
+ * handle missing trees/commits and want them to be filterable
221
* and showable, set this to true. The revision walker
222
- * will filter and show such a missing tree as usual,
223
- * but will not attempt to recurse into this tree
224
- * object.
222
+ * will filter and show such a missing object as usual,
223
+ * but will not attempt to recurse into this tree/commit
224
+ * object. The revision walker will also set the MISSING
225
+ * flag for such objects.
226
*/
226
- do_not_die_on_missing_tree:1,
227
+ do_not_die_on_missing_objects:1,
228
229
/* for internal use only */
230
exclude_promisor_objects:1;