]> granicus.if.org Git - git/commitdiff
Merge branch 'jk/for-each-object-iteration'
authorJunio C Hamano <gitster@pobox.com>
Mon, 20 Aug 2018 18:33:52 +0000 (11:33 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 20 Aug 2018 18:33:52 +0000 (11:33 -0700)
The API to iterate over all objects learned to optionally list
objects in the order they appear in packfiles, which helps locality
of access if the caller accesses these objects while as objects are
enumerated.

* jk/for-each-object-iteration:
  for_each_*_object: move declarations to object-store.h
  cat-file: use a single strbuf for all output
  cat-file: split batch "buf" into two variables
  cat-file: use oidset check-and-insert
  cat-file: support "unordered" output for --batch-all-objects
  cat-file: rename batch_{loose,packed}_object callbacks
  t1006: test cat-file --batch-all-objects with duplicates
  for_each_packed_object: support iterating in pack-order
  for_each_*_object: give more comprehensive docstrings
  for_each_*_object: take flag arguments as enum
  for_each_*_object: store flag definitions in a single location

1  2 
cache.h
commit-graph.c
packfile.h
sha1-file.c

diff --cc cache.h
Simple merge
diff --cc commit-graph.c
index 0034740c26b48eda147d45258505df278b84cc0a,69a0d1c203c7093a9abe06d488b1a382cd0d6ca9..8a1bec7b8aa420dd3d4ecadc95dee31029533c07
@@@ -727,10 -727,10 +727,10 @@@ void write_commit_graph(const char *obj
                        strbuf_addstr(&packname, pack_indexes->items[i].string);
                        p = add_packed_git(packname.buf, packname.len, 1);
                        if (!p)
 -                              die("error adding pack %s", packname.buf);
 +                              die(_("error adding pack %s"), packname.buf);
                        if (open_pack_index(p))
 -                              die("error opening index for %s", packname.buf);
 +                              die(_("error opening index for %s"), packname.buf);
-                       for_each_object_in_pack(p, add_packed_commits, &oids);
+                       for_each_object_in_pack(p, add_packed_commits, &oids, 0);
                        close_pack(p);
                }
                strbuf_release(&packname);
diff --cc packfile.h
Simple merge
diff --cc sha1-file.c
Simple merge