Skip to content

Reference iterators

Michael Haggerty git 3 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest13 patches 0 repliesNew
  2. v213 patches 9 repliesSuperseded
  3. v113 patches 13 repliesSuperseded

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/13refs: remove unnecessary "extern" keywordsrefs.h+72 -600 replies
2/13do_for_each_ref(): move docstring to the header filerefs/files-backend.c refs/refs-internal.h+9 -100 replies
3/13refs: use name "prefix" consistentlyrefs/files-backend.c refs/refs-internal.h+19 -190 replies
4/13delete_refs(): add a flags argumentbuiltin/fetch.c builtin/remote.c refs.h +1 more+8 -70 replies
5/13remote rm: handle symbolic refs correctlybuiltin/remote.c+1 -50 replies
6/13get_ref_cache(): only create an instance if there is a submodulerefs/files-backend.c+22 -110 replies
7/13entry_resolves_to_object(): rename function from ref_resolves_to_object()refs/files-backend.c+3 -30 replies
8/13ref_resolves_to_object(): new functionrefs/files-backend.c+23 -100 replies
9/13refs: introduce an iterator interfaceMakefile iterator.h refs.h +3 more+915 -10 replies
10/13do_for_each_ref(): reimplement using reference iterationrefs.c refs/files-backend.c refs/iterator.c +1 more+76 -2120 replies
11/13for_each_reflog(): don't abort for bad referencesrefs/files-backend.c+1 -10 replies
12/13dir_iterator: new API for iterating over a directory treeMakefile dir-iterator.c dir-iterator.h+290 -00 replies
13/13for_each_reflog(): reimplement using iteratorsrefs/files-backend.c refs/refs-internal.h+78 -420 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCH v3 00/13] Reference iterators

This is the reroll of branch mh/ref-iterators promised and discussed earlier [1]. There are no showstoppers here, but it would be preferable to merge this version rather than v2.

This version squashes in Ramsay's patch [2], addresses Eric's comments, and incorporates the whitespace fix that you made when incorporating v2.

List of changes relative to v2:

* In "refs: introduce an iterator interface":

* Make two vtables private.

* Add a whitespace fix from Junio's mh/ref-iterators.

* In "dir_iterator: new API for iterating over a directory tree":

* Add and improve some comments and docstrings.

* Fix some formatting problems.

* Use a for rather than a while loop in dir_iterator_abort() to improve the clarity.

* Warn on failures of opendir(), readdir(), and closedir() that can't be explained as a simple race.

* In "for_each_reflog(): reimplement using iterators", make the vtable private.

These changes are also available from my GitHub fork [3] as branch "ref-iterators".

Michael

[1] http://article.gmane.org/gmane.comp.version-control.git/296883
[2] http://thread.gmane.org/gmane.comp.version-control.git/296801
[3] https://github.com/mhagger/git

Michael Haggerty (13):
refs: remove unnecessary "extern" keywords do_for_each_ref(): move docstring to the header file
refs: use name "prefix" consistently
delete_refs(): add a flags argument
remote rm: handle symbolic refs correctly get_ref_cache(): only create an instance if there is a submodule entry_resolves_to_object(): rename function from
ref_resolves_to_object()
ref_resolves_to_object(): new function
refs: introduce an iterator interface do_for_each_ref(): reimplement using reference iteration for_each_reflog(): don't abort for bad references
dir_iterator: new API for iterating over a directory tree for_each_reflog(): reimplement using iterators

 Makefile             |   2 +
 builtin/fetch.c      |   2 +-
 builtin/remote.c     |   8 +-
 dir-iterator.c       | 202 +++++++++++++++++
 dir-iterator.h       |  87 +++++++
 iterator.h           |  81 +++++++
 refs.c               |  20 ++
 refs.h               | 139 +++++++-----
 refs/files-backend.c | 629 +++++++++++++++++++++++++++++++--------------------
 refs/iterator.c      | 384 +++++++++++++++++++++++++++++++
 refs/refs-internal.h | 226 +++++++++++++++++-
 11 files changed, 1458 insertions(+), 322 deletions(-)
 create mode 100644 dir-iterator.c
 create mode 100644 dir-iterator.h
 create mode 100644 iterator.h
 create mode 100644 refs/iterator.c
Signature · 1 line
2.8.1