Re: [PATCH 03/16] refs: add methods for the ref iterators

2016-01-04 Thread Ronnie Sahlberg
On Sat, Jan 2, 2016 at 4:06 PM, David Aguilar wrote: > Apologies for the late review, and this review should probably > go on patch 01 or 02 but I don't have it in my mbox atm... > > On Wed, Dec 02, 2015 at 07:35:08PM -0500, David Turner wrote: >> From: Ronnie Sahlbe

Re: [PATCH 0/8] Making reflog modifications part of the transactions API

2014-12-12 Thread ronnie sahlberg
On Fri, Dec 12, 2014 at 11:17 AM, Michael Haggerty wrote: > On 12/06/2014 03:46 AM, Stefan Beller wrote: >> This goes on top of Michaels series. The idea of this series is make the >> reflogs being part of the transaction API, so it will be part of the contract >> of transaction_commit to either c

Re: [PATCH 07/23] expire_reflog(): use a lock_file for rewriting the reflog file

2014-12-04 Thread ronnie sahlberg
On Thu, Dec 4, 2014 at 3:08 PM, Michael Haggerty wrote: > We don't actually need the locking functionality, because we already > hold the lock on the reference itself, No. You do need the lock. The ref is locked only during transaction_commit() If you don't want to lock the reflog file and inste

Re: [PATCH] refs.c: repack_without_refs may be called without error string buffer

2014-11-20 Thread Ronnie Sahlberg
On Thu, Nov 20, 2014 at 10:35 AM, Jonathan Nieder wrote: > Stefan Beller wrote: > >> If we don't pass in the error string buffer, we skip over all >> parts dealing with preparing error messages. > > Please no. > > We tried this with the ref transaction code. When someone wants > to silence the me

Re: [PATCH] refs.c: repack_without_refs may be called without error string buffer

2014-11-20 Thread Ronnie Sahlberg
nt pack_refs(unsigned int flags); > * strbuf. > * > * The refs in 'without' may have any order. > - * The err buffer must not be omitted. > */ > extern int repack_without_refs(struct string_list *without, struct strbuf > *err); > > -- > 2.2.0.rc2.23.g

Re: [PATCH v3 00/14] ref-transactions-reflog

