Re: [PATCH v3 25/44] refs.h: document make refname_is_safe and add it to header

2015-10-13 Thread David Turner
On Tue, 2015-10-13 at 11:18 +0200, Michael Haggerty wrote: > On 10/13/2015 09:33 AM, Michael Haggerty wrote: > > On 10/12/2015 11:51 PM, David Turner wrote: > >> This function might be used by other refs backends > >> > >> Signed-off-by: Da

Re: [PATCH v3 05/44] refs.c: move update_ref to refs.c

2015-10-13 Thread David Turner
On Tue, 2015-10-13 at 05:41 +0200, Michael Haggerty wrote: > If its removal was intentional, it deserves a careful explanation (and > should probably be done as a separate commit). If it was an accident, > please consider how this accident arose and try to think about whether > similar accidents

Re: [PATCH v3 02/44] refs: make repack_without_refs and is_branch public

2015-10-13 Thread David Turner
On Tue, 2015-10-13 at 09:23 +0200, Michael Haggerty wrote: > On 10/13/2015 04:39 AM, Michael Haggerty wrote: > > On 10/12/2015 11:51 PM, David Turner wrote: > >> is_branch was already non-static, but this patch declares it in the > >> header. > >> > &

Re: [PATCH v3 18/44] refs: move transaction functions into common code

2015-10-13 Thread David Turner
On Tue, 2015-10-13 at 13:29 +0200, Michael Haggerty wrote: > I reviewed the patches up to here pretty carefully, and aside from the > comments I already sent, they look good. > > I like the new approach where the ref_transaction-building code is > shared across backends. > > It seems to me that

Re: [PATCH v3 18/44] refs: move transaction functions into common code

2015-10-13 Thread David Turner
On Tue, 2015-10-13 at 18:21 -0400, David Turner wrote: > On Tue, 2015-10-13 at 13:29 +0200, Michael Haggerty wrote: > > I reviewed the patches up to here pretty carefully, and aside from the > > comments I already sent, they look good. > > > > I like the new approac

Re: [PATCH v3 05/44] refs.c: move update_ref to refs.c

2015-10-13 Thread David Turner
On Tue, 2015-10-13 at 05:41 +0200, Michael Haggerty wrote: > The original read > > if (read_ref(pseudoref, actual_old_sha1)) > die("could not read ref '%s'", pseudoref); > > This seems like an important test. What happened to it? > > If its removal was

[PATCH v3 01/44] refs.c: create a public version of verify_refname_available

2015-10-12 Thread David Turner
From: Ronnie Sahlberg <sahlb...@google.com> Create a public version of verify_refname_available that backends can provide. Signed-off-by: Ronnie Sahlberg <sahlb...@google.com> Signed-off-by: David Turner <dtur...@twopensource.com>

[PATCH v3 05/44] refs.c: move update_ref to refs.c

2015-10-12 Thread David Turner
<sahlb...@google.com> Signed-off-by: David Turner <dtur...@twopensource.com> --- refs-be-files.c | 117 +--- refs.c | 115 +++ 2 files changed, 116 insertions(+), 116 deleti

[PATCH v3 10/44] refs.c: move warn_if_dangling_symref* to the common code

2015-10-12 Thread David Turner
From: Ronnie Sahlberg <sahlb...@google.com> These functions do not use any backend specific code so we move them to the common code. Signed-off-by: Ronnie Sahlberg <sahlb...@google.com> Signed-off-by: David Turner <dtur...@twopensource.com> --- re

[PATCH v3 18/44] refs: move transaction functions into common code

2015-10-12 Thread David Turner
ref_update to support alternate backends. Signed-off-by: David Turner <dtur...@twopensource.com> --- refs-be-files.c | 198 refs.c | 108 +++ refs.h | 91 +- 3

[PATCH v3 20/44] refs-be-files.c: add methods for misc ref operations

2015-10-12 Thread David Turner
From: Ronnie Sahlberg <sahlb...@google.com> Add ref backend methods for: resolve_ref_unsafe, verify_refname_available, pack_refs, peel_ref, create_symref, resolve_gitlink_ref. Signed-off-by: Ronnie Sahlberg <sahlb...@google.com> Signed-off-by: David Turner <dtur...@twitter.com>

[PATCH v3 32/44] initdb: move safe_create_dir into common code

2015-10-12 Thread David Turner
In a moment, we'll create initdb functions for ref backends, and code from initdb that calls this function needs to move into the files backend. So this function needs to be public. Signed-off-by: David Turner <dtur...@twopensource.com> --- builtin/init-db.c | 12 c

[PATCH v3 26/44] refs.c: move copy_msg to the common code

