This series lays the groundwork for caching Repository instances within the JRE, such as a server daemon might want when it is accessing multiple repositories, like a git:// daemon needs to do. We also modify the way alternates are handled, checking to see if an alternate is actually an objects directory for a Repository, and if so, using the Repository instance from the cache in the alternate chain. This permits better reuse of pack files windows when repositories are using alternates. Based on this support we can also now implement the ".have" logic in the ReceivePack server code. I plan to follow onto this series with work to support submodules in a server setting, e.g. processing the .gitmodules directly from the object database and being able to examine the submodule Repository. Shawn O. Pearce (11): Change Daemon to use concurrent collections for exported repositories Make Daemon's exportAll check not require synchronization Don't retry ".git" suffix in daemon if already tried Refactor ref advertisement code from server implementations Don't advertise HEAD from ReceivePack Add a use reference counter to Repository Introduce RepositoryCache to cache handles of Repository objects Change Daemon to use RepositoryCache Expose the Repository's ObjectDatabase object Use cached Repository instances when resolving alternates Send .have lines in ReceivePack for alternate repositories .../org/spearce/jgit/lib/RepositoryCacheTest.java | 126 +++++++ .../org/spearce/jgit/lib/RepositoryTestCase.java | 16 +- .../jgit/errors/RepositoryNotFoundException.java | 65 ++++ .../jgit/lib/AlternateRepositoryDatabase.java | 127 +++++++ .../src/org/spearce/jgit/lib/ObjectDatabase.java | 16 +- .../src/org/spearce/jgit/lib/ObjectDirectory.java | 18 +- .../src/org/spearce/jgit/lib/Repository.java | 18 +- .../src/org/spearce/jgit/lib/RepositoryCache.java | 386 ++++++++++++++++++++ .../src/org/spearce/jgit/transport/Daemon.java | 76 ++--- .../org/spearce/jgit/transport/DaemonService.java | 14 +- .../org/spearce/jgit/transport/ReceivePack.java | 67 +--- .../org/spearce/jgit/transport/RefAdvertiser.java | 189 ++++++++++ .../src/org/spearce/jgit/transport/UploadPack.java | 93 +----- 13 files changed, 1019 insertions(+), 192 deletions(-) create mode 100644 org.spearce.jgit.test/tst/org/spearce/jgit/lib/RepositoryCacheTest.java create mode 100644 org.spearce.jgit/src/org/spearce/jgit/errors/RepositoryNotFoundException.java create mode 100644 org.spearce.jgit/src/org/spearce/jgit/lib/AlternateRepositoryDatabase.java create mode 100644 org.spearce.jgit/src/org/spearce/jgit/lib/RepositoryCache.java create mode 100644 org.spearce.jgit/src/org/spearce/jgit/transport/RefAdvertiser.java -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html