2014-11-18 Thread Ronnie Sahlberg
On Tue, Nov 18, 2014 at 3:26 AM, Michael Haggerty wrote: > On 11/18/2014 02:35 AM, Stefan Beller wrote: >> The following patch series updates the reflog handling to use transactions. >> This patch series has previously been sent to the list[1]. >> [...] > > I was reviewing this patch series (I lef

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

2014-11-11 Thread Ronnie Sahlberg
On Tue, Nov 11, 2014 at 2:34 AM, Jeff King wrote: > On Tue, Oct 21, 2014 at 01:36:47PM -0700, Ronnie Sahlberg wrote: > >> commit e193c10fc4f9274d1e751cfcdcc4507818e8d498 upstream. >> >> Change lock_ref_sha1_basic to return an error instead of dying when >> w

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

2014-11-07 Thread Ronnie Sahlberg
. This only adds protocol capability not ability for the user to activate it. Signed-off-by: Ronnie Sahlberg --- Documentation/technical/protocol-capabilities.txt | 12 ++-- builtin/receive-pack.c| 6 +- send-pack.c

[PATCH v3 4/7] push.c: add an --atomic-push argument

2014-11-07 Thread Ronnie Sahlberg
Add a command line argument to the git push command to request atomic pushes. Signed-off-by: Ronnie Sahlberg --- Documentation/git-push.txt | 7 ++- builtin/push.c | 2 ++ transport.c| 1 + transport.h| 1 + 4 files changed, 10 insertions(+), 1

[PATCH v3 12/16] refs.c: make the *_packed_refs functions static

2014-11-07 Thread Ronnie Sahlberg
We no longer need to expose the lock/add/commit/rollback functions for packed refs anymore so make them static and remove them from the public api. Signed-off-by: Ronnie Sahlberg --- refs.c | 8 refs.h | 30 -- 2 files changed, 4 insertions(+), 34 deletions

[PATCH v3 13/16] refs.c: replace the onerr argument in update_ref with a strbuf err

2014-11-07 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 --- builtin/checkout.c

[PATCH v3 14/16] refs.c: make add_packed_ref return an error instead of calling die

2014-11-07 Thread Ronnie Sahlberg
Change add_packed_ref to return an error instead of calling die(). Update all callers to check the return value of add_packed_ref. Signed-off-by: Ronnie Sahlberg --- refs.c | 21 + 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/refs.c b/refs.c index b59e2b8

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

2014-11-07 Thread Ronnie Sahlberg
Signed-off-by: Ronnie Sahlberg --- refs.c | 25 + 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/refs.c b/refs.c index 0829c55..1314a9a 100644 --- a/refs.c +++ b/refs.c @@ -2398,13 +2398,17 @@ static int write_packed_entry_fn(struct ref_entry *entry

[PATCH v3 05/16] refs.c: add transaction support for renaming a reflog

2014-11-07 Thread Ronnie Sahlberg
Add a new transaction function transaction_rename_reflog. Signed-off-by: Ronnie Sahlberg --- refs.c | 72 +- refs.h | 8 2 files changed, 79 insertions(+), 1 deletion(-) diff --git a/refs.c b/refs.c index e9e321e

[PATCH v3 6/7] refs.c: add an err argument to create_reflog

2014-11-07 Thread Ronnie Sahlberg
. Signed-off-by: Ronnie Sahlberg --- builtin/checkout.c | 8 +++--- refs.c | 71 +++--- refs.h | 4 +-- 3 files changed, 42 insertions(+), 41 deletions(-) diff --git a/builtin/checkout.c b/builtin/checkout.c index 60a68f7

[PATCH v3 5/7] t5543-atomic-push.sh: add basic tests for atomic pushes

2014-11-07 Thread Ronnie Sahlberg
Signed-off-by: Ronnie Sahlberg --- t/t5543-atomic-push.sh | 101 + 1 file changed, 101 insertions(+) create mode 100755 t/t5543-atomic-push.sh diff --git a/t/t5543-atomic-push.sh b/t/t5543-atomic-push.sh new file mode 100755 index 000

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

2014-11-07 Thread Ronnie Sahlberg
client scripts that depend on the old behavior 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 --- builtin/receive-pack.c | 73 +++--- 1 file

[PATCH v3 7/7] refs.c: add an err argument to create_symref

2014-11-07 Thread Ronnie Sahlberg
Signed-off-by: Ronnie Sahlberg --- builtin/branch.c | 7 +-- builtin/checkout.c | 13 ++--- builtin/clone.c| 15 +++ builtin/init-db.c | 8 ++-- builtin/notes.c| 7 --- builtin/remote.c | 26

[PATCH v3 0/7] ref-transaction-send-pack

2014-11-07 Thread Ronnie Sahlberg
typo in a commit message. Ronnie Sahlberg (7): 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 push.c: add an --atomic-push argument t5543

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

2014-11-07 Thread Ronnie Sahlberg
these refs failed to update since the atomic push operation failed." Signed-off-by: Ronnie Sahlberg --- Documentation/git-send-pack.txt | 7 ++- builtin/send-pack.c | 6 +- remote.h| 3 ++- send-pack.c

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

2014-11-07 Thread Ronnie Sahlberg
Change lock_ref_sha1_basic to return an error instead of dying when we fail to lock a file during a transaction. This function is only called from transaction_commit() and it knows how to handle these failures. Signed-off-by: Ronnie Sahlberg Signed-off-by: Jonathan Nieder --- refs.c | 10

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

2014-11-07 Thread Ronnie Sahlberg
t we can lock the packed refs file, do other stuff, and later be able to call repack_without_refs with the lock already taken. This means we need some additional changes in remote.c to reflect the changes to the repack_without_refs semantics. Signed-off-by: Ronnie Sahlberg Signed-off-by: Jo

[PATCH v3 08/16] refs.c: move reflog updates into its own function

2014-11-07 Thread Ronnie Sahlberg
some code out into a separate function. Signed-off-by: Ronnie Sahlberg --- refs.c | 60 +++- 1 file changed, 35 insertions(+), 25 deletions(-) diff --git a/refs.c b/refs.c index 5a8f3da..7f4b4cb 100644 --- a/refs.c +++ b/refs.c @@ -3028,6

[PATCH v3 09/16] refs.c: write updates to packed refs when a transaction has more than one ref

2014-11-07 Thread Ronnie Sahlberg
ppear as a single atomic change to any external observers instead of a sequence of discreete changes. Signed-off-by: Ronnie Sahlberg --- builtin/clone.c | 16 ++--- refs.c| 89 ++- t/t5516-fetch-push.sh | 2 +- 3 files c

[PATCH v3 06/16] refs.c: update rename_ref to use a transaction

2014-11-07 Thread Ronnie Sahlberg
Change refs.c to use a single transaction to perform the rename. Change the function to return 1 on failure instead of either -1 or 1. These changes make the rename_ref operation atomic. Signed-off-by: Ronnie Sahlberg --- refs.c| 168

[PATCH v3 07/16] refs.c: rollback the lockfile before we die() in repack_without_refs

2014-11-07 Thread Ronnie Sahlberg
Signed-off-by: Ronnie Sahlberg Signed-off-by: Jonathan Nieder --- refs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/refs.c b/refs.c index 9a3c7fe..5a8f3da 100644 --- a/refs.c +++ b/refs.c @@ -2707,8 +2707,10 @@ int repack_without_refs(struct string_list *without

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

2014-11-07 Thread Ronnie Sahlberg
Signed-off-by: Ronnie Sahlberg --- builtin/pack-refs.c | 8 +++- refs.c | 7 +++ refs.h | 3 ++- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/builtin/pack-refs.c b/builtin/pack-refs.c index b20b1ec..299768e 100644 --- a/builtin/pack-refs.c

[PATCH v3 11/16] refs.c: make repack_without_refs static

2014-11-07 Thread Ronnie Sahlberg
Signed-off-by: Ronnie Sahlberg --- refs.c | 2 +- refs.h | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/refs.c b/refs.c index c1db86f..2c6b0f6 100644 --- a/refs.c +++ b/refs.c @@ -2668,7 +2668,7 @@ static int curate_packed_ref_fn(struct ref_entry *entry, void *cb_data

[PATCH v3 10/16] remote.c: use a transaction for deleting refs

2014-11-07 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. Signed-off-by: Ronnie Sahlberg --- builtin/remote.c | 80 1 file changed, 40 insertions(+), 40 deletions(-) diff

[PATCH v3 01/16] refs.c: allow passing raw git_committer_info as email to _update_reflog

2014-11-07 Thread Ronnie Sahlberg
, also go over and change all references from email to id where the code actually refers to a committer id and not just an email address. I.e. where the string is : NAME Signed-off-by: Ronnie Sahlberg Signed-off-by: Jonathan Nieder --- builtin/reflog.c | 19 +-- refs.c

[PATCH v3 00/16] ref-transaction-rename

2014-11-07 Thread Ronnie Sahlberg
reflog backend will provide optimized versions for these "read whole reflog" "write whole reflog" functions. Version 3: - Rename and redo the API for updating a whole reflog in one single operation to transaction_rename_reflog() Ronnie Sahlberg (16): refs.c: allow passing ra

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

2014-11-07 Thread Ronnie Sahlberg
Signed-off-by: Ronnie Sahlberg --- builtin/remote.c | 23 --- refs.c | 42 +- refs.h | 2 +- 3 files changed, 30 insertions(+), 37 deletions(-) diff --git a/builtin/remote.c b/builtin/remote.c index c25420f

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

2014-11-04 Thread Ronnie Sahlberg
Fixed. Thanks On Tue, Nov 4, 2014 at 2:17 PM, Stefan Beller wrote: > On Mon, Nov 3, 2014 at 11:12 AM, Ronnie Sahlberg wrote: >> This adds support to send-pack to to negotiate and use atomic pushes > > /s/to to/to/ > >> iff the server supports it. Atomic pushes are ac

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

2014-11-03 Thread Ronnie Sahlberg
client scripts that depend on the old behavior 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 --- builtin/receive-pack.c | 73 +++--- 1 file

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

2014-11-03 Thread Ronnie Sahlberg
. This only adds protocol capability not ability for the user to activate it. Signed-off-by: Ronnie Sahlberg --- Documentation/technical/protocol-capabilities.txt | 12 ++-- builtin/receive-pack.c| 6 +- send-pack.c

[PATCH v2 6/7] refs.c: add an err argument to create_reflog

2014-11-03 Thread Ronnie Sahlberg
. Signed-off-by: Ronnie Sahlberg --- builtin/checkout.c | 8 +++--- refs.c | 71 +++--- refs.h | 4 +-- 3 files changed, 42 insertions(+), 41 deletions(-) diff --git a/builtin/checkout.c b/builtin/checkout.c index 60a68f7

[PATCH v2 7/7] refs.c: add an err argument to create_symref

2014-11-03 Thread Ronnie Sahlberg
Signed-off-by: Ronnie Sahlberg --- builtin/branch.c | 7 +-- builtin/checkout.c | 13 ++--- builtin/clone.c| 15 +++ builtin/init-db.c | 8 ++-- builtin/notes.c| 7 --- builtin/remote.c | 26

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

2014-11-03 Thread Ronnie Sahlberg
quot;these refs failed to update since the atomic push operation failed." Signed-off-by: Ronnie Sahlberg --- Documentation/git-send-pack.txt | 7 ++- builtin/send-pack.c | 6 +- remote.h| 3 ++- send-pack.c

[PATCH v2 5/7] t5543-atomic-push.sh: add basic tests for atomic pushes

2014-11-03 Thread Ronnie Sahlberg
Signed-off-by: Ronnie Sahlberg --- t/t5543-atomic-push.sh | 101 + 1 file changed, 101 insertions(+) create mode 100755 t/t5543-atomic-push.sh diff --git a/t/t5543-atomic-push.sh b/t/t5543-atomic-push.sh new file mode 100755 index 000

[PATCH v2 4/7] push.c: add an --atomic-push argument

2014-11-03 Thread Ronnie Sahlberg
Add a command line argument to the git push command to request atomic pushes. Signed-off-by: Ronnie Sahlberg --- Documentation/git-push.txt | 7 ++- builtin/push.c | 2 ++ transport.c| 1 + transport.h| 1 + 4 files changed, 10 insertions(+), 1

[PATCH v2 0/7] ref-transaction-send-pack

2014-11-03 Thread Ronnie Sahlberg
. With this series we can now perform atomic pushes to a repository. Version 2: - Reordered the capabilities we send so that agent= remains the last capability listed. - Reworded the paragraph for atomic push in git-send-pack.txt - Dropped the patch for receive.preferatomicpush Ronnie Sahlberg (7

[PATCH v2 08/17] refs.c: rollback the lockfile before we die() in repack_without_refs

2014-11-03 Thread Ronnie Sahlberg
Signed-off-by: Ronnie Sahlberg Signed-off-by: Jonathan Nieder --- refs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/refs.c b/refs.c index 44d38ab..becf188 100644 --- a/refs.c +++ b/refs.c @@ -2707,8 +2707,10 @@ int repack_without_refs(struct string_list *without

[PATCH v2 10/17] refs.c: write updates to packed refs when a transaction has more than one ref

2014-11-03 Thread Ronnie Sahlberg
ppear as a single atomic change to any external observers instead of a sequence of discreete changes. Signed-off-by: Ronnie Sahlberg --- builtin/clone.c | 16 ++--- refs.c| 89 ++- t/t5516-fetch-push.sh | 2 +- 3 files c

[PATCH v2 14/17] refs.c: replace the onerr argument in update_ref with a strbuf err

2014-11-03 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 --- builtin/checkout.c

[PATCH v2 15/17] refs.c: make add_packed_ref return an error instead of calling die

2014-11-03 Thread Ronnie Sahlberg
Change add_packed_ref to return an error instead of calling die(). Update all callers to check the return value of add_packed_ref. Signed-off-by: Ronnie Sahlberg --- refs.c | 21 + 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/refs.c b/refs.c index aefbce4

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

2014-11-03 Thread Ronnie Sahlberg
Signed-off-by: Ronnie Sahlberg --- builtin/pack-refs.c | 8 +++- refs.c | 7 +++ refs.h | 3 ++- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/builtin/pack-refs.c b/builtin/pack-refs.c index b20b1ec..299768e 100644 --- a/builtin/pack-refs.c

[PATCH v2 09/17] refs.c: move reflog updates into its own function

2014-11-03 Thread Ronnie Sahlberg
some code out into a separate function. Signed-off-by: Ronnie Sahlberg --- refs.c | 60 +++- 1 file changed, 35 insertions(+), 25 deletions(-) diff --git a/refs.c b/refs.c index becf188..a3815d1 100644 --- a/refs.c +++ b/refs.c @@ -3033,6

[PATCH v2 12/17] refs.c: make repack_without_refs static

2014-11-03 Thread Ronnie Sahlberg
Signed-off-by: Ronnie Sahlberg --- refs.c | 2 +- refs.h | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/refs.c b/refs.c index 57e5d2f..56b0360 100644 --- a/refs.c +++ b/refs.c @@ -2668,7 +2668,7 @@ static int curate_packed_ref_fn(struct ref_entry *entry, void *cb_data

[PATCH v2 16/17] refs.c: make lock_packed_refs take an err argument

2014-11-03 Thread Ronnie Sahlberg
Signed-off-by: Ronnie Sahlberg --- refs.c | 25 + 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/refs.c b/refs.c index 0b9cb8d..92e7714 100644 --- a/refs.c +++ b/refs.c @@ -2398,13 +2398,17 @@ static int write_packed_entry_fn(struct ref_entry *entry

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

2014-11-03 Thread Ronnie Sahlberg
Signed-off-by: Ronnie Sahlberg --- builtin/remote.c | 23 --- refs.c | 42 +- refs.h | 2 +- 3 files changed, 30 insertions(+), 37 deletions(-) diff --git a/builtin/remote.c b/builtin/remote.c index c25420f

[PATCH v2 07/17] refs.c: update rename_ref to use a transaction

2014-11-03 Thread Ronnie Sahlberg
Change refs.c to use a single transaction to perform the rename. Change the function to return 1 on failure instead of either -1 or 1. These changes make the rename_ref operation atomic. Signed-off-by: Ronnie Sahlberg --- refs.c| 173

[PATCH v2 06/17] refs.c: add new function copy_reflog_into_strbuf

2014-11-03 Thread Ronnie Sahlberg
read_in_full the whole file into a strbuf. When we add other types of backends for refs we will need to implement similarly optimized versions of this functions for them. Signed-off-by: Ronnie Sahlberg --- refs.c | 31 +++ 1 file changed, 31 insertions(+) diff --git a

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

2014-11-03 Thread Ronnie Sahlberg
t we can lock the packed refs file, do other stuff, and later be able to call repack_without_refs with the lock already taken. This means we need some additional changes in remote.c to reflect the changes to the repack_without_refs semantics. Signed-off-by: Ronnie Sahlberg Signed-off-by: Jo

[PATCH v2 11/17] remote.c: use a transaction for deleting refs

2014-11-03 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. Signed-off-by: Ronnie Sahlberg --- builtin/remote.c | 80 1 file changed, 40 insertions(+), 40 deletions(-) diff

[PATCH v2 13/17] refs.c: make the *_packed_refs functions static

2014-11-03 Thread Ronnie Sahlberg
We no longer need to expose the lock/add/commit/rollback functions for packed refs anymore so make them static and remove them from the public api. Signed-off-by: Ronnie Sahlberg --- refs.c | 8 refs.h | 30 -- 2 files changed, 4 insertions(+), 34 deletions

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

2014-11-03 Thread Ronnie Sahlberg
Change lock_ref_sha1_basic to return an error instead of dying when we fail to lock a file during a transaction. This function is only called from transaction_commit() and it knows how to handle these failures. Signed-off-by: Ronnie Sahlberg Signed-off-by: Jonathan Nieder --- refs.c | 10

[PATCH v2 05/17] refs.c: add transaction support for replacing a reflog

2014-11-03 Thread Ronnie Sahlberg
Add a new transaction function transaction_replace_reflog. This function takes a blob and replaces the new or existing reflog with the content of this blob. This will be used by rename_ref where we basically want to copy the existing blob as is. Signed-off-by: Ronnie Sahlberg --- refs.c | 38

[PATCH v2 01/17] refs.c: allow passing raw git_committer_info as email to _update_reflog

2014-11-03 Thread Ronnie Sahlberg
, also go over and change all references from email to id where the code actually refers to a committer id and not just an email address. I.e. where the string is : NAME Signed-off-by: Ronnie Sahlberg Signed-off-by: Jonathan Nieder --- builtin/reflog.c | 19 +-- refs.c

[PATCH v2 00/17] ref-transaction-rename

2014-11-03 Thread Ronnie Sahlberg
reflog backend will provide optimized versions for these "read whole reflog" "write whole reflog" functions. Ronnie Sahlberg (17): refs.c: allow passing raw git_committer_info as email to _update_reflog refs.c: return error instead of dying when locking fails during

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

2014-11-03 Thread Ronnie Sahlberg
No one is using this function so we can delete it. Signed-off-by: Ronnie Sahlberg Signed-off-by: Jonathan Nieder --- refs.c | 7 --- refs.h | 9 + 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/refs.c b/refs.c index e4ad4f4..6d50a32 100644 --- a/refs.c +++ b/refs.c

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

2014-11-03 Thread Ronnie Sahlberg
Signed-off-by: Ronnie Sahlberg Signed-off-by: Jonathan Nieder --- refs.c | 22 ++ refs.h | 2 +- 2 files changed, 3 insertions(+), 21 deletions(-) diff --git a/refs.c b/refs.c index ed0485e..c607ab7 100644 --- a/refs.c +++ b/refs.c @@ -3633,26 +3633,8 @@ int

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

2014-11-03 Thread Ronnie Sahlberg
Add a flag that allows us to truncate the reflog before we write the update. Signed-off-by: Ronnie Sahlberg Signed-off-by: Jonathan Nieder --- refs.c | 17 +++-- refs.h | 10 +- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/refs.c b/refs.c index 100b3a3

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

2014-11-03 Thread Ronnie Sahlberg
The ref_transaction_update function can already be used to create refs by passing null_sha1 as the old_sha1 parameter. Simplify by replacing transaction_create with a thin wrapper. Signed-off-by: Ronnie Sahlberg Signed-off-by: Jonathan Nieder --- refs.c | 27 ++- 1 file

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

2014-11-03 Thread Ronnie Sahlberg
Define a new transaction update type, UPDATE_LOG, and a new function transaction_update_reflog. This function will lock the reflog and append an entry to it during transaction commit. Signed-off-by: Ronnie Sahlberg Signed-off-by: Jonathan Nieder --- refs.c | 102

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

2014-11-03 Thread Ronnie Sahlberg
Update copy_fd to return a meaningful errno on failure. Signed-off-by: Ronnie Sahlberg Signed-off-by: Jonathan Nieder --- copy.c | 15 ++- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/copy.c b/copy.c index f2970ec..a8d366e 100644 --- a/copy.c +++ b/copy.c @@ -8,12

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

2014-11-03 Thread Ronnie Sahlberg
at()+close(). Signed-off-by: Ronnie Sahlberg Signed-off-by: Jonathan Nieder --- builtin/checkout.c | 8 +--- refs.c | 22 +- refs.h | 8 +++- 3 files changed, 17 insertions(+), 21 deletions(-) diff --git a/builtin/checkout.c b/builtin/checko

[PATCH v2 04/15] refs.c: add a new update_type field to ref_update

2014-11-03 Thread Ronnie Sahlberg
Add a field that describes what type of update this refers to. For now the only type is UPDATE_SHA1 but we will soon add more types. Signed-off-by: Ronnie Sahlberg Signed-off-by: Jonathan Nieder --- refs.c | 27 +++ 1 file changed, 23 insertions(+), 4 deletions(-) diff

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

2014-11-03 Thread Ronnie Sahlberg
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). Signed-off-by: Ronnie Sahlberg Signed-off-by: Jonathan Nieder --- refs.c | 48 ++-- 1 file changed, 30 insertions(+), 18

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

2014-11-03 Thread Ronnie Sahlberg
r usecases. Thus the whole expire becomes O(n) instead of O(n2). If in the future we start doing this for many refs in one single transaction we might want to optimize this. But there is no need to complexify the code and optimize for future usecases that might never materialize at this stage. S

[PATCH v2 00/15] ref-transactions-reflog

2014-11-03 Thread Ronnie Sahlberg
othogonal features. - Improve the comments for the transaction flags field in refs.c: allow multiple reflog updates during a single transaction. Ronnie Sahlberg (15): refs.c make ref_transaction_create a wrapper to ref_transaction_update refs.c: make ref_transaction_delete a wrapper for

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

2014-11-03 Thread Ronnie Sahlberg
unlock|close|commit_ref can be made static since there are no more external callers. Signed-off-by: Ronnie Sahlberg Signed-off-by: Jonathan Nieder --- refs.c | 24 refs.h | 9 - 2 files changed, 12 insertions(+), 21 deletions(-) diff --git a/refs.c b/refs.c

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

2014-11-03 Thread Ronnie Sahlberg
by Bob because ..." + REFLOG_TRUNCATE and have it truncate the log and have it start fresh with an initial message that explains the log was truncated. This API allows that. Signed-off-by: Ronnie Sahlberg Signed-off-by: Jonathan Nieder --- refs.c | 5 +++-- refs.h | 1 + 2 files changed, 4 insert

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

2014-11-03 Thread Ronnie Sahlberg
actually be resolved to a sha1, they instead resolve to null_sha1 when these flags are used. For example, the ref: echo "Broken ref" > .git/refs/heads/foo-broken-1 can now be deleted using git branch -d foo-broken-1 Signed-off-by: Ronnie Sahlberg Signed-off-by: Jonathan Nieder

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

2014-11-03 Thread Ronnie Sahlberg
objects. Such as ..git/config and .gitmodule. Signed-off-by: Ronnie Sahlberg Signed-off-by: Jonathan Nieder --- branch.c | 14 - builtin/commit.c | 10 +++ builtin/fetch.c| 12 builtin/receive-pack.c | 13 - builtin/replace.c | 10

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

2014-11-03 Thread Ronnie Sahlberg
Use a transaction for all updates during expire_reflog. Signed-off-by: Ronnie Sahlberg Signed-off-by: Jonathan Nieder --- builtin/reflog.c | 85 refs.c | 4 +-- refs.h | 2 +- 3 files changed, 40 insertions(+), 51

Re: [PATCH 6/8] receive-pack.c: add a receive.preferatomicpush configuration variable

2014-10-30 Thread Ronnie Sahlberg
On Thu, Oct 30, 2014 at 3:03 PM, Junio C Hamano wrote: > Ronnie Sahlberg writes: > >> At some stage it may becomes too many preferences and over-engineered. >> Maybe I should drop this patch and then just require the plain "if you >> want a push to be atomic, then us

Re: [PATCH 6/8] receive-pack.c: add a receive.preferatomicpush configuration variable

2014-10-30 Thread Ronnie Sahlberg
On Thu, Oct 30, 2014 at 1:11 PM, Junio C Hamano wrote: > Ronnie Sahlberg writes: > >> Add receive.preferatomicpush setting to receive-pack.c. This triggers >> a new capability "prefer-atomic-push" to be sent back to the send-pack >> client, requesting the cli

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

2014-10-30 Thread Ronnie Sahlberg
On Thu, Oct 30, 2014 at 1:04 PM, Junio C Hamano wrote: > Ronnie Sahlberg writes: > >> diff --git a/Documentation/git-send-pack.txt >> b/Documentation/git-send-pack.txt >> index 2a0de42..8f64feb 100644 >> --- a/Documentation/git-send-pack.txt >> +++ b/Docume

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

2014-10-30 Thread Ronnie Sahlberg
On Thu, Oct 30, 2014 at 12:59 PM, Junio C Hamano wrote: > Ronnie Sahlberg writes: > >> @@ -337,6 +341,8 @@ int send_pack(struct send_pack_args *args, >> strbuf_addstr(&cap_buf, " quiet"); >> if (agent_supported) >>

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

2014-10-30 Thread Ronnie Sahlberg
On Wed, Oct 29, 2014 at 11:43 AM, Junio C Hamano wrote: > Ronnie Sahlberg writes: > >> On Tue, Oct 28, 2014 at 2:12 PM, Junio C Hamano wrote: >> >>> More importantly, when you know that the end result you want to see >>> is that the old and new log fil

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

2014-10-29 Thread Ronnie Sahlberg
On Tue, Oct 28, 2014 at 2:12 PM, Junio C Hamano wrote: > Ronnie Sahlberg writes: > >> I timed a git branch -m for a branch with ~2400 log entries and it >> takes neglible time : >> real 0m0.008s >> user 0m0.000s >> sys 0m0.007s > > I really hate

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

2014-10-28 Thread Ronnie Sahlberg
On Tue, Oct 28, 2014 at 12:56 PM, Junio C Hamano wrote: > Junio C Hamano writes: > >> Ronnie Sahlberg writes: >> >>> commit 0295e9cebc41020ee84da275549b164a8770ffba upstream. >>> >>> Change refs.c to use a single transaction to copy/rename both

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

2014-10-28 Thread Ronnie Sahlberg
On Thu, Oct 23, 2014 at 11:54 AM, Junio C Hamano wrote: > Ronnie Sahlberg writes: > >> @@ -3531,7 +3537,7 @@ struct ref_update { >> enum transaction_update_type update_type; >> unsigned char new_sha1[20]; >> unsigned char old_sha1[20]; >

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

2014-10-28 Thread Ronnie Sahlberg
On Thu, Oct 23, 2014 at 11:32 AM, Junio C Hamano wrote: > Ronnie Sahlberg writes: > >> commit 020ed65a12838bdead64bc3c5de249d3c8f5cfd8 upstream. >> >> When performing a reflog transaction update, only write to the reflog iff >> msg is non-NULL. This can then be co

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

2014-10-23 Thread Ronnie Sahlberg
On Thu, Oct 23, 2014 at 10:51 AM, Junio C Hamano wrote: > Ronnie Sahlberg writes: > >> commit 306805ccd147bfdf160b288a8d51fdf9b77ae0fa upstream. >> >> Update copy_fd to return a meaningful errno on failure. > > These two are good changes, but makes me wonder if mor

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

2014-10-23 Thread Ronnie Sahlberg
On Thu, Oct 23, 2014 at 10:42 AM, Junio C Hamano wrote: > Ronnie Sahlberg writes: > >> Subject: Re: [PATCH 01/15] refs.c make ref_transaction_create a wrapper to >> ref_transaction_update > > Missing colon after "refs.c" > >> commit 03001144a015f81

[PATCH 06/15] refs.c: rollback the lockfile before we die() in repack_without_refs

2014-10-21 Thread Ronnie Sahlberg
commit 3989c2a763c3b355785d609b3144c7935dffb273 upstream. Change-Id: I63a22da521ecc8eb60d7a8aaa5af666d2827a599 Signed-off-by: Ronnie Sahlberg Signed-off-by: Jonathan Nieder --- refs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/refs.c b/refs.c index f43fef4..43df656

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

2014-10-21 Thread Ronnie Sahlberg
client scripts that depend on the old behavior 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. Change-Id: Ice9739aa2676f76d2e7fab2d54f37047b2eb277e Signed-off-by: Ronnie Sahlberg --- builtin/receive-pack.c | 73

[PATCH 7/8] refs.c: add an err argument to create_reflog

2014-10-21 Thread Ronnie Sahlberg
. Change-Id: I8f796a8c0c5f5d3f26e3e59fbc6421c894a4e814 Signed-off-by: Ronnie Sahlberg --- builtin/checkout.c | 8 +++--- refs.c | 71 +++--- refs.h | 4 +-- 3 files changed, 42 insertions(+), 41 deletions(-) diff --git a

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

2014-10-21 Thread Ronnie Sahlberg
quot;these refs failed to update since the atomic push operation failed." Change-Id: Ifbcdc10c032a51d317ae7a6eacc03cf32e660bbe Signed-off-by: Ronnie Sahlberg --- Documentation/git-send-pack.txt | 7 ++- builtin/send-pack.c | 6 +- remote.h| 3 +

[PATCH 11/15] refs.c: make the *_packed_refs functions static

2014-10-21 Thread Ronnie Sahlberg
We no longer need to expose the lock/add/commit/rollback functions for packed refs anymore so make them static and remove them from the public api. Change-Id: I1059f1690129f0232cb27872ef494024ef7f299e Signed-off-by: Ronnie Sahlberg --- refs.c | 8 refs.h | 30

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

2014-10-21 Thread Ronnie Sahlberg
. This only adds protocol capability not ability for the user to activate it. Change-Id: I9a12940fb5c7443a1ddf9e45f6ea33b547c7ecfd Signed-off-by: Ronnie Sahlberg --- Documentation/technical/protocol-capabilities.txt | 12 ++-- builtin/receive-pack.c| 6

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

2014-10-21 Thread Ronnie Sahlberg
Change-Id: I1e65ac429c14f01073d95c6440f820dda1c6091b Signed-off-by: Ronnie Sahlberg --- builtin/pack-refs.c | 8 +++- refs.c | 7 +++ refs.h | 3 ++- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/builtin/pack-refs.c b/builtin/pack-refs.c index

[PATCH 5/8] t5543-atomic-push.sh: add basic tests for atomic pushes

2014-10-21 Thread Ronnie Sahlberg
Change-Id: I3a6491515b78b564d1cc0892826a4bc77f9bffb0 Signed-off-by: Ronnie Sahlberg --- t/t5543-atomic-push.sh | 101 + 1 file changed, 101 insertions(+) create mode 100755 t/t5543-atomic-push.sh diff --git a/t/t5543-atomic-push.sh b/t/t5543

[PATCH 6/8] receive-pack.c: add a receive.preferatomicpush configuration variable

2014-10-21 Thread Ronnie Sahlberg
e from the server side we must tell the client to not fail refs early and use an atomic push. We can not enforce this on the server side only. Change-Id: I6677cd565f48a09bb552fe3f4c00bbb6d343c224 Signed-off-by: Ronnie Sahlberg --- Documentation/config.txt | 4 +++ Doc

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

2014-10-21 Thread Ronnie Sahlberg
-off-by: Ronnie Sahlberg --- builtin/checkout.c | 7 +-- builtin/clone.c | 20 builtin/merge.c | 20 +--- builtin/notes.c | 24 ++-- builtin/reset.c | 12 builtin/update-ref.c | 7 +-- notes

[PATCH 0/8] ref-transaction-send-pack

2014-10-21 Thread Ronnie Sahlberg
. With this series we can now perform atomic pushes to a repository. Ronnie Sahlberg (8): 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 push.c

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

2014-10-21 Thread Ronnie Sahlberg
Add a command line argument to the git push command to request atomic pushes. Change-Id: I9f8d06970b2fdd1cf7d933e0cce1288752034af1 Signed-off-by: Ronnie Sahlberg --- Documentation/git-push.txt | 7 ++- builtin/push.c | 2 ++ transport.c| 1 + transport.h

[PATCH 8/8] refs.c: add an err argument to create_symref

2014-10-21 Thread Ronnie Sahlberg
Change-Id: I812e7600fb648df429df8a2c84745de4f5875626 Signed-off-by: Ronnie Sahlberg --- builtin/branch.c | 7 +-- builtin/checkout.c | 13 ++--- builtin/clone.c| 15 +++ builtin/init-db.c | 8 ++-- builtin/notes.c| 7 --- builtin

[PATCH 10/15] refs.c: make repack_without_refs static

2014-10-21 Thread Ronnie Sahlberg
Change-Id: Ibf02549e5485ad07da66fe4b1c84f9e2b76b2aca Signed-off-by: Ronnie Sahlberg --- refs.c | 2 +- refs.h | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/refs.c b/refs.c index b64d0c7..fddd59c 100644 --- a/refs.c +++ b/refs.c @@ -2663,7 +2663,7 @@ static int

  1   2   3   4   5   6   7   8   9   10   >