Update hold_lock_file_for_append and copy_fd to return a meaningful errno
on failure.
Signed-off-by: Ronnie Sahlberg
---
copy.c | 20 +---
lockfile.c | 7 ++-
2 files changed, 19 insertions(+), 8 deletions(-)
diff --git a/copy.c b/copy.c
index a7f58fd..5cb8679 100644
When performing a reflog transaction update, only write to the reflog iff
msg is non-NULL. This can then be combined with REFLOG_TRUNCATE to perform
an update that only truncates but does not write.
Signed-off-by: Ronnie Sahlberg
---
refs.c | 5 +++--
refs.h | 1 +
2 files changed, 4 insertions
No one is using this function so we can delete it.
Signed-off-by: Ronnie Sahlberg
---
refs.c | 7 ---
refs.h | 10 +-
2 files changed, 1 insertion(+), 16 deletions(-)
diff --git a/refs.c b/refs.c
index 3f16445..a2c3630 100644
--- a/refs.c
+++ b/refs.c
@@ -2207,13 +2207,6 @@ static
o see that the log already exists instead of
performing, for every single update, open(O_CREAT)+lstat()+close().
Signed-off-by: Ronnie Sahlberg
---
builtin/checkout.c | 8 +-
refs.c | 78 ++
refs.h | 8 +++---
3 fil
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
---
refs.c | 101
Signed-off-by: Ronnie Sahlberg
---
refs.c | 13 ++---
refs.h | 7 ---
2 files changed, 6 insertions(+), 14 deletions(-)
diff --git a/refs.c b/refs.c
index fbb34c0..c62df4c 100644
--- a/refs.c
+++ b/refs.c
@@ -3509,23 +3509,14 @@ int ref_transaction_create(struct ref_transaction
Use a transaction for all updates during expire_reflog.
Signed-off-by: Ronnie Sahlberg
---
builtin/reflog.c | 85
refs.c | 4 +--
refs.h | 2 +-
3 files changed, 39 insertions(+), 52 deletions(-)
diff --git a
Signed-off-by: Ronnie Sahlberg
---
refs.c | 24
refs.h | 9 -
2 files changed, 12 insertions(+), 21 deletions(-)
diff --git a/refs.c b/refs.c
index f579d63..3f16445 100644
--- a/refs.c
+++ b/refs.c
@@ -1962,6 +1962,16 @@ int refname_match(const char
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
---
refs.c | 25 +
1 file changed, 21 insertions(+), 4 deletions(-)
diff --git a/refs.c b/refs.c
index
Rename the transaction functions. Remove the leading ref_ from the
names and append _sha1 to the names for functions that create/delete/
update sha1 refs.
Signed-off-by: Ronnie Sahlberg
---
branch.c | 11 +++
builtin/commit.c | 14 -
builtin/fetch.c| 12
where we read and parse the entries
(the two interators).
This is version 2 of the series and is mainly rebased and tweaked to apply
ontop of origin/pu and all the changes/conflicts between it and the previous
base.
Ronnie Sahlberg (14):
refs.c make ref_transaction_create a wrapper to
rolled back already.
Reviewed-by: Jonathan Nieder
Signed-off-by: Ronnie Sahlberg
---
refs.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/refs.c b/refs.c
index a767ef6..0faed29 100644
--- a/refs.c
+++ b/refs.c
@@ -3312,6 +3312,9 @@ void ref_transaction_free(struct ref_transaction
*transac
We call read_ref_full with a pointer to flags from rename_ref but since
we never actually use the returned flags we can just pass NULL here instead.
Reviewed-by: Jonathan Nieder
Signed-off-by: Ronnie Sahlberg
---
refs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/refs.c
Change update_branch() to use ref transactions for updates.
Reviewed-by: Jonathan Nieder
Signed-off-by: Ronnie Sahlberg
---
fast-import.c | 24 ++--
1 file changed, 14 insertions(+), 10 deletions(-)
diff --git a/fast-import.c b/fast-import.c
index fb4738d..0752f0a 100644
to start returning more detailed error conditions than the current
simple success/failure. For example if the commit failed due to name
conflicts etc.
Reviewed-by: Jonathan Nieder
Signed-off-by: Ronnie Sahlberg
---
refs.c | 35 +--
1 file changed, 9 insertions
Change commit.c to use ref transactions for all ref updates.
Make sure we pass a NULL pointer to ref_transaction_update if have_old
is false.
Reviewed-by: Jonathan Nieder
Signed-off-by: Ronnie Sahlberg
---
builtin/commit.c | 24 +++-
1 file changed, 11 insertions(+), 13
Change s_update_ref to use a ref transaction for the ref update.
Signed-off-by: Ronnie Sahlberg
---
builtin/fetch.c | 33 +++--
1 file changed, 23 insertions(+), 10 deletions(-)
diff --git a/builtin/fetch.c b/builtin/fetch.c
index faa1233..52f1ebc 100644
--- a
Change the reference transactions so that we pass the reflog message
through to the create/delete/update function instead of the commit message.
This allows for individual messages for each change in a multi ref
transaction.
Reviewed-by: Jonathan Nieder
Signed-off-by: Ronnie Sahlberg
Skip using the lock_any_ref_for_update wrapper and call lock_ref_sha1_basic
directly from the commit function.
Reviewed-by: Jonathan Nieder
Signed-off-by: Ronnie Sahlberg
---
refs.c | 12 ++--
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/refs.c b/refs.c
index 69815d9
Nieder
Signed-off-by: Ronnie Sahlberg
---
refs.c | 28 +---
refs.h | 14 --
2 files changed, 33 insertions(+), 9 deletions(-)
diff --git a/refs.c b/refs.c
index 6c3e34c..94fda74 100644
--- a/refs.c
+++ b/refs.c
@@ -30,6 +30,12 @@ static inline int
Since we now only call update_ref_lock with onerr==QUIET_ON_ERR we no longer
need this function and can replace it with just calling lock_any_ref_for_update
directly.
Reviewed-by: Jonathan Nieder
Signed-off-by: Ronnie Sahlberg
---
refs.c | 30 ++
1 file changed, 6
Update replace.c to use ref transactions for updates.
Reviewed-by: Jonathan Nieder
Signed-off-by: Ronnie Sahlberg
---
builtin/replace.c | 15 +--
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/builtin/replace.c b/builtin/replace.c
index b62420a..24f0dc9 100644
--- a
directly.
Signed-off-by: Ronnie Sahlberg
---
refs.c | 22 +++---
refs.h | 6 ++
2 files changed, 21 insertions(+), 7 deletions(-)
diff --git a/refs.c b/refs.c
index be6b4b6..47575e8 100644
--- a/refs.c
+++ b/refs.c
@@ -3555,7 +3555,7 @@ static int ref_update_reject_duplicates
.
Reviewed-by: Jonathan Nieder
Signed-off-by: Ronnie Sahlberg
---
refs.c | 34 +-
1 file changed, 13 insertions(+), 21 deletions(-)
diff --git a/refs.c b/refs.c
index 94fda74..34383ba 100644
--- a/refs.c
+++ b/refs.c
@@ -2518,11 +2518,6 @@ static int repack_without_refs
-by: Jonathan Nieder
Signed-off-by: Ronnie Sahlberg
---
refs.c | 15 +--
1 file changed, 5 insertions(+), 10 deletions(-)
diff --git a/refs.c b/refs.c
index 859f87b..6c3e34c 100644
--- a/refs.c
+++ b/refs.c
@@ -2143,15 +2143,6 @@ static struct ref_lock *lock_ref_sha1_basic(
Signed-off-by: Ronnie Sahlberg
---
walker.c | 59 +++
1 file changed, 35 insertions(+), 24 deletions(-)
diff --git a/walker.c b/walker.c
index 1dd86b8..60d9f9e 100644
--- a/walker.c
+++ b/walker.c
@@ -251,39 +251,36 @@ void
No external users call write_ref_sha1 any more so lets declare it static.
Signed-off-by: Ronnie Sahlberg
---
refs.c | 10 --
refs.h | 3 ---
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/refs.c b/refs.c
index 47575e8..cb56e38 100644
--- a/refs.c
+++ b/refs.c
@@ -2639,6
No external callers reference lock_ref_sha1 any more so lets declare it static.
Reviewed-by: Jonathan Nieder
Signed-off-by: Ronnie Sahlberg
---
refs.c | 2 +-
refs.h | 6 --
2 files changed, 1 insertion(+), 7 deletions(-)
diff --git a/refs.c b/refs.c
index 50e5475..bb12e65 100644
--- a
will delete m from the packed ref
3, the transaction will create conflicting m/m
For this case we want to be able to lock and create m/m since we know that the
conflict is only transient. I.e. the conflict will be automatically resolved
by the transaction when it deletes m.
Signed-off-by: Ronnie
names.
If we need such recovery code we could add it as an option to git fsck and have
git fsck be the only sanctioned way of bypassing the normal API and checks.
Signed-off-by: Ronnie Sahlberg
---
refs.c | 7 +--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/refs.c b/refs.c
Update repack_without_refs to take an err argument and update it if there
is a failure. Pass the err variable from ref_transaction_commit to this
function so that callers can print a meaningful error message if _commit
fails due to this function.
Signed-off-by: Ronnie Sahlberg
---
refs.c | 19
Since all callers now use QUIET_ON_ERR we no longer need to provide an onerr
argument any more. Remove the onerr argument from the ref_transaction_commit
signature.
Reviewed-by: Jonathan Nieder
Signed-off-by: Ronnie Sahlberg
---
builtin/update-ref.c | 3 +--
refs.c | 22
Track the status of a transaction in a new status field. Check the field for
sanity, i.e. that status must be OPEN when _commit/_create/_delete or
_update is called or else die(BUG:...)
Signed-off-by: Ronnie Sahlberg
---
refs.c | 40 +++-
1 file changed, 39
a
directory we wanted to create. Should "git fetch" also look for
ENOTEMPTY or EEXIST to catch cases where a directory was in the way
of a file to be created?
Signed-off-by: Ronnie Sahlberg
---
refs.c | 4
refs.h | 6 +-
2 files changed, 9 insertions(+), 1 deletion(-)
dif
the old_sha1 pointer is NULL.
Reviewed-by: Jonathan Nieder
Signed-off-by: Ronnie Sahlberg
---
builtin/update-ref.c | 12 +++-
refs.c | 18 --
refs.h | 14 +-
3 files changed, 28 insertions(+), 16 deletions(-)
diff --git a/builtin
hypothetical MySQL backend could fail in _being with
"Can not connect to MySQL server. No route to host".
Reviewed-by: Jonathan Nieder
Signed-off-by: Ronnie Sahlberg
---
builtin/update-ref.c | 2 +-
refs.c | 2 +-
refs.h | 2 +-
3 files changed, 3 insertions(+), 3
Signed-off-by: Ronnie Sahlberg
---
refs.c | 7 +--
refs.h | 16 +++-
2 files changed, 8 insertions(+), 15 deletions(-)
diff --git a/refs.c b/refs.c
index 6898263..48573e3 100644
--- a/refs.c
+++ b/refs.c
@@ -3308,7 +3308,7 @@ struct ref_transaction *ref_transaction_begin(void
Making errno when returning from remove_empty_directories() more
obviously meaningful, which should provide some peace of mind for
people auditing lock_ref_sha1_basic.
Signed-off-by: Ronnie Sahlberg
---
refs.c | 5 -
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/refs.c b
Introducing a new unable_to_lock_message helper, which has nicer
semantics than unable_to_lock_error and cleans up lockfile.c a little.
Signed-off-by: Ronnie Sahlberg
---
cache.h| 2 ++
lockfile.c | 22 --
2 files changed, 14 insertions(+), 10 deletions(-)
diff --git a
Reviewed-by: Jonathan Nieder
Signed-off-by: Ronnie Sahlberg
---
builtin/update-ref.c | 1 +
refs.c | 1 -
refs.h | 5 ++---
3 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/builtin/update-ref.c b/builtin/update-ref.c
index 405267f..1fd7a89 100644
--- a
finally remove the
onerr argument completely.
Reviewed-by: Jonathan Nieder
Signed-off-by: Ronnie Sahlberg
---
builtin/update-ref.c | 2 +-
refs.c | 6 +-
refs.h | 5 -
3 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/builtin/update-ref.c b
k to detect D/F conflicts
Signed-off-by: Ronnie Sahlberg
---
refs.c | 29 -
1 file changed, 24 insertions(+), 5 deletions(-)
diff --git a/refs.c b/refs.c
index a4c728c..31ae63e 100644
--- a/refs.c
+++ b/refs.c
@@ -1951,6 +1951,7 @@ static int remove_empty_dir
Change the update_ref helper function to use a ref transaction internally.
Reviewed-by: Jonathan Nieder
Signed-off-by: Ronnie Sahlberg
---
refs.c | 25 +
1 file changed, 21 insertions(+), 4 deletions(-)
diff --git a/refs.c b/refs.c
index b75523f..50e5475 100644
--- a
pack-refs"
and prepares for repack_without_refs() to get a meaningful
error message when commit_packed_refs() fails without falling into
the same bug.
Signed-off-by: Ronnie Sahlberg
---
refs.c | 10 +-
refs.h | 1 +
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/r
advice based on errno, despite errno
potentially being zero and potentially having been clobbered by
that point
Signed-off-by: Ronnie Sahlberg
---
lockfile.c | 17 -
refs.c | 1 +
refs.h | 1 +
3 files changed, 14 insertions(+), 5 deletions(-)
diff --git a
Change to use ref transactions for all updates to refs.
Reviewed-by: Jonathan Nieder
Signed-off-by: Ronnie Sahlberg
---
sequencer.c | 24
1 file changed, 16 insertions(+), 8 deletions(-)
diff --git a/sequencer.c b/sequencer.c
index 0a80c58..fd8acaf 100644
--- a
up
overwriting a branch even if the forcing flag is false.
Reviewed-by: Jonathan Nieder
Signed-off-by: Ronnie Sahlberg
---
branch.c | 30 --
1 file changed, 16 insertions(+), 14 deletions(-)
diff --git a/branch.c b/branch.c
index 660097b..c1eae00 100644
--- a/branch.c
updated on failure.
Reviewed-by: Jonathan Nieder
Signed-off-by: Ronnie Sahlberg
---
builtin/update-ref.c | 5 +++--
refs.c | 16 +++-
refs.h | 12
3 files changed, 22 insertions(+), 11 deletions(-)
diff --git a/builtin/update-ref.c b/builtin
Change update_ref_write to also update an error strbuf on failure.
This makes the error available to ref_transaction_commit callers if the
transaction failed due to update_ref_sha1/write_ref_sha1 failures.
Reviewed-by: Jonathan Nieder
Signed-off-by: Ronnie Sahlberg
---
refs.c | 9 ++---
1
Call ref_transaction_commit with QUIET_ON_ERR and use the strbuf that is
returned to print a log message if/after the transaction fails.
Reviewed-by: Jonathan Nieder
Signed-off-by: Ronnie Sahlberg
---
builtin/update-ref.c | 10 +-
1 file changed, 5 insertions(+), 5 deletions(-)
diff
Make ref_update_reject_duplicates return any error that occurs through a
new strbuf argument. This means that when a transaction commit fails in
this function we will now be able to pass a helpful error message back to the
caller.
Reviewed-by: Jonathan Nieder
Signed-off-by: Ronnie Sahlberg
updated on failure.
Reviewed-by: Jonathan Nieder
Signed-off-by: Ronnie Sahlberg
---
builtin/update-ref.c | 4 +++-
refs.c | 18 +++--
refs.h | 55 +---
3 files changed, 63 insertions(+), 14 deletions(-)
diff
Making errno when returning from resolve_ref_unsafe() meaningful,
which should fix
* a bug in lock_ref_sha1_basic, where it assumes EISDIR
means it failed due to a directory being in the way
Signed-off-by: Ronnie Sahlberg
---
cache.h | 2 +-
refs.c | 19 +++
2 files
unlink_or_err that we can call from delete_ref_loose. This
function is similar to unlink_or_warn except that we can pass it an err
argument. If err is non-NULL the function will populate err instead of
printing a warning().
Simplify warn_if_unremovable.
Signed-off-by: Ronnie Sahlberg
---
refs.c
Making errno when returning from log_ref_setup() meaningful,
Signed-off-by: Ronnie Sahlberg
---
refs.c | 29 -
refs.h | 4 +++-
2 files changed, 23 insertions(+), 10 deletions(-)
diff --git a/refs.c b/refs.c
index b4b05bd..6f85bd8 100644
--- a/refs.c
+++ b/refs.c
Wrap all the ref updates inside a transaction.
Signed-off-by: Ronnie Sahlberg
---
builtin/receive-pack.c | 96 +-
1 file changed, 63 insertions(+), 33 deletions(-)
diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c
index c323081
series.
If I missed anything I appologize.
...
*** BLURB HERE ***
Ronnie Sahlberg (48):
refs.c: remove ref_transaction_rollback
refs.c: ref_transaction_commit should not free the transaction
refs.c: constify the sha arguments for
ref_transaction_create|delete|update
refs.c: allow
Reviewed-by: Jonathan Nieder
Signed-off-by: Ronnie Sahlberg
---
fast-import.c | 29 +++--
1 file changed, 23 insertions(+), 6 deletions(-)
diff --git a/fast-import.c b/fast-import.c
index 0752f0a..42a607d 100644
--- a/fast-import.c
+++ b/fast-import.c
@@ -1730,15
ref_transaction_update() in which case this change is required.
Reviewed-by: Jonathan Nieder
Signed-off-by: Ronnie Sahlberg
---
refs.c | 7 ---
refs.h | 7 ---
2 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/refs.c b/refs.c
index 33541f4..a767ef6 100644
--- a/refs.c
+++ b
Change tag.c to use ref transactions for all ref updates.
Reviewed-by: Jonathan Nieder
Signed-off-by: Ronnie Sahlberg
---
builtin/tag.c | 15 +--
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/builtin/tag.c b/builtin/tag.c
index c6e8a71..c9bfc9a 100644
--- a/builtin
Let me redo it so it applies to current master.
On Mon, Jun 16, 2014 at 5:22 PM, Junio C Hamano wrote:
> The series applies cleanly up to 25/48 or so to 'master', but this
> step already breaks tests, at least t1400 but possibly others.
>
> Please do not make me bisect X-<.
>
> Thanks.
--
To unsu
Signed-off-by: Ronnie Sahlberg
---
refs.c | 7 +--
refs.h | 16 +++-
2 files changed, 8 insertions(+), 15 deletions(-)
diff --git a/refs.c b/refs.c
index dc45774..6d841a0 100644
--- a/refs.c
+++ b/refs.c
@@ -3334,7 +3334,7 @@ struct ref_transaction *ref_transaction_begin(void
rolled back already.
Reviewed-by: Jonathan Nieder
Signed-off-by: Ronnie Sahlberg
---
refs.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/refs.c b/refs.c
index 21ed465..1d6dece 100644
--- a/refs.c
+++ b/refs.c
@@ -3338,6 +3338,9 @@ void ref_transaction_free(struct ref_transaction
*transac
names.
If we need such recovery code we could add it as an option to git fsck and have
git fsck be the only sanctioned way of bypassing the normal API and checks.
Signed-off-by: Ronnie Sahlberg
---
refs.c | 7 +--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/refs.c b/refs.c
Reviewed-by: Jonathan Nieder
Signed-off-by: Ronnie Sahlberg
---
builtin/update-ref.c | 1 +
refs.c | 1 -
refs.h | 5 ++---
3 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/builtin/update-ref.c b/builtin/update-ref.c
index 405267f..1fd7a89 100644
--- a
advice based on errno, despite errno
potentially being zero and potentially having been clobbered by
that point
Signed-off-by: Ronnie Sahlberg
---
lockfile.c | 17 -
refs.c | 1 +
refs.h | 1 +
3 files changed, 14 insertions(+), 5 deletions(-)
diff --git a
a
directory we wanted to create. Should "git fetch" also look for
ENOTEMPTY or EEXIST to catch cases where a directory was in the way
of a file to be created?
Signed-off-by: Ronnie Sahlberg
---
refs.c | 4
refs.h | 6 +-
2 files changed, 9 insertions(+), 1 deletion(-)
dif
will delete m from the packed ref
3, the transaction will create conflicting m/m
For this case we want to be able to lock and create m/m since we know that the
conflict is only transient. I.e. the conflict will be automatically resolved
by the transaction when it deletes m.
Signed-off-by: Ronnie
directly.
Signed-off-by: Ronnie Sahlberg
---
refs.c | 22 +++---
refs.h | 6 ++
2 files changed, 21 insertions(+), 7 deletions(-)
diff --git a/refs.c b/refs.c
index 0e29fb4..362ff1b 100644
--- a/refs.c
+++ b/refs.c
@@ -3580,7 +3580,7 @@ static int ref_update_reject_duplicates
No external users call write_ref_sha1 any more so lets declare it static.
Signed-off-by: Ronnie Sahlberg
---
refs.c | 10 --
refs.h | 3 ---
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/refs.c b/refs.c
index 362ff1b..dfbf003 100644
--- a/refs.c
+++ b/refs.c
@@ -2666,6
Reviewed-by: Jonathan Nieder
Signed-off-by: Ronnie Sahlberg
---
fast-import.c | 29 +++--
1 file changed, 23 insertions(+), 6 deletions(-)
diff --git a/fast-import.c b/fast-import.c
index cd929dc..191fc47 100644
--- a/fast-import.c
+++ b/fast-import.c
@@ -1734,15
We call read_ref_full with a pointer to flags from rename_ref but since
we never actually use the returned flags we can just pass NULL here instead.
Reviewed-by: Jonathan Nieder
Signed-off-by: Ronnie Sahlberg
---
refs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/refs.c
Change tag.c to use ref transactions for all ref updates.
Reviewed-by: Jonathan Nieder
Signed-off-by: Ronnie Sahlberg
---
builtin/tag.c | 15 +--
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/builtin/tag.c b/builtin/tag.c
index c6e8a71..c9bfc9a 100644
--- a/builtin
hypothetical MySQL backend could fail in _being with
"Can not connect to MySQL server. No route to host".
Reviewed-by: Jonathan Nieder
Signed-off-by: Ronnie Sahlberg
---
builtin/update-ref.c | 2 +-
refs.c | 2 +-
refs.h | 2 +-
3 files changed, 3 insertions(+), 3
Skip using the lock_any_ref_for_update wrapper and call lock_ref_sha1_basic
directly from the commit function.
Reviewed-by: Jonathan Nieder
Signed-off-by: Ronnie Sahlberg
---
refs.c | 12 ++--
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/refs.c b/refs.c
index 31d41fb
Change the reference transactions so that we pass the reflog message
through to the create/delete/update function instead of the commit message.
This allows for individual messages for each change in a multi ref
transaction.
Reviewed-by: Jonathan Nieder
Signed-off-by: Ronnie Sahlberg
Change update_branch() to use ref transactions for updates.
Reviewed-by: Jonathan Nieder
Signed-off-by: Ronnie Sahlberg
---
fast-import.c | 26 +++---
1 file changed, 15 insertions(+), 11 deletions(-)
diff --git a/fast-import.c b/fast-import.c
index 6707a66..cd929dc 100644
.
Reviewed-by: Jonathan Nieder
Signed-off-by: Ronnie Sahlberg
---
refs.c | 34 +-
1 file changed, 13 insertions(+), 21 deletions(-)
diff --git a/refs.c b/refs.c
index e753711..aa5a74d 100644
--- a/refs.c
+++ b/refs.c
@@ -2545,11 +2545,6 @@ int repack_without_refs(const
to start returning more detailed error conditions than the current
simple success/failure. For example if the commit failed due to name
conflicts etc.
Reviewed-by: Jonathan Nieder
Signed-off-by: Ronnie Sahlberg
---
refs.c | 35 +--
1 file changed, 9 insertions
Track the status of a transaction in a new status field. Check the field for
sanity, i.e. that status must be OPEN when _commit/_create/_delete or
_update is called or else die(BUG:...)
Signed-off-by: Ronnie Sahlberg
---
refs.c | 40 +++-
1 file changed, 39
updated on failure.
Reviewed-by: Jonathan Nieder
Signed-off-by: Ronnie Sahlberg
---
builtin/update-ref.c | 5 +++--
refs.c | 16 +++-
refs.h | 12
3 files changed, 22 insertions(+), 11 deletions(-)
diff --git a/builtin/update-ref.c b/builtin
Signed-off-by: Ronnie Sahlberg
---
walker.c | 59 +++
1 file changed, 35 insertions(+), 24 deletions(-)
diff --git a/walker.c b/walker.c
index 1dd86b8..60d9f9e 100644
--- a/walker.c
+++ b/walker.c
@@ -251,39 +251,36 @@ void
Nieder
Signed-off-by: Ronnie Sahlberg
---
refs.c | 29 +
refs.h | 14 --
2 files changed, 33 insertions(+), 10 deletions(-)
diff --git a/refs.c b/refs.c
index e8118de..e753711 100644
--- a/refs.c
+++ b/refs.c
@@ -25,6 +25,11 @@ static unsigned char
Change s_update_ref to use a ref transaction for the ref update.
Signed-off-by: Ronnie Sahlberg
---
builtin/fetch.c | 33 +++--
1 file changed, 23 insertions(+), 10 deletions(-)
diff --git a/builtin/fetch.c b/builtin/fetch.c
index faa1233..52f1ebc 100644
--- a
Update replace.c to use ref transactions for updates.
Reviewed-by: Jonathan Nieder
Signed-off-by: Ronnie Sahlberg
---
builtin/replace.c | 17 ++---
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/builtin/replace.c b/builtin/replace.c
index 1bb491d..054f5ef 100644
Thanks.
I have rebased it on current master and re-sent it as v18
I passes all tests, except t0008 which is unrelated to this series.
regards
ronnie sahlberg
On Tue, Jun 17, 2014 at 7:34 AM, Ronnie Sahlberg wrote:
> Let me redo it so it applies to current master.
>
> On Mon, Jun 16
Change commit.c to use ref transactions for all ref updates.
Make sure we pass a NULL pointer to ref_transaction_update if have_old
is false.
Reviewed-by: Jonathan Nieder
Signed-off-by: Ronnie Sahlberg
---
builtin/commit.c | 24 +++-
1 file changed, 11 insertions(+), 13
Wrap all the ref updates inside a transaction.
Signed-off-by: Ronnie Sahlberg
---
builtin/receive-pack.c | 96 +-
1 file changed, 63 insertions(+), 33 deletions(-)
diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c
index c323081
k to detect D/F conflicts
Signed-off-by: Ronnie Sahlberg
---
refs.c | 29 -
1 file changed, 24 insertions(+), 5 deletions(-)
diff --git a/refs.c b/refs.c
index 211429d..1f2eb24 100644
--- a/refs.c
+++ b/refs.c
@@ -1979,6 +1979,7 @@ static int remove_empty_dir
pack-refs"
and prepares for repack_without_refs() to get a meaningful
error message when commit_packed_refs() fails without falling into
the same bug.
Signed-off-by: Ronnie Sahlberg
---
refs.c | 10 +-
refs.h | 1 +
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/r
Change to use ref transactions for all updates to refs.
Reviewed-by: Jonathan Nieder
Signed-off-by: Ronnie Sahlberg
---
sequencer.c | 24
1 file changed, 16 insertions(+), 8 deletions(-)
diff --git a/sequencer.c b/sequencer.c
index 0a80c58..fd8acaf 100644
--- a
the old_sha1 pointer is NULL.
Reviewed-by: Jonathan Nieder
Signed-off-by: Ronnie Sahlberg
---
builtin/update-ref.c | 12 +++-
refs.c | 18 --
refs.h | 14 +-
3 files changed, 28 insertions(+), 16 deletions(-)
diff --git a/builtin
Making errno when returning from resolve_ref_unsafe() meaningful,
which should fix
* a bug in lock_ref_sha1_basic, where it assumes EISDIR
means it failed due to a directory being in the way
Signed-off-by: Ronnie Sahlberg
---
cache.h | 2 +-
refs.c | 19 +++
2 files
Make ref_update_reject_duplicates return any error that occurs through a
new strbuf argument. This means that when a transaction commit fails in
this function we will now be able to pass a helpful error message back to the
caller.
Reviewed-by: Jonathan Nieder
Signed-off-by: Ronnie Sahlberg
Making errno when returning from log_ref_setup() meaningful,
Signed-off-by: Ronnie Sahlberg
---
refs.c | 27 +++
refs.h | 4 +++-
2 files changed, 22 insertions(+), 9 deletions(-)
diff --git a/refs.c b/refs.c
index 67a0217..9ea519c 100644
--- a/refs.c
+++ b/refs.c
Update repack_without_refs to take an err argument and update it if there
is a failure. Pass the err variable from ref_transaction_commit to this
function so that callers can print a meaningful error message if _commit
fails due to this function.
Signed-off-by: Ronnie Sahlberg
---
builtin
finally remove the
onerr argument completely.
Reviewed-by: Jonathan Nieder
Signed-off-by: Ronnie Sahlberg
---
builtin/update-ref.c | 2 +-
refs.c | 6 +-
refs.h | 5 -
3 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/builtin/update-ref.c b
unlink_or_err that we can call from delete_ref_loose. This
function is similar to unlink_or_warn except that we can pass it an err
argument. If err is non-NULL the function will populate err instead of
printing a warning().
Simplify warn_if_unremovable.
Signed-off-by: Ronnie Sahlberg
---
refs.c
Introducing a new unable_to_lock_message helper, which has nicer
semantics than unable_to_lock_error and cleans up lockfile.c a little.
Signed-off-by: Ronnie Sahlberg
---
cache.h| 2 ++
lockfile.c | 22 --
2 files changed, 14 insertions(+), 10 deletions(-)
diff --git a
Since all callers now use QUIET_ON_ERR we no longer need to provide an onerr
argument any more. Remove the onerr argument from the ref_transaction_commit
signature.
Reviewed-by: Jonathan Nieder
Signed-off-by: Ronnie Sahlberg
---
builtin/update-ref.c | 3 +--
refs.c | 22
801 - 900 of 1015 matches
Mail list logo