[PATCH v2 12/23] refs-common.c: move check_refname_component to the common code

2014-08-13 Thread Ronnie Sahlberg
This function does not contain any backend specific code so we can move it to the common code. Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs-common.c | 110 ++ refs.c| 110

[PATCH v2 18/23] refs.c: add a backend method structure with transaction functions

2014-08-13 Thread Ronnie Sahlberg
-by: Ronnie Sahlberg sahlb...@google.com --- refs-common.c | 54 +++ refs.c| 68 +++ refs.h| 35 ++ 3 files changed, 130 insertions(+), 27 deletions(-) diff --git

[PATCH v2 08/23] refs-common.c: move dwim and friend functions to refs common

2014-08-13 Thread Ronnie Sahlberg
These functions do not contain any backend specific code so we can move them to the common code and share across all backends. Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs-common.c | 202 ++ refs.c| 202

[PATCH v2 19/23] refs.c: add reflog backend methods

2014-08-13 Thread Ronnie Sahlberg
Add methods for the reflog functions. Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs-common.c | 32 refs.c| 18 -- refs.h| 17 + 3 files changed, 61 insertions(+), 6 deletions(-) diff --git a/refs

[PATCH v2 05/23] refs-common.c: move rename_ref to the common code

2014-08-13 Thread Ronnie Sahlberg
This change moves rename_ref() to the refs-common.c file since this function does not contain any backend specific code. Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs-common.c | 92 +++ refs.c| 92

[PATCH v2 20/23] refs.c: add methods for misc ref operations

2014-08-13 Thread Ronnie Sahlberg
Add ref backend methods for: resolve_ref_unsafe, is_refname_available, pack_refs, peel_ref, create_symref, resolve_gitlink_ref. Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs-common.c | 33 + refs.c| 22 +++--- refs.h

[PATCH v2 21/23] refs.c: add methods for head_ref*

2014-08-13 Thread Ronnie Sahlberg
Add methods for the head_ref* functions. Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs-common.c | 10 ++ refs.c| 6 -- refs.h| 6 ++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/refs-common.c b/refs-common.c index d9688e2

[PATCH v2 07/23] refs-common.c: move the hidden refs functions to the common code

2014-08-13 Thread Ronnie Sahlberg
This change moves the hidden refs functions to the refs-common.c file since these functions do not contain any backend specific code. Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs-common.c | 44 refs.c| 43

[PATCH v2 17/23] refs-common.c: move head_ref_namespaced to the common file

2014-08-13 Thread Ronnie Sahlberg
Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs-common.c | 15 +++ refs.c| 15 --- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/refs-common.c b/refs-common.c index 3b20db3..aafc4c8 100644 --- a/refs-common.c +++ b/refs-common.c

[PATCH v2 13/23] refs-common.c: move is_branch to the common code

2014-08-13 Thread Ronnie Sahlberg
Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs-common.c | 5 + refs.c| 5 - 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/refs-common.c b/refs-common.c index f8b79e0..5f83d7e 100644 --- a/refs-common.c +++ b/refs-common.c @@ -3,6 +3,11 @@ #include

[PATCH v2 09/23] refs-common.c: move warn_if_dangling_symref* to refs-common

2014-08-13 Thread Ronnie Sahlberg
These functions do not use any backend specific code so we can move them to the common code. Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs-common.c | 52 refs.c| 52 2

[PATCH v2 06/23] refs-common.c: move read_ref_at to the refs common file

2014-08-13 Thread Ronnie Sahlberg
This change moves read_ref_at() to the refs-common.c file since this function does not contain any backend specific code. Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs-common.c | 114 ++ refs.c| 114

[PATCH v2 11/23] refs-common.c: move resolve_refdup to common

2014-08-13 Thread Ronnie Sahlberg
This function can be shared across all refs backends so move it to the common code. Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs-common.c | 6 ++ refs.c| 6 -- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/refs-common.c b/refs-common.c index

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

2014-08-13 Thread Ronnie Sahlberg
Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs-common.c | 9 + refs.c| 9 - 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/refs-common.c b/refs-common.c index 6eef80b..d8a295c 100644 --- a/refs-common.c +++ b/refs-common.c @@ -3,6 +3,15

[PATCH v2 03/23] refs-common.c: move update_ref to refs-common.c

2014-08-13 Thread Ronnie Sahlberg
This change moves update_ref() to the refs-common.c file since this function does not contain any backend specific code. Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs-common.c | 25 + refs.c| 23 --- 2 files changed, 25 insertions

[PATCH v2 01/23] refs.c: create a public function for is_refname_available

2014-08-13 Thread Ronnie Sahlberg
Export a generic is_refname_available() function. We will need this as a public shared function later when we add additional refs backends since we want to keep using the same rules for ref naming across all backends. Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs.c | 29

