4141#include "promisor-remote.h"
4242#include "pack-mtimes.h"
4343#include "parse-options.h"
44- #include "blob.h"
45- #include "tree.h"
46- #include "path-walk.h"
4744
4845/*
4946 * Objects we are going to pack are collected in the `to_pack` structure.
@@ -221,7 +218,6 @@ static int delta_search_threads;
221218static int pack_to_stdout ;
222219static int sparse ;
223220static int thin ;
224- static int path_walk ;
225221static int num_preferred_base ;
226222static struct progress * progress_state ;
227223
@@ -4281,105 +4277,6 @@ static void mark_bitmap_preferred_tips(void)
42814277 }
42824278}
42834279
4284- static inline int is_oid_interesting (struct repository * repo ,
4285- struct object_id * oid )
4286- {
4287- struct object * o = lookup_object (repo , oid );
4288- return o && !(o -> flags & UNINTERESTING );
4289- }
4290-
4291- static int add_objects_by_path (const char * path ,
4292- struct oid_array * oids ,
4293- enum object_type type ,
4294- void * data )
4295- {
4296- struct object_entry * * delta_list ;
4297- size_t oe_start = to_pack .nr_objects ;
4298- size_t oe_end ;
4299- unsigned int sub_list_size ;
4300- unsigned int * processed = data ;
4301-
4302- /*
4303- * First, add all objects to the packing data, including the ones
4304- * marked UNINTERESTING (translated to 'exclude') as they can be
4305- * used as delta bases.
4306- */
4307- for (size_t i = 0 ; i < oids -> nr ; i ++ ) {
4308- int exclude ;
4309- struct object_info oi = OBJECT_INFO_INIT ;
4310- struct object_id * oid = & oids -> oid [i ];
4311-
4312- /* Skip objects that do not exist locally. */
4313- if (exclude_promisor_objects &&
4314- oid_object_info_extended (the_repository , oid , & oi ,
4315- OBJECT_INFO_FOR_PREFETCH ) < 0 )
4316- continue ;
4317-
4318- exclude = !is_oid_interesting (the_repository , oid );
4319-
4320- if (exclude && !thin )
4321- continue ;
4322-
4323- add_object_entry (oid , type , path , exclude );
4324- }
4325-
4326- oe_end = to_pack .nr_objects ;
4327-
4328- /* We can skip delta calculations if it is a no-op. */
4329- if (oe_end == oe_start || !window )
4330- return 0 ;
4331-
4332- sub_list_size = 0 ;
4333- ALLOC_ARRAY (delta_list , oe_end - oe_start );
4334-
4335- for (size_t i = 0 ; i < oe_end - oe_start ; i ++ ) {
4336- struct object_entry * entry = to_pack .objects + oe_start + i ;
4337-
4338- if (!should_attempt_deltas (entry ))
4339- continue ;
4340-
4341- delta_list [sub_list_size ++ ] = entry ;
4342- }
4343-
4344- /*
4345- * Find delta bases among this list of objects that all match the same
4346- * path. This causes the delta compression to be interleaved in the
4347- * object walk, which can lead to confusing progress indicators. This is
4348- * also incompatible with threaded delta calculations. In the future,
4349- * consider creating a list of regions in the full to_pack.objects array
4350- * that could be picked up by the threaded delta computation.
4351- */
4352- if (sub_list_size && window ) {
4353- QSORT (delta_list , sub_list_size , type_size_sort );
4354- find_deltas (delta_list , & sub_list_size , window , depth , processed );
4355- }
4356-
4357- free (delta_list );
4358- return 0 ;
4359- }
4360-
4361- static void get_object_list_path_walk (struct rev_info * revs )
4362- {
4363- struct path_walk_info info = PATH_WALK_INFO_INIT ;
4364- unsigned int processed = 0 ;
4365-
4366- info .revs = revs ;
4367- info .path_fn = add_objects_by_path ;
4368- info .path_fn_data = & processed ;
4369- revs -> tag_objects = 1 ;
4370-
4371- /*
4372- * Allow the --[no-]sparse option to be interesting here, if only
4373- * for testing purposes. Paths with no interesting objects will not
4374- * contribute to the resulting pack, but only create noisy preferred
4375- * base objects.
4376- */
4377- info .prune_all_uninteresting = sparse ;
4378-
4379- if (walk_objects_by_path (& info ))
4380- die (_ ("failed to pack objects via path-walk" ));
4381- }
4382-
43834280static void get_object_list (struct rev_info * revs , int ac , const char * * av )
43844281{
43854282 struct setup_revision_opt s_r_opt = {
@@ -4426,7 +4323,7 @@ static void get_object_list(struct rev_info *revs, int ac, const char **av)
44264323
44274324 warn_on_object_refname_ambiguity = save_warning ;
44284325
4429- if (use_bitmap_index && !path_walk && ! get_object_list_from_bitmap (revs ))
4326+ if (use_bitmap_index && !get_object_list_from_bitmap (revs ))
44304327 return ;
44314328
44324329 if (use_delta_islands )
@@ -4435,19 +4332,15 @@ static void get_object_list(struct rev_info *revs, int ac, const char **av)
44354332 if (write_bitmap_index )
44364333 mark_bitmap_preferred_tips ();
44374334
4335+ if (prepare_revision_walk (revs ))
4336+ die (_ ("revision walk setup failed" ));
4337+ mark_edges_uninteresting (revs , show_edge , sparse );
4338+
44384339 if (!fn_show_object )
44394340 fn_show_object = show_object ;
4440-
4441- if (path_walk ) {
4442- get_object_list_path_walk (revs );
4443- } else {
4444- if (prepare_revision_walk (revs ))
4445- die (_ ("revision walk setup failed" ));
4446- mark_edges_uninteresting (revs , show_edge , sparse );
4447- traverse_commit_list (revs ,
4448- show_commit , fn_show_object ,
4449- NULL );
4450- }
4341+ traverse_commit_list (revs ,
4342+ show_commit , fn_show_object ,
4343+ NULL );
44514344
44524345 if (unpack_unreachable_expiration ) {
44534346 revs -> ignore_missing_links = 1 ;
@@ -4657,8 +4550,6 @@ int cmd_pack_objects(int argc,
46574550 N_ ("use the sparse reachability algorithm" )),
46584551 OPT_BOOL (0 , "thin" , & thin ,
46594552 N_ ("create thin packs" )),
4660- OPT_BOOL (0 , "path-walk" , & path_walk ,
4661- N_ ("use the path-walk API to walk objects when possible" )),
46624553 OPT_BOOL (0 , "shallow" , & shallow ,
46634554 N_ ("create packs suitable for shallow fetches" )),
46644555 OPT_BOOL (0 , "honor-pack-keep" , & ignore_packed_keep_on_disk ,
@@ -4744,27 +4635,7 @@ int cmd_pack_objects(int argc,
47444635 window = 0 ;
47454636
47464637 strvec_push (& rp , "pack-objects" );
4747-
4748- if (path_walk && filter_options .choice ) {
4749- warning (_ ("cannot use --filter with --path-walk" ));
4750- path_walk = 0 ;
4751- }
4752- if (path_walk && use_delta_islands ) {
4753- warning (_ ("cannot use delta islands with --path-walk" ));
4754- path_walk = 0 ;
4755- }
4756- if (path_walk && shallow ) {
4757- warning (_ ("cannot use --shallow with --path-walk" ));
4758- path_walk = 0 ;
4759- }
4760- if (path_walk ) {
4761- strvec_push (& rp , "--boundary" );
4762- /*
4763- * We must disable the bitmaps because we are removing
4764- * the --objects / --objects-edge[-aggressive] options.
4765- */
4766- use_bitmap_index = 0 ;
4767- } else if (thin ) {
4638+ if (thin ) {
47684639 use_internal_rev_list = 1 ;
47694640 strvec_push (& rp , shallow
47704641 ? "--objects-edge-aggressive"
0 commit comments