Merge branch 'jh/object-filtering'
authorJunio C Hamano <gitster@pobox.com>
Wed, 27 Dec 2017 19:16:20 +0000 (11:16 -0800)
committerJunio C Hamano <gitster@pobox.com>
Wed, 27 Dec 2017 19:16:21 +0000 (11:16 -0800)
In preparation for implementing narrow/partial clone, the object
walking machinery has been taught a way to tell it to "filter" some
objects from enumeration.

* jh/object-filtering:
rev-list: support --no-filter argument
list-objects-filter-options: support --no-filter
list-objects-filter-options: fix 'keword' typo in comment
pack-objects: add list-objects filtering
rev-list: add list-objects filtering support
list-objects: filter objects in traverse_commit_list
oidset: add iterator methods to oidset
oidmap: add oidmap iterator methods
dir: allow exclusions from blob in addition to file

1  2 
Makefile
builtin/pack-objects.c
builtin/rev-list.c
dir.c
dir.h
diff --cc Makefile
Simple merge
index 631de28761e820124299fa2190917e1515a65362,45ad35d9187a9bb89cb3ee14c48bfa5a0d70f33e..6b9cfc289d87b543b747c4024504703a2e0d6641
@@@ -2553,9 -2563,45 +2564,45 @@@ static void show_object(struct object *
        obj->flags |= OBJECT_ADDED;
  }
  
+ static void show_object__ma_allow_any(struct object *obj, const char *name, void *data)
+ {
+       assert(arg_missing_action == MA_ALLOW_ANY);
+       /*
+        * Quietly ignore ALL missing objects.  This avoids problems with
+        * staging them now and getting an odd error later.
+        */
+       if (!has_object_file(&obj->oid))
+               return;
+       show_object(obj, name, data);
+ }
+ static int option_parse_missing_action(const struct option *opt,
+                                      const char *arg, int unset)
+ {
+       assert(arg);
+       assert(!unset);
+       if (!strcmp(arg, "error")) {
+               arg_missing_action = MA_ERROR;
+               fn_show_object = show_object;
+               return 0;
+       }
+       if (!strcmp(arg, "allow-any")) {
+               arg_missing_action = MA_ALLOW_ANY;
+               fn_show_object = show_object__ma_allow_any;
+               return 0;
+       }
+       die(_("invalid value for --missing"));
+       return 0;
+ }
  static void show_edge(struct commit *commit)
  {
 -      add_preferred_base(commit->object.oid.hash);
 +      add_preferred_base(&commit->object.oid);
  }
  
  struct in_pack_object {
Simple merge
diff --cc dir.c
Simple merge
diff --cc dir.h
Simple merge