Re: [PATCH 4/4] packed refs: pass .git dir instead of packed-refs path to init_fn

2017-09-13 Thread Richard Maw
ject representing a physical `ref_store`. Different > reference store classes might have different "constructor" arguments. > For example, if it represents a namespace within a larger reference tree > contained in a shared repository, its arguments might be > `(shared_gitdir, na

Re: [RFC PATCH 0/7] Implement ref namespaces as a ref storage backend

2017-08-30 Thread Richard Maw
On Thu, Aug 24, 2017 at 06:17:07PM +0200, Michael Haggerty wrote: > On Sun, Aug 13, 2017 at 9:36 PM, Richard Maw wrote: > > [...] > > Fortunately the pluggable ref backends work provided an easier starting > > point. > > :-) I'm glad my years-long obsession is fi

Re: [PATCH v4 12/16] files-backend: make reflog iterator go through per-worktree reflog

2017-08-24 Thread Richard Maw
On Wed, Aug 23, 2017 at 07:37:00PM +0700, Nguyễn Thái Ngọc Duy wrote: > refs/bisect is unfortunately per-worktree, so we need to look in > per-worktree logs/refs/bisect in addition to per-repo logs/refs. The > current iterator only goes through per-repo logs/refs. > > Use merge iterator to walk tw

Re: [RFC PATCH 0/7] Implement ref namespaces as a ref storage backend

2017-08-24 Thread Richard Maw
On Tue, Aug 15, 2017 at 10:13:22AM -0700, Junio C Hamano wrote: > Richard Maw writes: > > > This is not my first attempt to improve the git namespace handling in git. > > I tried last year, but it took me so long that all the ref handling code > > changed > > and

[RFC PATCH 0/7] Implement ref namespaces as a ref storage backend

2017-08-13 Thread Richard Maw
s/bisect, but those refs can't be found in iteration because the files backend walks the refs in the common dir rather than the refs in the git dir, and the simple workaround in loose_fill_ref_dir doesn't work. Richard Maw (7): Expose expand_namespace API Add git_con

[PATCH 2/7] Add git_configset_add_standard

2017-08-13 Thread Richard Maw
This exposes implementation details of repo_read_config so a configset can be populated with a repository's standard config, without needing to create a full repository. This allows config lookup to use the same codepath whether the repository is ready or not, which allows it to be used during git

[PATCH 3/7] Add helper for skipping namespace prefixes

2017-08-13 Thread Richard Maw
Normally your own namespace is known and you only need to skip that prefix, but when you need to classify the type of a ref it helps to be able to consider what type of ref it would be if it were outside of a namespace. --- git-compat-util.h | 19 +++ 1 file changed, 19 insertions(

[PATCH 4/7] Autocreate reflogs for namespaced refs

2017-08-13 Thread Richard Maw
Since refs are classified based on their prefix but namespaces have their own prefix, it's necessary to skip that prefix to classify their remaining prefix. --- refs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/refs.c b/refs.c index ba22f4a..2e8bace 100644 --- a/refs.c +++ b/refs.c @@ -69

[PATCH 6/7] Add namespaced ref backend

2017-08-13 Thread Richard Maw
--- Makefile | 1 + refs/namespaced-backend.c | 619 ++ refs/refs-internal.h | 1 + 3 files changed, 621 insertions(+) create mode 100644 refs/namespaced-backend.c diff --git a/Makefile b/Makefile index 461c845..0c417c3 100644

[PATCH 7/7] Plumb in namespaced ref store

2017-08-13 Thread Richard Maw
--- refs.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/refs.c b/refs.c index 9a3dcfb..e80244f 100644 --- a/refs.c +++ b/refs.c @@ -647,7 +647,6 @@ int refs_delete_ref(struct ref_store *refs, const char *msg, struct strbuf err = STRBUF_INIT; if (ref_ty

[PATCH 5/7] Treat namespaced HEAD and refs/bisect as per-worktree

2017-08-13 Thread Richard Maw
--- refs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/refs.c b/refs.c index 2e8bace..9a3dcfb 100644 --- a/refs.c +++ b/refs.c @@ -536,6 +536,7 @@ int dwim_log(const char *str, int len, unsigned char *sha1, char **log) static int is_per_worktree_ref(const char *refname) { + (voi

[PATCH 1/7] Expose expand_namespace API

2017-08-13 Thread Richard Maw
Namespaces will not only be settable with GIT_NAMESPACE, so this previously internal helper needs to be made available to other code. --- cache.h | 1 + environment.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/cache.h b/cache.h index 71fe092..e01b8a2 100644 --- a/c

Some issues when trying to set up a shallow git mirror server

2016-01-07 Thread Richard Maw
Hi all. I've been working on a service that mirrors open source code into git, (http://git.baserock.org/cgi-bin/cgit.cgi/?q=delta if interested). Some repositories are too unwieldy to mirror the whole history, so we're looking at shallow support, by fetching specified branches with `--depth=1`.