2015-10-12 Thread David Turner
Rename copy_msg to copy_reflog_msg and make it public. Signed-off-by: David Turner <dtur...@twopensource.com> --- refs-be-files.c | 28 +--- refs.c | 26 ++ refs.h | 2 ++ 3 files changed, 29 insertions(+), 27 deletions(-)

[PATCH v3 06/44] refs.c: move delete_ref and delete_refs to the common code

2015-10-12 Thread David Turner
From: Ronnie Sahlberg <sahlb...@google.com> Move delete_pseudoref, delete_ref() and delete_refs() to the refs.c file since these functions do not contain any backend specific code. Based on a patch by Ronnie Sahlberg. Signed-off-by: David Turner <dtur...@twopensource.com> Signed-of

[PATCH v3 21/44] refs-be-files.c: add methods for the ref iterators

2015-10-12 Thread David Turner
From: Ronnie Sahlberg <sahlb...@google.com> Signed-off-by: Ronnie Sahlberg <sahlb...@google.com> Signed-off-by: David Turner <dtur...@twopensource.com> --- refs-be-files.c | 41 -- re

[PATCH v3 19/44] refs-be-files.c: add a backend method structure with transaction functions

2015-10-12 Thread David Turner
<sahlb...@google.com> Signed-off-by: David Turner <dtur...@twopensource.com> --- refs-be-files.c | 10 -- refs.c | 30 ++ refs.h | 15 +++ 3 files changed, 53 insertions(+), 2 deletions(-) diff --git a/refs-be-files.c b/ref

[PATCH v3 03/44] refs-be-files.c: rename refs to refs-be-files

2015-10-12 Thread David Turner
From: Ronnie Sahlberg Rename refs.c to refs-be-files.c to indicate that this file now holds the implementation for the files based refs backend. A smaller portion of the code in this file is backend agnostic and will be moved to a a new refs.c file that will hold all the

[PATCH v3 19/44] refs: add a backend method structure with transaction functions

2015-10-12 Thread David Turner
<sahlb...@google.com> Signed-off-by: David Turner <dtur...@twopensource.com> --- refs-be-files.c | 10 -- refs.c | 30 ++ refs.h | 15 +++ 3 files changed, 53 insertions(+), 2 deletions(-) diff --git a/refs-be-files.c b/ref

[PATCH v3 07/44] refs.c: move read_ref_at to the common refs file

2015-10-12 Thread David Turner
From: Ronnie Sahlberg <sahlb...@google.com> Move read_ref_at() to the refs.c file since this function does not contain any backend specific code. Signed-off-by: Ronnie Sahlberg <sahlb...@google.com> Signed-off-by: David Turner <dtur...@twopensource.com> --- ref

[PATCH v3 23/44] refs-be-files.c: add do_for_each_per_worktree_ref

2015-10-12 Thread David Turner
Alternate refs backends might still use files to store per-worktree refs. So the files backend's ref-loading infrastructure should be available to those backends, just for use on per-worktree refs. Add do_for_each_per_worktree_ref, which iterates over per-worktree refs. Signed-off-by: David

[PATCH v3 28/44] refs.c: move should_autocreate_reflog to common code

2015-10-12 Thread David Turner
Signed-off-by: David Turner <dtur...@twopensource.com> --- refs-be-files.c | 10 -- refs.c | 10 ++ refs.h | 2 ++ 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/refs-be-files.c b/refs-be-files.c index bf2fd7a..73111e7 100644 ---

[PATCH v3 30/44] refs.c: add methods for reflog

2015-10-12 Thread David Turner
In the file-based backend, the reflog piggybacks on the ref lock. Since other backends won't have the same sort of ref lock, ref backends must also handle reflogs. Signed-off-by: Ronnie Sahlberg <rsahlb...@google.com> Signed-off-by: David Turner <dtur...@twopensource.com> --- ref

[PATCH v3 27/44] refs.c: move peel_object to the common code

2015-10-12 Thread David Turner
This function does not contain any backend specific code so we move it to the common code. Signed-off-by: David Turner <dtur...@twopensource.com> --- refs-be-files.c | 53 - refs.c | 31 +++

[PATCH v3 34/44] refs-be-files.c: add method to rename refs

2015-10-12 Thread David Turner
We also have to make rename_ref_available public, since alternate backends for rename_ref will need it. Signed-off-by: David Turner <dtur...@twopensource.com> --- refs-be-files.c | 20 +++- refs.c | 21 + refs.h | 7 ++- 3 files c

[PATCH v3 11/44] refs.c: move read_ref, read_ref_full and ref_exists to the common code

2015-10-12 Thread David Turner
From: Ronnie Sahlberg <sahlb...@google.com> These functions do not depend on the backend implementation so we move them to the common code. Signed-off-by: Ronnie Sahlberg <sahlb...@google.com> Signed-off-by: David Turner <dtur...@twopensource.com> --- re