[PATCH v2 22/23] refs.c: add methods for the ref iterators

2014-08-13 Thread Ronnie Sahlberg
Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs-common.c | 36 refs.c| 21 ++--- refs.h| 19 +++ 3 files changed, 69 insertions(+), 7 deletions(-) diff --git a/refs-common.c b/refs-common.c index

[PATCH v2 10/23] refs-common.c: move read_ref, read_ref_full and ref_exists to common

2014-08-13 Thread Ronnie Sahlberg
These functions do not depend on the backend implementation so we can move them to the common code. Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs-common.c | 18 ++ refs.c| 18 -- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git

[PATCH v2 14/23] refs-common.c: move names_conflict to the common code

2014-08-13 Thread Ronnie Sahlberg
Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs-common.c | 8 refs.c| 14 -- refs.h| 9 + 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/refs-common.c b/refs-common.c index 5f83d7e..6eef80b 100644 --- a/refs-common.c

Re: [PATCH v2 00/23] backend-struct-db

2014-08-13 Thread Ronnie Sahlberg
On Wed, Aug 13, 2014 at 2:18 PM, Junio C Hamano gits...@pobox.com wrote: Ronnie Sahlberg sahlb...@google.com writes: 15 of the patches, the refs-common.c patches, focuses on moving all backend agnostic refs functions to a common file. This file will contain all backend agnostic refs functions

[PATCH 2/5] refs.c: make add_packed_ref return an error instead of calling die

2014-08-19 Thread Ronnie Sahlberg
() will fail which protects us from calling add_packed_ref() with the bad name. Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs.c | 23 +-- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/refs.c b/refs.c index 65eee72..0aad8c8 100644 --- a/refs.c +++ b

[PATCH 4/5] refs.c: add an err argument to commit_packed_refs

2014-08-19 Thread Ronnie Sahlberg
Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs.c | 85 +++--- 1 file changed, 50 insertions(+), 35 deletions(-) diff --git a/refs.c b/refs.c index cfe1292..19e73f3 100644 --- a/refs.c +++ b/refs.c @@ -2232,8 +2232,8

[PATCH 0/5] ref-transactions-req-strbuf-err