[PATCH v3 14/44] refs.c: move is_branch to the common code

2015-10-12 Thread David Turner
From: Ronnie Sahlberg <sahlb...@google.com> Signed-off-by: Ronnie Sahlberg <sahlb...@google.com> Signed-off-by: David Turner <dtur...@twopensource.com> --- refs-be-files.c | 5 - refs.c | 5 + 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/refs

Re: [PATCH v3 19/44] refs-be-files.c: add a backend method structure with transaction functions

2015-10-12 Thread David Turner
Please disregard this one; I rewrorded the commit message and forgot to delete this patch. On Mon, 2015-10-12 at 17:51 -0400, David Turner wrote: > From: Ronnie Sahlberg <sahlb...@google.com> > > Add a ref structure for backend methods. Start by adding a method pointer > f

[PATCH v3 13/44] refs.c: move check_refname_format to the common code

2015-10-12 Thread David Turner
From: Ronnie Sahlberg <sahlb...@google.com> This function does not contain any backend specific code so we move it to the common code. Signed-off-by: Ronnie Sahlberg <sahlb...@google.com> Signed-off-by: David Turner <dtur...@twopensource.com> --- ref

[PATCH v3 08/44] refs.c: move the hidden refs functions to the common code

2015-10-12 Thread David Turner
From: Ronnie Sahlberg <sahlb...@google.com> Move the hidden refs functions to the refs.c file since these functions do not contain any backend specific code. Signed-off-by: Ronnie Sahlberg <sahlb...@google.com> Signed-off-by: David Turner <dtur...@twopensource.com> --- re

[PATCH v3 04/44] refs.c: add a new refs.c file to hold all common refs code

2015-10-12 Thread David Turner
From: Ronnie Sahlberg Create a new refs.c file that will be used to hold all the refs code that is backend agnostic and will be shared across all backends. Signed-off-by: Ronnie Sahlberg --- Makefile | 1 + refs.c | 3 +++ 2 files changed, 4

[PATCH v3 15/44] refs.c: move prettify_refname to the common code

2015-10-12 Thread David Turner
From: Ronnie Sahlberg Signed-off-by: Ronnie Sahlberg --- refs-be-files.c | 9 - refs.c | 9 + 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/refs-be-files.c b/refs-be-files.c index 1214d9e..ecf2b33 100644 ---

[PATCH v3 17/44] refs.c: move head_ref_namespaced to the common code

2015-10-12 Thread David Turner
From: Ronnie Sahlberg Signed-off-by: Ronnie Sahlberg --- refs-be-files.c | 15 --- refs.c | 15 +++ 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/refs-be-files.c b/refs-be-files.c index

[PATCH v3 00/44] alternate refs backends

2015-10-12 Thread David Turner
code (to simplify the implementation of ref backends, and to simplify the next patch) refs: always handle non-normal refs in files backend (cross-backend transactions) David Turner (24): refs: make repack_without_refs and is_branch public refs: move transaction functions into common code refs

[PATCH v3 16/44] refs.c: move ref iterators to the common code

2015-10-12 Thread David Turner
From: Ronnie Sahlberg Signed-off-by: Ronnie Sahlberg --- refs-be-files.c | 82 - refs.c | 81 2 files changed, 81 insertions(+),

[PATCH v3 02/44] refs: make repack_without_refs and is_branch public

2015-10-12 Thread David Turner
is_branch was already non-static, but this patch declares it in the header. Signed-off-by: Ronnie Sahlberg <sahlb...@google.com> Signed-off-by: David Turner <dtur...@twopensource.com> --- refs.c | 9 + refs.h | 13 + 2 files changed, 14 insertions(+), 8 deleti

[PATCH v3 43/44] refs: add LMDB refs backend

2015-10-12 Thread David Turner
. If those tests are changed to use the update-ref machinery or test-refs-be-db (or, in the case of packed-refs, corrupt refs, and dumb fetch tests, are skipped), the only remaining failing tests are the git-new-workdir tests and the gitweb tests. Signed-off-by: David Turner <dtur...@twopensource.

[PATCH v3 22/44] refs-be-files.c: add method for for_each_reftype_...

2015-10-12 Thread David Turner
Add method for for_each_reftype_fullpath. Signed-off-by: David Turner <dtur...@twopensource.com> --- refs-be-files.c | 11 +++ refs.c | 7 +++ refs.h | 3 +++ 3 files changed, 21 insertions(+) diff --git a/refs-be-files.c b/refs-be-files.c index 2e2399e..c

[PATCH v3 36/44] refs: make files_log_ref_write functions public

2015-10-12 Thread David Turner
Because HEAD and stash are per-worktree, refs.c needs to go through the files backend to write these refs. In this patch, we make one files backend internal functions public. Later, we will use this to handle reflog updates for per-worktree symbolic refs (HEAD). Signed-off-by: David Turner <d

[PATCH v3 29/44] refs.c: add ref backend init function

2015-10-12 Thread David Turner
The file backend doesn't need this function, but other backends might. Signed-off-by: David Turner <dtur...@twopensource.com> Signed-off-by: Ronnie Sahlberg <rsahlb...@google.com> --- refs-be-files.c | 6 ++ refs.c | 3 ++- refs.h | 4 +++- 3 files changed, 1

[PATCH v3 31/44] refs.c: add method for initial ref transaction commit

2015-10-12 Thread David Turner
Signed-off-by: Ronnie Sahlberg <rsahlb...@google.com> Signed-off-by: David Turner <dtur...@twopensource.com> --- refs-be-files.c | 5 +++-- refs.c | 6 ++ refs.h | 1 + 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/refs-be-files.c b/refs-be-f

[PATCH v3 40/44] refs: allow ref backend to be set for clone

2015-10-12 Thread David Turner
Add a new option, --refs-backend-type, to allow the ref backend type to be set on new clones. Submodules must use the same ref backend as the parent repository, so we also pass the --refs-backend-type option option when cloning submodules. Signed-off-by: David Turner <dtur...@twopensource.

[PATCH v3 44/44] refs: tests for db backend

2015-10-12 Thread David Turner
Add tests for the database backend. Signed-off-by: David Turner <dtur...@twopensource.com> Helped-by: Dennis Kaarsemaker <den...@kaarsemaker.net> --- t/t1460-refs-be-db.sh| 1109 ++ t/t1470-refs-be-db-reflog.sh | 359 ++ t

[PATCH v3 24/44] refs.c: move refname_is_safe to the common code

2015-10-12 Thread David Turner
This function does not contain any backend specific code so we move it to the common code. Signed-off-by: Ronnie Sahlberg <sahlb...@google.com> Signed-off-by: David Turner <dtur...@twopensource.com> --- refs-be-files.c | 33 - refs.c

[PATCH v3 38/44] refs: move duplicate check to common code

2015-10-12 Thread David Turner
The check for duplicate refnames in a transaction is needed for all backends, so move it to the common code. ref_transaction_commit_fn gains a new argument, the sorted string_list of affected refnames. Signed-off-by: David Turner <dtur...@twopensource.com> --- refs-be-files.

[PATCH v3 39/44] refs: always handle non-normal refs in files backend

2015-10-12 Thread David Turner
to the base ref then goes through the ordinary backend, while the files backend is directly called to update the symref's reflog. Signed-off-by: David Turner <dtur...@twopensource.com> --- refs.c | 141 - 1 file changed, 139 insertions

[PATCH v3 41/44] refs: add register_refs_backend

2015-10-12 Thread David Turner
Add register_refs_backend, to allow refs backends to be registered. Signed-off-by: David Turner <dtur...@twopensource.com> --- refs.c | 6 ++ refs.h | 1 + 2 files changed, 7 insertions(+) diff --git a/refs.c b/refs.c index 901558d..534d12e 100644 --- a/refs.c +++ b/refs.c @@ -23,6

[PATCH v3 42/44] introduce "extensions" form of core.repositoryformatversion