2014-08-19 Thread Ronnie Sahlberg
to pass errors back to callers. The only thing noteworthy is that we finally get to remove -enum action_on_err { - UPDATE_REFS_MSG_ON_ERR, - UPDATE_REFS_DIE_ON_ERR, - UPDATE_REFS_QUIET_ON_ERR -}; aside from that there is little/nothing much interesting in there. Ronnie Sahlberg (5

[PATCH 5/5] refs.c: add an err argument to pack_refs

2014-08-19 Thread Ronnie Sahlberg
Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- builtin/pack-refs.c | 8 +++- refs.c | 13 ++--- refs.h | 3 ++- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/builtin/pack-refs.c b/builtin/pack-refs.c index b20b1ec..299768e 100644

[PATCH 3/5] refs.c: make lock_packed_refs take an err argument

2014-08-19 Thread Ronnie Sahlberg
Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs.c | 25 + 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/refs.c b/refs.c index 0aad8c8..cfe1292 100644 --- a/refs.c +++ b/refs.c @@ -2270,13 +2270,17 @@ static int write_packed_entry_fn(struct

[PATCH 1/5] refs.c: replace the onerr argument in update_ref with a strbuf err

2014-08-19 Thread Ronnie Sahlberg
Get rid of the action_on_err enum and replace the action argument to update_ref with a strbuf *err for error reporting. Update all callers to the new api including two callers in transport*.c which used the literal 0 instead of an enum. Signed-off-by: Ronnie Sahlberg sahlb...@google.com

[PATCH 0/5] ref-transactions-send-pack

2014-08-19 Thread Ronnie Sahlberg
called ref-transactions-req-strbuf-err Ronnie Sahlberg (5): receive-pack.c: add protocol support to negotiate atomic-push send-pack.c: add an --atomic-push command line argument receive-pack.c: use a single transaction when atomic-push is negotiated receive-pack.c: add receive.atomicpush

[PATCH 5/5] push.c: add an --atomic-push argument

2014-08-19 Thread Ronnie Sahlberg
Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- Documentation/git-push.txt | 7 ++- builtin/push.c | 2 ++ transport.c| 1 + transport.h| 1 + 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Documentation/git-push.txt b

[PATCH 4/5] receive-pack.c: add receive.atomicpush configuration option

2014-08-19 Thread Ronnie Sahlberg
Add a configuration argument to the receive side to force atomic pushes for all pushes to the repo. Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- Documentation/config.txt | 5 + builtin/receive-pack.c | 5 + 2 files changed, 10 insertions(+) diff --git a/Documentation

[PATCH 2/5] send-pack.c: add an --atomic-push command line argument

2014-08-19 Thread Ronnie Sahlberg
Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- Documentation/git-send-pack.txt | 7 ++- builtin/send-pack.c | 6 +- send-pack.c | 8 +++- send-pack.h | 1 + 4 files changed, 19 insertions(+), 3 deletions(-) diff --git

[PATCH 3/5] receive-pack.c: use a single transaction when atomic-push is negotiated

2014-08-19 Thread Ronnie Sahlberg
that there are no client scripts that depend on the old behaviour we can change git to default to use atomic pushes and instead offer an opt-out argument for people that do not want atomic pushes. Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- Documentation/technical/protocol-capabilities.txt | 7

[PATCH 1/5] receive-pack.c: add protocol support to negotiate atomic-push

2014-08-19 Thread Ronnie Sahlberg
Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- builtin/receive-pack.c | 6 +- send-pack.c| 12 +--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c index 0565b94..f6b20cb 100644 --- a/builtin/receive

[PATCH v3 05/23] refs.c: move delete_ref to the common code

2014-08-19 Thread Ronnie Sahlberg
This change moves delete_ref() to the refs.c file since this function does not contain any backend specific code. Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs-be-files.c | 19 --- refs.c | 19 +++ 2 files changed, 19 insertions(+), 19

[PATCH v3 15/23] refs.c: move names_conflict to the common code

2014-08-19 Thread Ronnie Sahlberg
Move names_conflict to the common code and make it public. We want to use the same name conflict checks across all backends so we guarantee compatibility across backends. Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs-be-files.c | 14 -- refs.c | 8

[PATCH v3 04/23] refs.c: move update_ref to refs.c

2014-08-19 Thread Ronnie Sahlberg
This change moves update_ref() to the refs.c file since this function does not contain any backend specific code. Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs-be-files.c | 23 --- refs.c | 25 + 2 files changed, 25 insertions

[PATCH v3 06/23] refs.c: move rename_ref to the common code

2014-08-19 Thread Ronnie Sahlberg
This change moves rename_ref() to the refs.c file since this function does not contain any backend specific code. Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs-be-files.c | 92 - refs.c | 92

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

2014-08-19 Thread Ronnie Sahlberg
This change moves 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 --- refs-be-files.c | 43 --- refs.c | 44

[PATCH v3 20/23] refs-be-files.c: add reflog backend methods

2014-08-19 Thread Ronnie Sahlberg
Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs-be-files.c | 21 +++-- refs.c | 32 refs.h | 16 3 files changed, 63 insertions(+), 6 deletions(-) diff --git a/refs-be-files.c b/refs-be-files.c index

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

2014-08-19 Thread Ronnie Sahlberg
Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs-be-files.c | 5 - refs.c | 5 + 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/refs-be-files.c b/refs-be-files.c index 55bced9..70c034c 100644 --- a/refs-be-files.c +++ b/refs-be-files.c @@ -2483,11

[PATCH v3 18/23] refs.c: move head_ref_namespaced to the common code

2014-08-19 Thread Ronnie Sahlberg
Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- 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 9aa88ef..e58a7e1 100644 --- a/refs-be-files.c +++ b/refs

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

2014-08-19 Thread Ronnie Sahlberg
-by: Ronnie Sahlberg sahlb...@google.com --- refs-be-files.c | 68 ++--- refs.c | 55 ++ refs.h | 35 + 3 files changed, 131 insertions(+), 27 deletions(-) diff --git

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

2014-08-19 Thread Ronnie Sahlberg
This change moves 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 --- refs-be-files.c | 114 refs.c | 114

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

2014-08-19 Thread Ronnie Sahlberg
everything to be part of the files based backend and then move the parts that can be used as common code back to refs.c. Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- Makefile | 1 + refs.c | 3 +++ 2 files changed, 4 insertions(+) create mode 100644 refs.c diff --git a/Makefile b

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

2014-08-19 Thread Ronnie Sahlberg
Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs-be-files.c | 81 - refs.c | 81 + 2 files changed, 81 insertions(+), 81 deletions(-) diff --git a/refs-be-files.c b

[PATCH v3 13/23] refs.c: move check_refname_component to the common code

2014-08-19 Thread Ronnie Sahlberg
This function does not contain any backend specific code so we can move it to the common code. Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs-be-files.c | 110 refs.c | 110

[PATCH v3 22/23] refs-be-files.c: add methods for head_ref*

2014-08-19 Thread Ronnie Sahlberg
Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs-be-files.c | 7 +-- refs.c | 10 ++ refs.h | 5 + 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/refs-be-files.c b/refs-be-files.c index b09f0fc..910663b 100644 --- a/refs-be-files.c

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

2014-08-19 Thread Ronnie Sahlberg
Add ref backend methods for: resolve_ref_unsafe, is_refname_available, pack_refs, peel_ref, create_symref, resolve_gitlink_ref. Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs-be-files.c | 25 ++--- refs.c | 33 + refs.h

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

2014-08-19 Thread Ronnie Sahlberg
Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs-be-files.c | 21 ++--- refs.c | 36 refs.h | 18 ++ 3 files changed, 68 insertions(+), 7 deletions(-) diff --git a/refs-be-files.c b/refs-be-files.c

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

2014-08-19 Thread Ronnie Sahlberg
These functions do not depend on the backend implementation so we can move them to the common code. Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs-be-files.c | 18 -- refs.c | 18 ++ 2 files changed, 18 insertions(+), 18 deletions(-) diff

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

2014-08-19 Thread Ronnie Sahlberg
These functions do not use any backend specific code so we can move them to the common code. Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs-be-files.c | 52 refs.c | 52

[PATCH v3 01/23] refs.c: create a public function for is_refname_available

2014-08-19 Thread Ronnie Sahlberg
Export a generic is_refname_available() function. We will need this as a public shared function later when we add additional refs backends since we want to keep using the same rules for ref naming across all backends. Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs.c | 29

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

2014-08-19 Thread Ronnie Sahlberg
These functions do not contain any backend specific code so we can move them to the common code and share across all backends. Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs-be-files.c | 202 refs.c | 202

[PATCH v3 16/23] refs.c: move prettify_refname to the common code

2014-08-19 Thread Ronnie Sahlberg
Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- 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 6542969..fb9c614 100644 --- a/refs-be-files.c +++ b/refs-be-files.c

[PATCH v3 12/23] refs.c: move resolve_refdup to common

2014-08-19 Thread Ronnie Sahlberg
This function can be shared across all refs backends so move it to the common code. Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs-be-files.c | 6 -- refs.c | 6 ++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/refs-be-files.c b/refs-be-files.c

Re: Transaction patch series overview

2014-08-19 Thread Ronnie Sahlberg
provided and can be used as basis for creating a daemon to plug into, say, a SQL database or similar. regards ronnie sahlberg -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo

Re: [PATCH v20 43/48] refs.c: move the check for valid refname to lock_ref_sha1_basic

2014-08-20 Thread Ronnie Sahlberg
On Wed, Aug 20, 2014 at 7:52 AM, Michael Haggerty mhag...@alum.mit.edu wrote: On 07/15/2014 10:58 PM, Ronnie Sahlberg wrote: On Tue, Jul 15, 2014 at 12:34 PM, Ronnie Sahlberg sahlb...@google.com wrote: On Tue, Jul 15, 2014 at 11:04 AM, Jonathan Nieder jrnie...@gmail.com wrote: Michael

Re: [PATCH v20 43/48] refs.c: move the check for valid refname to lock_ref_sha1_basic

2014-08-20 Thread Ronnie Sahlberg
On Wed, Aug 20, 2014 at 10:49 AM, Jonathan Nieder jrnie...@gmail.com wrote: Hi, Ronnie Sahlberg wrote: On Wed, Aug 20, 2014 at 7:52 AM, Michael Haggerty mhag...@alum.mit.edu wrote: I'm a little worried that abandoning *all* refname checks could open us up to somehow trying to delete

Re: [PATCH v20 43/48] refs.c: move the check for valid refname to lock_ref_sha1_basic

2014-08-20 Thread Ronnie Sahlberg
On Wed, Aug 20, 2014 at 1:11 PM, Michael Haggerty mhag...@alum.mit.edu wrote: On 08/20/2014 09:45 PM, Junio C Hamano wrote: Michael Haggerty mhag...@alum.mit.edu writes: I think we can get away with not including broken refnames when iterating. After all, the main goal of tolerating them is

Re: [PATCH v20 43/48] refs.c: move the check for valid refname to lock_ref_sha1_basic

2014-08-21 Thread Ronnie Sahlberg
On Wed, Aug 20, 2014 at 11:34 AM, Michael Haggerty mhag...@alum.mit.edu wrote: On 08/20/2014 06:28 PM, Ronnie Sahlberg wrote: On Wed, Aug 20, 2014 at 7:52 AM, Michael Haggerty mhag...@alum.mit.edu wrote: I'm a little worried that abandoning *all* refname checks could open us up to somehow

Re: [PATCH 4/5] fast-import: fix buffer overflow in dump_tags

2014-08-25 Thread Ronnie Sahlberg
Jeff, We have a fix like this in the next set of transaction updates. https://code-review.googlesource.com/#/c/1012/13/fast-import.c However, if your concerns are the integrity of the servers and not taking any chances you might not want to wait for my patches to graduate. ronnie sahlberg

Re: [PATCH 3/5] fast-import: clean up pack_data pointer in end_packfile

2014-08-25 Thread Ronnie Sahlberg
Print an error before returning when pack_data is NULL ? Otherwise, LGTM On Fri, Aug 22, 2014 at 10:27 PM, Jeff King p...@peff.net wrote: We have a global pointer pack_data pointing to the current pack we have open. Inside end_packfile we have two new pointers, old_p and new_p. The latter

Re: [PATCH 5/5] fast-import: stop using lock_ref_sha1

2014-08-25 Thread Ronnie Sahlberg
The next ref transaction series does a similar change and ends up removing the function lock_ref_sha1() completely. https://code-review.googlesource.com/#/c/1017/19/refs.c So I think we can drop this patch. ronnie sahlberg On Fri, Aug 22, 2014 at 10:33 PM, Jeff King p...@peff.net wrote: We

Re: [PATCH 0/5] fix pack-refs pruning of refs/foo

2014-08-25 Thread Ronnie Sahlberg
cause more merge conflicts than is already present in the transaction series. 1-4: Reviewed-by: Ronnie Sahlberg sahlb...@google.com -Peff -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http

Re: check-ref-format: include refs/ in the argument or to strip it?

2014-08-25 Thread Ronnie Sahlberg
On Fri, Aug 22, 2014 at 10:46 PM, Jeff King p...@peff.net wrote: On Fri, Aug 22, 2014 at 11:45:15AM -0700, Jonathan Nieder wrote: Junio C Hamano wrote: implication of which is that the 'at least one slash' rule was to expect things are 'refs/anything' so there will be at

Re: [PATCH v3 03/23] refs.c: add a new refs.c file to hold all common refs code

2014-08-26 Thread Ronnie Sahlberg
On Tue, Aug 26, 2014 at 2:31 PM, Junio C Hamano gits...@pobox.com wrote: Ronnie Sahlberg sahlb...@google.com writes: Create a new erfs.c file that will be used to hold all the refs code that is backend agnostic and will be shared across all backends. The reason we renamed everything to refs

Re: [PATCH v2 18/23] refs.c: add a backend method structure with transaction functions

2014-08-26 Thread Ronnie Sahlberg
On Tue, Aug 26, 2014 at 2:25 PM, Junio C Hamano gits...@pobox.com wrote: Ronnie Sahlberg sahlb...@google.com writes: +struct ref_be { + transaction_begin_fn transaction_begin; + transaction_update_sha1_fn transaction_update_sha1; + transaction_create_sha1_fn

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

2014-08-26 Thread Ronnie Sahlberg
On Tue, Aug 26, 2014 at 2:38 PM, Junio C Hamano gits...@pobox.com wrote: Ronnie Sahlberg sahlb...@google.com writes: diff --git a/refs-be-files.c b/refs-be-files.c index e58a7e1..27eafd0 100644 --- a/refs-be-files.c +++ b/refs-be-files.c ... +struct ref_be refs_files

Re: [PATCH v4 04/32] rollback_lock_file(): exit early if lock is not active

2014-09-11 Thread Ronnie Sahlberg
Reviewed-by: Ronnie Sahlberg sahlb...@google.com On Sat, Sep 6, 2014 at 12:50 AM, Michael Haggerty mhag...@alum.mit.edu wrote: Eliminate a layer of nesting. Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- lockfile.c | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions

Re: [PATCH v4 03/32] rollback_lock_file(): do not clear filename redundantly

2014-09-11 Thread Ronnie Sahlberg
Reviewed-by: Ronnie Sahlberg sahlb...@google.com On Sat, Sep 6, 2014 at 12:50 AM, Michael Haggerty mhag...@alum.mit.edu wrote: It is only necessary to clear the lock_file's filename field if it was not already clear. Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- lockfile.c | 2

Re: [PATCH v4 13/32] write_packed_entry_fn(): convert cb_data into a (const int *)

2014-09-11 Thread Ronnie Sahlberg
Reviewed-by: Ronnie Sahlberg sahlb...@google.com On Sat, Sep 6, 2014 at 12:50 AM, Michael Haggerty mhag...@alum.mit.edu wrote: This makes it obvious that we have no plans to change the integer pointed to, which is actually the fd field from a struct lock_file. Signed-off-by: Michael Haggerty

Re: [PATCH v4 09/32] lockfile.c: document the various states of lock_file objects

2014-09-11 Thread Ronnie Sahlberg
Reviewed-by: Ronnie Sahlberg sahlb...@google.com On Sat, Sep 6, 2014 at 12:50 AM, Michael Haggerty mhag...@alum.mit.edu wrote: Document the valid states of lock_file objects, how they get into each state, and how the state is encoded in the object's fields. Signed-off-by: Michael Haggerty

Re: [PATCH v4 10/32] cache.h: define constants LOCK_SUFFIX and LOCK_SUFFIX_LEN

2014-09-11 Thread Ronnie Sahlberg
On Sat, Sep 6, 2014 at 12:50 AM, Michael Haggerty mhag...@alum.mit.edu wrote: There are a few places that use these values, so define constants for them. Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- cache.h| 4 lockfile.c | 11 ++- refs.c | 7 --- 3

Re: [PATCH v4 10/32] cache.h: define constants LOCK_SUFFIX and LOCK_SUFFIX_LEN

2014-09-11 Thread Ronnie Sahlberg
Maybe we should not have a public constant defined for the length : +#define LOCK_SUFFIX_LEN 5 since it encourages unsafe code like : (this was unsafe long before your patch so not a regression) + i = strlen(result_file) - LOCK_SUFFIX_LEN; /* .lock */ result_file[i] = 0; What

Re: [PATCH v4 14/32] lock_file(): exit early if lockfile cannot be opened

2014-09-11 Thread Ronnie Sahlberg
Reviewed-by: Ronnie Sahlberg sahlb...@google.com On Sat, Sep 6, 2014 at 12:50 AM, Michael Haggerty mhag...@alum.mit.edu wrote: This is a bit easier to read than the old version, which nested part of the non-error code in an if block. Signed-off-by: Michael Haggerty mhag...@alum.mit.edu

Re: [PATCH v4 10/32] cache.h: define constants LOCK_SUFFIX and LOCK_SUFFIX_LEN

2014-09-12 Thread Ronnie Sahlberg
On Fri, Sep 12, 2014 at 10:13 AM, Michael Haggerty mhag...@alum.mit.edu wrote: On 09/12/2014 12:42 AM, Ronnie Sahlberg wrote: Maybe we should not have a public constant defined for the length : +#define LOCK_SUFFIX_LEN 5 since it encourages unsafe code like : (this was unsafe long before

Re: [PATCH 19/24] refs.c: allow listing and deleting badly named refs

2014-10-03 Thread Ronnie Sahlberg
On Thu, Oct 2, 2014 at 11:55 AM, Junio C Hamano gits...@pobox.com wrote: Jonathan Nieder jrnie...@gmail.com writes: From: Ronnie Sahlberg sahlb...@google.com ... In resolving functions, refuse to resolve refs that don't pass the check-ref-format(1) check unless the new

Re: [PATCH 19/24] refs.c: allow listing and deleting badly named refs

2014-10-03 Thread Ronnie Sahlberg
On Fri, Oct 3, 2014 at 1:25 PM, Ronnie Sahlberg sahlb...@google.com wrote: On Thu, Oct 2, 2014 at 11:55 AM, Junio C Hamano gits...@pobox.com wrote: Jonathan Nieder jrnie...@gmail.com writes: From: Ronnie Sahlberg sahlb...@google.com ... In resolving functions, refuse to resolve refs

[PATCH 08/15] refs.c: add a flag to allow reflog updates to truncate the log

2014-10-21 Thread Ronnie Sahlberg
commit 8d0a342375fbd926ae6ae93f9be42a436a787fb6 upstream. Add a flag that allows us to truncate the reflog before we write the update. Change-Id: I187b22e0910499b1976689b46866698b6fd46eb3 Signed-off-by: Ronnie Sahlberg sahlb...@google.com Signed-off-by: Jonathan Nieder jrnie...@gmail.com

[PATCH 07/15] refs.c: add a transaction function to append a reflog entry

2014-10-21 Thread Ronnie Sahlberg
Signed-off-by: Ronnie Sahlberg sahlb...@google.com Signed-off-by: Jonathan Nieder jrnie...@gmail.com --- refs.c | 102 +++-- refs.h | 12 2 files changed, 112 insertions(+), 2 deletions(-) diff --git a/refs.c b/refs.c index

[PATCH 12/15] refs.c: rename log_ref_setup to create_reflog

2014-10-21 Thread Ronnie Sahlberg
a single lstat() instead of a open(O_CREAT)+lstat()+close(). Change-Id: Ib9493b3b81a97a0e154cc44303a5ed7cdceaaca7 Signed-off-by: Ronnie Sahlberg sahlb...@google.com Signed-off-by: Jonathan Nieder jrnie...@gmail.com --- builtin/checkout.c | 8 +--- refs.c | 22

[PATCH 01/15] refs.c make ref_transaction_create a wrapper to ref_transaction_update

2014-10-21 Thread Ronnie Sahlberg
Signed-off-by: Ronnie Sahlberg sahlb...@google.com Signed-off-by: Jonathan Nieder jrnie...@gmail.com --- refs.c | 27 ++- 1 file changed, 2 insertions(+), 25 deletions(-) diff --git a/refs.c b/refs.c index 0368ed4..ed0485e 100644 --- a/refs.c +++ b/refs.c @@ -3623,31 +3623,8

[PATCH 13/15] refs.c: make unlock_ref/close_ref/commit_ref static

2014-10-21 Thread Ronnie Sahlberg
commit a4369f77d1975566bcd29bfa46720d48372c241d upstream. unlock|close|commit_ref can be made static since there are no more external callers. Change-Id: I743f9daaa1c101fdc781a76283c2e8b462591d07 Signed-off-by: Ronnie Sahlberg sahlb...@google.com Signed-off-by: Jonathan Nieder jrnie...@gmail.com

[PATCH 05/15] refs.c: add a function to append a reflog entry to a fd

2014-10-21 Thread Ronnie Sahlberg
reflog transactions too which means that we will end up with only a single place where we write a reflog entry to a file instead of the current two places (log_ref_write and builtin/reflog.c). Change-Id: I178e84a52af18c800844596af33dbc21bc076c1f Signed-off-by: Ronnie Sahlberg sahlb...@google.com Signed

[PATCH 02/15] refs.c: make ref_transaction_delete a wrapper for ref_transaction_update

2014-10-21 Thread Ronnie Sahlberg
commit 0beeda259297c92d411ecc92fa508ec7cfd87cc5 upstream. Change-Id: I685291986e544a8dc14f94c73b6a7c6400acd9d2 Signed-off-by: Ronnie Sahlberg sahlb...@google.com Signed-off-by: Jonathan Nieder jrnie...@gmail.com --- refs.c | 22 ++ refs.h | 2 +- 2 files changed, 3

[PATCH 00/15] ref-transactions-reflog

2014-10-21 Thread Ronnie Sahlberg
of the series since we no longer need those functions. This series can also be found at https://github.com/rsahlberg/git/tree/ref-transactions-reflog Ronnie Sahlberg (15): refs.c make ref_transaction_create a wrapper to ref_transaction_update refs.c: make ref_transaction_delete a wrapper

[PATCH 10/15] refs.c: allow multiple reflog updates during a single transaction

2014-10-21 Thread Ronnie Sahlberg
never materialize at this stage. Change-Id: Ibe703310e33a4db07e5bcc704310211268b788fc Signed-off-by: Ronnie Sahlberg sahlb...@google.com Signed-off-by: Jonathan Nieder jrnie...@gmail.com --- refs.c | 46 +- 1 file changed, 37 insertions(+), 9 deletions

[PATCH 03/15] refs.c: rename the transaction functions

2014-10-21 Thread Ronnie Sahlberg
discussed when the transactions could also operate on non ref objects. Such as ..git/config and .gitmodule. Change-Id: Iffdc56536be71c5061caa23040ce0d89efd52196 Signed-off-by: Ronnie Sahlberg sahlb...@google.com Signed-off-by: Jonathan Nieder jrnie...@gmail.com --- branch.c | 14

[PATCH 09/15] refs.c: only write reflog update if msg is non-NULL

2014-10-21 Thread Ronnie Sahlberg
: I44c89caa7e7c4960777b79cfb5d339a5aa3ddf7a Signed-off-by: Ronnie Sahlberg sahlb...@google.com Signed-off-by: Jonathan Nieder jrnie...@gmail.com --- refs.c | 5 +++-- refs.h | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/refs.c b/refs.c index d54c3b9..f14b76e 100644 --- a/refs.c +++ b/refs.c @@ -3895,8

[PATCH 14/15] refs.c: remove lock_any_ref_for_update

2014-10-21 Thread Ronnie Sahlberg
commit 3a2f55c247ff290943fd552674e226062c13fd00 upstream. No one is using this function so we can delete it. Change-Id: I524dac239da500e5d4432328b997ed8ab34f6803 Signed-off-by: Ronnie Sahlberg sahlb...@google.com Signed-off-by: Jonathan Nieder jrnie...@gmail.com --- refs.c | 7 --- refs.h

[PATCH 15/15] refs.c: allow deleting refs with a broken sha1

2014-10-21 Thread Ronnie Sahlberg
: I4e744d9e7d8b7e81dde5479965819117d03c98db Signed-off-by: Ronnie Sahlberg sahlb...@google.com Signed-off-by: Jonathan Nieder jrnie...@gmail.com --- builtin/branch.c| 5 +++-- cache.h | 7 +++ refs.c | 6 ++ refs.h | 6 -- t

[PATCH 11/15] reflog.c: use a reflog transaction when writing during expire

2014-10-21 Thread Ronnie Sahlberg
commit 5ac378cd8fad09a836d17fec379780854838bde5 upstream. Use a transaction for all updates during expire_reflog. Change-Id: Ieb81b2660cefeeecf0bcb3cdbc1ef3cbb86e7eb8 Signed-off-by: Ronnie Sahlberg sahlb...@google.com Signed-off-by: Jonathan Nieder jrnie...@gmail.com --- builtin/reflog.c | 85

[PATCH 06/15] copy.c: make copy_fd preserve meaningful errno

2014-10-21 Thread Ronnie Sahlberg
commit 306805ccd147bfdf160b288a8d51fdf9b77ae0fa upstream. Update copy_fd to return a meaningful errno on failure. Change-Id: I771f9703acc816902affcf35ff2a56d9426315ac Signed-off-by: Ronnie Sahlberg sahlb...@google.com Signed-off-by: Jonathan Nieder jrnie...@gmail.com --- copy.c | 15

[PATCH 03/15] refs.c: use packed refs when deleting refs during a transaction

2014-10-21 Thread Ronnie Sahlberg
: I1e4f58050acaabc6bcfa3409fbc0c2b866bb59aa Signed-off-by: Ronnie Sahlberg sahlb...@google.com Signed-off-by: Jonathan Nieder jrnie...@gmail.com --- builtin/remote.c | 20 ++- refs.c | 155 ++- 2 files changed, 138 insertions(+), 37

[PATCH 02/15] refs.c: return error instead of dying when locking fails during transaction

2014-10-21 Thread Ronnie Sahlberg
: Ie830b7970412d9299e76a86f08633ce721130aed Signed-off-by: Ronnie Sahlberg sahlb...@google.com Signed-off-by: Jonathan Nieder jrnie...@gmail.com --- refs.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/refs.c b/refs.c index e49fbe9..c088d36 100644 --- a/refs.c +++ b/refs.c @@ -2340,6

[PATCH 04/15] refs.c: use a stringlist for repack_without_refs

2014-10-21 Thread Ronnie Sahlberg
Change-Id: I87a1b93c4b4f4a10ad6a9f8e2bb4d53f89b28c4a Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- builtin/remote.c | 23 --- refs.c | 42 +- refs.h | 2 +- 3 files changed, 30 insertions(+), 37 deletions

[PATCH 09/15] remote.c: use a transaction for deleting refs

2014-10-21 Thread Ronnie Sahlberg
Transactions now use packed refs when deleting multiple refs so there is no need to do it manually from remote.c any more. Change-Id: I50cf9c4ab0c190b99e2c6c4e2f05abe260b0fe62 Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- builtin/remote.c | 80

[PATCH 07/15] refs.c: move reflog updates into its own function

2014-10-21 Thread Ronnie Sahlberg
some code out into a separate function. Change-Id: I5ef6b32d183455685f8966379767f8c6e1ec49c9 Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs.c | 60 +++- 1 file changed, 35 insertions(+), 25 deletions(-) diff --git a/refs.c b/refs.c

[PATCH 14/15] refs.c: make lock_packed_refs take an err argument

2014-10-21 Thread Ronnie Sahlberg
Change-Id: Ibfc64ab19257484129ab0ad861b72c02414388df Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs.c | 25 + 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/refs.c b/refs.c index e0d5a82..7fb0d6c 100644 --- a/refs.c +++ b/refs.c @@ -2393,13

[PATCH 05/15] refs.c: update rename_ref to use a transaction

2014-10-21 Thread Ronnie Sahlberg
no longer use rename() on the reflog file, we can now safely perform renames even if the reflog is a symbolic link and thus can remove the check and fail for that condition. Change-Id: I59477d410a34298a29cf0cbf32328b9053b158fe Signed-off-by: Ronnie Sahlberg sahlb...@google.com Signed-off-by: Jonathan

[PATCH 00/15] ref-transaction-rename

2014-10-21 Thread Ronnie Sahlberg
. Ronnie Sahlberg (15): refs.c: allow passing raw git_committer_info as email to _update_reflog refs.c: return error instead of dying when locking fails during transaction refs.c: use packed refs when deleting refs during a transaction refs.c: use a stringlist for repack_without_refs

<    1   2   3   4   5   6   7   8   9   10   >