2015-10-12 Thread David Turner
From: Jeff King Normally we try to avoid bumps of the whole-repository core.repositoryformatversion field. However, it is unavoidable if we want to safely change certain aspects of git in a backwards-incompatible way (e.g., modifying the set of ref tips that we must traverse to

[PATCH v3 37/44] refs: break out a ref conflict check

2015-10-12 Thread David Turner
Create new function verify_no_descendants, to hold one of the ref conflict checks used in verify_refname_available. Multiple backends will need this function, so it goes in the common code. Signed-off-by: David Turner <dtur...@twopensource.com> --- refs-be-files.

[PATCH v3 25/44] refs.h: document make refname_is_safe and add it to header

2015-10-12 Thread David Turner
This function might be used by other refs backends Signed-off-by: David Turner <dtur...@twopensource.com> --- refs.h | 11 +++ 1 file changed, 11 insertions(+) diff --git a/refs.h b/refs.h index fc8a748..7a936e2 100644 --- a/refs.h +++ b/refs.h @@ -348,6 +348,17

[PATCH v3 33/44] refs.c: add method for initializing refs db

2015-10-12 Thread David Turner
Alternate refs backends might not need refs/heads and so on, so we make ref db initialization part of the backend. Signed-off-by: David Turner <dtur...@twopensource.com> --- builtin/init-db.c | 14 -- refs-be-files.c | 17 + refs.c| 5 +

[PATCH v3 35/44] refs: make lock generic

2015-10-12 Thread David Turner
Instead of using a files-backend-specific struct ref_lock, the generic ref_transaction struct should provide a void pointer that backends can use for their own lock data. Signed-off-by: David Turner <dtur...@twopensource.com> --- refs-be-files.c | 29 -

[PATCH v2] merge: fix cache_entry use-after-free

2015-10-12 Thread David Turner
From: Keith McGuigan During merges, we would previously free entries that we no longer need in the destination index. But those entries might also be stored in the dir_entry cache, and when a later call to add_to_index found them, they would be used after being freed. To

Re: [PATCH 0/1] merge: fix cache_entry use-after-free

2015-10-09 Thread David Turner
+Duy Nguyen, who knows the split index better. On Thu, 2015-10-08 at 13:00 -0700, Junio C Hamano wrote: > David Turner <dtur...@twopensource.com> writes: > > > From: Keith McGuigan <kmcgui...@twitter.com> > > > > During merges, we would previously

[PATCH 0/1] merge: fix cache_entry use-after-free

2015-10-08 Thread David Turner
Keith diagnosed the problem and wrote the patch. I wrote the commit message and am sending it upstream with his OK. Keith McGuigan (1): merge: fix cache_entry use-after-free cache.h| 27 +++ name-hash.c| 7 ++- read-cache.c | 5 - split-index.c

[PATCH 0/1] merge: fix cache_entry use-after-free

2015-10-08 Thread David Turner
freed. To prevent this, add a ref count for struct cache_entry. Whenever a cache entry is added to a data structure, the ref count is incremented; when it is removed from the data structure, it is decremented. When it hits zero, the cache_entry is freed. Signed-off-by: David Turner

Re: [PATCH v2 42/43] refs: add LMDB refs backend

2015-10-07 Thread David Turner
On Wed, 2015-10-07 at 20:31 +0200, Michael Haggerty wrote: > On 10/07/2015 03:51 AM, David Turner wrote: > > On Mon, 2015-10-05 at 17:47 +0200, Michael Haggerty wrote: > >> On 09/29/2015 12:02 AM, David Turner wrote: > >>> Add a database backend for refs using LMDB

Re: [PATCH v2 40/43] refs: allow ref backend to be set for clone

2015-10-06 Thread David Turner
On Mon, 2015-10-05 at 21:58 -0400, Jeff King wrote: > On Mon, Oct 05, 2015 at 09:29:37PM -0400, David Turner wrote: > > > > Therefore, I don't think this can be merged without a bump to > > > core.repositoryformatversion. Such a bump will tell well-behaved older > >

Re: [PATCH v2 34/43] refs.c: make struct ref_transaction generic

2015-10-06 Thread David Turner
On Tue, 2015-10-06 at 10:43 -0700, Michael Blume wrote: > This triggers a lot of build warnings on my mac, basically in every > file that uses refs.h: > > CC archive.o > In file included from archive.c:2: > ./refs.h:635:16: warning: redefinition of typedef > 'ref_transaction_free_fn' is a C11

[PATCH] error message typo fixes: unkown -> unknown

2015-10-06 Thread David Turner
Fix two instances of a typo in user-visible error messages. Signed-off-by: David Turner <dtur...@twopensource.com> --- connect.c | 2 +- sha1_file.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/connect.c b/connect.c index ced4961..d3283b8 100644 --- a/connect.c

Re: [PATCH v2 42/43] refs: add LMDB refs backend

2015-10-06 Thread David Turner
On Mon, 2015-10-05 at 17:47 +0200, Michael Haggerty wrote: > On 09/29/2015 12:02 AM, David Turner wrote: > > Add a database backend for refs using LMDB. This backend runs git > > for-each-ref about 30% faster than the files backend with fully-packed > > refs on a repo with ~

Re: [PATCH] log: Update log.follow doc and add to config.txt

2015-10-06 Thread David Turner
On Tue, 2015-10-06 at 21:14 -0400, Eric N. Vander Weele wrote: > Documentation/config.txt does not include the documentation for > log.follow that is in Documentation/git-log.txt. This commit adds the > log.follow documentation to config.txt and also updates the wording to > be consistent with

Re: [PATCH v2 01/43] refs.c: create a public version of verify_refname_available

2015-10-05 Thread David Turner
On Mon, 2015-10-05 at 06:29 +0200, Michael Haggerty wrote: > + * skip must be sorted. > > + */ > > This comment is approximately a copy of the comment for > verify_refname_available_dir(). It seems unnecessary to keep both of > them (and is also a small maintenance burden). I suggest you shorten

Re: [PATCH v2 02/43] refs: make repack_without_refs and is_branch public

2015-10-05 Thread David Turner
On Mon, 2015-10-05 at 06:34 +0200, Michael Haggerty wrote: > On 09/29/2015 12:01 AM, David Turner wrote: > > Signed-off-by: Ronnie Sahlberg <sahlb...@google.com> > > Signed-off-by: David Turner <dtur...@twopensource.com> > > --- > > refs.c | 9 +---

Re: [PATCH v2 28/43] refs.c: add ref backend init function

2015-10-05 Thread David Turner
On Mon, 2015-10-05 at 10:37 +0200, Michael Haggerty wrote: > On 09/29/2015 12:02 AM, David Turner wrote: > > The file backend doesn't need this function, but other backends might. > > > > Signed-off-by: David Turner <dtur...@twopensource.com> > > Signe

Re: [PATCH v2 40/43] refs: allow ref backend to be set for clone

2015-10-05 Thread David Turner
On Mon, 2015-10-05 at 13:55 +0200, Michael Haggerty wrote: > On 09/29/2015 12:02 AM, David Turner wrote: > > Add a new option, --refs-backend-type, to allow the ref backend type to > > be set on new clones. > > > > Submodules must use the same ref backend as the parent

Re: [PATCH v2 38/43] refs: make some files backend functions public

2015-10-05 Thread David Turner
On Mon, 2015-10-05 at 11:03 +0200, Michael Haggerty wrote: > On 09/29/2015 12:02 AM, David Turner wrote: > > Because HEAD and stash are per-worktree, other backends need to > > go through the files backend to manage these refs and their reflogs. > > > > To enable this,

Re: [PATCH v2 40/43] refs: allow ref backend to be set for clone

2015-10-05 Thread David Turner
On Mon, 2015-10-05 at 11:32 +0200, Michael Haggerty wrote: > On 09/29/2015 12:02 AM, David Turner wrote: > > Add a new option, --refs-backend-type, to allow the ref backend type to > > be set on new clones. > > > > Submodules must use the same ref backend as the parent

Re: [PATCH v2 18/43] refs-be-files.c: add a backend method structure with transaction functions

2015-10-05 Thread David Turner
On Mon, 2015-10-05 at 10:25 -0700, Junio C Hamano wrote: > Michael Haggerty writes: > > >> +/* refs backends */ > >> +typedef struct ref_transaction *(*ref_transaction_begin_fn)(struct strbuf > >> *err); > > > > Hmmm, I thought our convention was to define typedefs for

Re: [PATCH v2 43/43] refs: tests for db backend

2015-10-05 Thread David Turner
On Mon, 2015-10-05 at 09:56 -0700, Junio C Hamano wrote: > Dennis Kaarsemaker <den...@kaarsemaker.net> writes: > > > On Mon, Sep 28, 2015 at 06:02:18PM -0400, David Turner wrote: > >> Add tests for the database backend. > >> > >> Signed-o

Re: [PATCH v2 39/43] refs: break out a ref conflict check

2015-10-05 Thread David Turner
On Mon, 2015-10-05 at 11:06 +0200, Michael Haggerty wrote: > > + /* > > +* Check for entries in extras that start with "$refname/". We > > +* do that by looking for the place where "$refname/" would be > > +* inserted in extras. If there is an entry at that position > > +* that

Re: [PATCH v5 2/3] path: optimize common dir checking

2015-10-05 Thread David Turner
On Mon, 2015-10-05 at 10:22 -0700, Junio C Hamano wrote: > Michael Haggerty writes: > > > For this particular application, where we only have 19 strings to store, > > I suppose we could tolerate the use of approximately 64k of RAM to store > > 174 characters worth of

Re: [PATCH v2 22/43] refs-be-files.c: add do_for_each_per_worktree_ref

2015-10-05 Thread David Turner
On Mon, 2015-10-05 at 10:19 +0200, Michael Haggerty wrote: > On 09/29/2015 12:01 AM, David Turner wrote: > > Alternate refs backends might still use files to store per-worktree > > refs. So the files backend's ref-loading infrastructure should be > > available to those b

Re: [PATCH v2 01/43] refs.c: create a public version of verify_refname_available

2015-10-03 Thread David Turner
On Sat, 2015-10-03 at 07:02 +0200, Torsten Bögershausen wrote: > On 29.09.15 00:01, David Turner wrote: > > > (Not sure if this is the right thread to report on) > > In file included from builtin/commit.c:20: > ./refs.h:695:16: warning: redefinition of typedef 're

Re: message not appear in mailing list

2015-10-01 Thread David Turner
On Thu, 2015-10-01 at 11:47 +0800, 乙酸鋰 wrote: > Hi, > > Why the message not appear in mailing list for many hours? > There is no reject reply message. I sent the mail in plain text with a > tarball attachment. The git mailing list silently rejects messages over a certain size (as I discovered

[PATCH v2 29/43] refs.c: add methods for reflog

2015-09-28 Thread David Turner
In the file-based backend, the reflog piggybacks on the ref lock. Since other backends won't have the same sort of ref lock, ref backends must also handle reflogs. Signed-off-by: Ronnie Sahlberg <rsahlb...@google.com> Signed-off-by: David Turner <dtur...@twopensource.com> --- ref

[PATCH v2 36/43] run-command: track total number of commands run

2015-09-28 Thread David Turner
Soon, the db refs backend will use this to restart read transactions after subcommands which might have modified the refs database. Signed-off-by: David Turner <dtur...@twopensource.com> --- run-command.c | 2 ++ run-command.h | 1 + 2 files changed, 3 insertions(+) diff --git a/run-comma

[PATCH v2 26/43] refs.c: move peel_object to the common code

2015-09-28 Thread David Turner
This function does not contain any backend specific code so we move it to the common code. Signed-off-by: David Turner <dtur...@twopensource.com> --- refs-be-files.c | 53 - refs.c | 31 +++

[PATCH v2 42/43] refs: add LMDB refs backend

2015-09-28 Thread David Turner
. If those tests are changed to use the update-ref machinery or test-refs-be-db (or, in the case of packed-refs, corrupt refs, and dumb fetch tests, are skipped), the only remaining failing tests are the git-new-workdir tests and the gitweb tests. Signed-off-by: David Turner <dtur...@twopensource.

[PATCH v2 35/43] refs-be-files.c: add method to rename refs

2015-09-28 Thread David Turner
We also have to make rename_ref_available public, since alternate backends for rename_ref will need it. Signed-off-by: David Turner <dtur...@twopensource.com> --- refs-be-files.c | 20 +++- refs.c | 21 + refs.h | 7 ++- 3 files c

[PATCH v2 33/43] refs.c: add method for initializing refs db

2015-09-28 Thread David Turner
Alternate refs backends might not need refs/heads and so on, so we make ref db initialization part of the backend. Signed-off-by: David Turner <dtur...@twopensource.com> --- builtin/init-db.c | 14 -- refs-be-files.c | 17 + refs.c| 5 +

[PATCH v2 38/43] refs: make some files backend functions public

2015-09-28 Thread David Turner
Because HEAD and stash are per-worktree, other backends need to go through the files backend to manage these refs and their reflogs. To enable this, we make some files backend functions public. Signed-off-by: David Turner <dtur...@twopensource.com> --- refs-be-files.

[PATCH v2 23/43] refs.c: move refname_is_safe to the common code

2015-09-28 Thread David Turner
This function does not contain any backend specific code so we move it to the common code. Signed-off-by: Ronnie Sahlberg <sahlb...@google.com> Signed-off-by: David Turner <dtur...@twopensource.com> --- refs-be-files.c | 33 - refs.c

[PATCH v2 41/43] refs: add register_refs_backend

2015-09-28 Thread David Turner
Add register_refs_backend, to allow refs backends to be registered. Signed-off-by: David Turner <dtur...@twopensource.com> --- refs.c | 6 ++ refs.h | 1 + 2 files changed, 7 insertions(+) diff --git a/refs.c b/refs.c index 4f2ab25..4195657 100644 --- a/refs.c +++ b/refs.c @@ -18,6

[PATCH v2 34/43] refs.c: make struct ref_transaction generic

2015-09-28 Thread David Turner
Alternate ref backends might need different data for transactions. Make struct ref_transaction an empty struct, and let backends define their own structs which extend it. Signed-off-by: David Turner <dtur...@twopensource.com> --- refs-be-files.c | 24 +---

[PATCH v2 37/43] refs: move some defines from refs-be-files.c to refs.h

2015-09-28 Thread David Turner
This allows them to be used by other ref backends. Signed-off-by: David Turner <dtur...@twopensource.com> --- refs-be-files.c | 24 refs.h | 24 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/refs-be-files.c

[PATCH v2 31/43] refs.c: add method for initial ref transaction commit

2015-09-28 Thread David Turner
Signed-off-by: Ronnie Sahlberg <rsahlb...@google.com> Signed-off-by: David Turner <dtur...@twopensource.com> --- refs-be-files.c | 5 +++-- refs.c | 6 ++ refs.h | 1 + 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/refs-be-files.c b/refs-be-f

[PATCH v2 19/43] refs-be-files.c: add methods for misc ref operations

2015-09-28 Thread David Turner
From: Ronnie Sahlberg <sahlb...@google.com> Add ref backend methods for: resolve_ref_unsafe, verify_refname_available, pack_refs, peel_ref, create_symref, resolve_gitlink_ref. Signed-off-by: Ronnie Sahlberg <sahlb...@google.com> Signed-off-by: David Turner <dtur...@twopensource.co

[PATCH v2 22/43] refs-be-files.c: add do_for_each_per_worktree_ref

2015-09-28 Thread David Turner
Alternate refs backends might still use files to store per-worktree refs. So the files backend's ref-loading infrastructure should be available to those backends, just for use on per-worktree refs. Add do_for_each_per_worktree_ref, which iterates over per-worktree refs. Signed-off-by: David

[PATCH v2 30/43] refs-be-files.c: add method to expire reflogs

2015-09-28 Thread David Turner
Signed-off-by: David Turner <dtur...@twopensource.com> --- refs-be-files.c | 13 +++-- refs.c | 12 refs.h | 7 +++ 3 files changed, 26 insertions(+), 6 deletions(-) diff --git a/refs-be-files.c b/refs-be-files.c index fdb47e0..93a5a33

[PATCH v2 40/43] refs: allow ref backend to be set for clone

2015-09-28 Thread David Turner
Add a new option, --refs-backend-type, to allow the ref backend type to be set on new clones. Submodules must use the same ref backend as the parent repository, so we also pass the --refs-backend-type option option when cloning submodules. Signed-off-by: David Turner <dtur...@twopensource.

[PATCH v2 24/43] refs.h: document make refname_is_safe and add it to header

2015-09-28 Thread David Turner
This function might be used by other refs backends Signed-off-by: David Turner <dtur...@twopensource.com> --- refs.h | 11 +++ 1 file changed, 11 insertions(+) diff --git a/refs.h b/refs.h index 2bafa55..db60bfe 100644 --- a/refs.h +++ b/refs.h @@ -259,6 +259,17

[PATCH v2 21/43] refs-be-files.c: add method for for_each_reftype_...

2015-09-28 Thread David Turner
Add method for for_each_reftype_fullpath. Signed-off-by: David Turner <dtur...@twopensource.com> --- refs-be-files.c | 11 +++ refs.c | 7 +++ refs.h | 3 +++ 3 files changed, 21 insertions(+) diff --git a/refs-be-files.c b/refs-be-files.c index 9b45468..e

[PATCH v2 39/43] refs: break out a ref conflict check

2015-09-28 Thread David Turner
Create new function verify_no_descendants, to hold one of the ref conflict checks used in verify_refname_available. Multiple backends will need this function, so it goes in the common code. Signed-off-by: David Turner <dtur...@twopensource.com> --- refs-be-files.

[PATCH v2 15/43] refs.c: move prettify_refname to the common code

2015-09-28 Thread David Turner
From: Ronnie Sahlberg Signed-off-by: Ronnie Sahlberg --- refs-be-files.c | 9 - refs.c | 9 + 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/refs-be-files.c b/refs-be-files.c index 58ff453..9c27851 100644 ---

[PATCH v2 32/43] initdb: move safe_create_dir into common code

2015-09-28 Thread David Turner
In a moment, we'll create initdb functions for ref backends, and code from initdb that calls this function needs to move into the files backend. So this function needs to be public. Signed-off-by: David Turner <dtur...@twopensource.com> --- builtin/init-db.c | 12 c

[PATCH v2 17/43] refs.c: move head_ref_namespaced to the common code

2015-09-28 Thread David Turner
From: Ronnie Sahlberg Signed-off-by: Ronnie Sahlberg --- refs-be-files.c | 15 --- refs.c | 15 +++ 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/refs-be-files.c b/refs-be-files.c index

[PATCH v2 12/43] refs.c: move resolve_refdup to common

2015-09-28 Thread David Turner
From: Ronnie Sahlberg <sahlb...@google.com> This function can be shared across all refs backends so move it to the common code. Signed-off-by: Ronnie Sahlberg <sahlb...@google.com> Signed-off-by: David Turner <dtur...@twopensource.com> --- refs-be-files.c | 7 --- r

[PATCH v2 09/43] refs.c: move dwim and friend functions to the common refs code

2015-09-28 Thread David Turner
From: Ronnie Sahlberg <sahlb...@google.com> These functions do not contain any backend specific code so we move them to the common code and share across all backends. Signed-off-by: Ronnie Sahlberg <sahlb...@google.com> Signed-off-by: David Turner <dtur...@twopensource.com> --

[PATCH v2 07/43] refs.c: move read_ref_at to the common refs file

2015-09-28 Thread David Turner
From: Ronnie Sahlberg <sahlb...@google.com> Move read_ref_at() to the refs.c file since this function does not contain any backend specific code. Signed-off-by: Ronnie Sahlberg <sahlb...@google.com> Signed-off-by: David Turner <dtur...@twopensource.com> --- ref

[PATCH v2 16/43] refs.c: move ref iterators to the common code

2015-09-28 Thread David Turner
From: Ronnie Sahlberg Signed-off-by: Ronnie Sahlberg --- refs-be-files.c | 82 - refs.c | 81 2 files changed, 81 insertions(+),

<    5   6   7   8   9   10   11   12   13   14   >