Stepan Kasal wrote:
> From: Sverre Rabbelier
> Date: Sat, 28 Aug 2010 20:49:01 -0500
>
> [PT: ensure we add an additional element to the argv array]
>
> Signed-off-by: Stepan Kasal
> ---
>
> Hi,
> this patch was present in msysgit from Mar 2012.
> Do you like it?
Adding an extra '--' would
Felipe Contreras writes:
> David Kastrup wrote:
>> Shouting "your God is an imaginary shithead" every time you see Mark
>
> There's no point in discussing with an unconstructive person as you.
So go to a constructive person you call your friend and show him one of
your calm rational mails and as
From: Johannes Schindelin
Date: Mon, 9 Apr 2012 13:04:35 -0500
After importing anything with fast-import, we should always let the
garbage collector do its job, since the objects are written to disk
inefficiently.
This brings down an initial import of http://selenic.com/hg from about
230 megabyt
From: Sverre Rabbelier
Date: Sat, 28 Aug 2010 20:49:01 -0500
[PT: ensure we add an additional element to the argv array]
Signed-off-by: Stepan Kasal
---
Hi,
this patch was present in msysgit from Mar 2012.
Do you like it?
I'm sorry, there is no author signoff; is the patch small enough?
Ste
On Thu, May 15, 2014 at 12:25:45AM +0200, Jakub Narębski wrote:
> On Wed, May 14, 2014 at 11:57 PM, Junio C Hamano wrote:
> > Michael Wagner writes:
> >
> >> Perl has an internal encoding used to store text strings. Currently,
> >> trying to
> >> view files with UTF-8 encoded names results in an
--
Kedves felhasználók e-mailben;
Túllépte 23432 box set
Web Service / Admin, és akkor nem lesz probléma a küldő és
fogadhat e-maileket, amíg újra ellenőrizni. Kérjük, frissítse kattintva
linkre, és töltse ki az adatokat, hogy ellenőrizze a számla
Kérjük, kövesse az alábbi linkre, és majd másol
Ronnie Sahlberg wrote:
[...]
> +++ b/builtin/commit.c
> @@ -1541,11 +1541,12 @@ int cmd_commit(int argc, const char **argv, const
> char *prefix)
[...]
> @@ -1667,16 +1668,6 @@ int cmd_commit(int argc, const char **argv, const char
> *prefix)
> strbuf_release(&author_ident);
> free_c
Ronnie Sahlberg wrote:
[...]
> +++ b/builtin/replace.c
[...]
> @@ -157,11 +158,12 @@ static int replace_object(const char *object_ref, const
> char *replace_ref,
> else if (!force)
> die("replace ref '%s' already exists", ref);
>
> - lock = lock_any_ref_for_update(ref, p
Ronnie Sahlberg wrote:
> --- a/builtin/tag.c
> +++ b/builtin/tag.c
> @@ -701,11 +702,12 @@ int cmd_tag(int argc, const char **argv, const char
> *prefix)
> if (annotate)
> create_tag(object, tag, &buf, &opt, prev, object);
>
> - lock = lock_any_ref_for_update(ref.buf, pr
Ronnie Sahlberg wrote:
> Change ref_transaction_delete() to do basic error checking and return
> status. Update all callers to check the return for ref_transaction_delete()
> There are currently no conditions in _delete that will return error but there
> will be in the future.
>
> Signed-off-by: R
Ronnie Sahlberg wrote:
> Do basic error checking in ref_transaction_create() and make it return
> status. Update all callers to check the result of ref_transaction_create()
> There are currently no conditions in _create that will return error but there
> will be in the future.
Same concerns as wi
Martin Langhoff wrote:
> On Wed, May 14, 2014 at 7:28 PM, Felipe Contreras
> wrote:
> > Do we no longer have to be afraid of that? WHY? All the responses from
> > the contrib cleanup patches seem to suggest that pretty much *everyone*
>
> The responses also been clear in that you are toxic.
You
On Wed, May 14, 2014 at 7:28 PM, Felipe Contreras
wrote:
> Do we no longer have to be afraid of that? WHY? All the responses from
> the contrib cleanup patches seem to suggest that pretty much *everyone*
The responses also been clear in that you are toxic. You've hijacked
this mailing list on a p
Ronnie Sahlberg wrote:
> Update ref_transaction_update() do some basic error checking and return
> true on error. Update all callers to check ref_transaction_update() for error.
> There are currently no conditions in _update that will return error but there
> will be in the future.
>
> Signed-off-
Junio C Hamano wrote:
> Felipe Contreras writes:
> > Junio never explained his *TECHNICAL* reason, and Michael Haggerty
> > simply said "there are good technical arguments for and against
> > moving git-remote-hg out of contrib", that was all his explanation for
> > the *TECHNICAL* reason.
> I am
Ronnie Sahlberg wrote:
> 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.
Nice, and obviously correct.
Reviewed-by: Jonathan Nieder
--
To unsubscribe from this list: send the
Ronnie Sahlberg wrote:
> 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
--
To unsubscribe from this list
Junio C Hamano wrote:
> To me, it looks like all that is necessary is to accept your patch
> but with a three-byte tightening to detect such a pathological case
> and signal an error, which is what " &&", which I added to your new
> line that sets revp=$(peel_committish ...), is about.
>
> This pa
David Kastrup wrote:
> Shouting "your God is an imaginary shithead" every time you see Mark
There's no point in discussing with an unconstructive person as you.
I've made my point, you are just talking nonsense.
Every rational person on this list knows that if I wanted to, I could be
much more of
David Kastrup writes:
>>> I'm not entirely convinced of that: there is something akin to drop-dead
>>> gorgeous code: code that is so well done that it would not matter with
>>> regard to its maintenance whether or not its author dropped dead because
>>> it's both done well as well as documented
Junio C Hamano writes:
> David Kastrup writes:
>
>> Philippe Vaucher writes:
>>
>>> Thanks for the explanation. I think it underlines well the A)
>>> technical issues (quality commits) and the B) social issues (ability
>>> to communicate in a friendly way & respond constructively), which we
>>>
On Wed, May 14, 2014 at 11:57 PM, Junio C Hamano wrote:
> Michael Wagner writes:
>
>> Perl has an internal encoding used to store text strings. Currently, trying
>> to
>> view files with UTF-8 encoded names results in an error (either "404 - Cannot
>> find file" [blob_plain] or "XML Parsing Erro
David Kastrup writes:
> Philippe Vaucher writes:
>
>> Thanks for the explanation. I think it underlines well the A)
>> technical issues (quality commits) and the B) social issues (ability
>> to communicate in a friendly way & respond constructively), which we
>> discovered are both *essential* f
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 | 11 +--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/refs.c b/refs.c
index 6785fa6..018062d 10
Use a transaction when doing the updates of the reflog during expire_reflog.
Signed-off-by: Ronnie Sahlberg
---
builtin/reflog.c | 54 ++
refs.c | 4 ++--
2 files changed, 24 insertions(+), 34 deletions(-)
diff --git a/builtin/reflo
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 | 10 +++---
builtin/commit.c | 14
builtin/fetch.c| 10 +++--
We want to allow to delete a ref even if it only exists as a packed ref
so we must tweak the REF_ISPACKONLY test in _update so it only applies
to the non-delete case.
Signed-off-by: Ronnie Sahlberg
---
refs.c | 17 ++---
refs.h | 2 +-
2 files changed, 7 insertions(+), 12 deletions(
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
Conflicts:
refs.h
---
refs.c | 107 +
This patch series is available also from
https://github.com/rsahlberg/git/tree/ref-transactions-next
and is based on
https://github.com/rsahlberg/git/tree/ref-transactions
This is a preview of the direction for the transaction work and finished
converting also reflog handling to transactions. This
Add a flag that allows us to truncate the reflog before we write the update.
Signed-off-by: Ronnie Sahlberg
---
refs.c | 12 ++--
refs.h | 4 +++-
2 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/refs.c b/refs.c
index d8a1568..a8b583a 100644
--- a/refs.c
+++ b/refs.c
@@ -
Signed-off-by: Ronnie Sahlberg
---
refs.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/refs.c b/refs.c
index 5a5f9df..58bbf1b 100644
--- a/refs.c
+++ b/refs.c
@@ -2707,6 +2707,7 @@ static int copy_msg(char *buf, const char *msg)
while (buf < cp && isspace(cp[-1]))
c
We no longer need to export unlock_ref. Make the function static.
Signed-off-by: Ronnie Sahlberg
---
refs.c | 20 ++--
refs.h | 3 ---
2 files changed, 10 insertions(+), 13 deletions(-)
diff --git a/refs.c b/refs.c
index 17feec5..6933036 100644
--- a/refs.c
+++ b/refs.c
@@ -193
When deleting refs during a transaction, update the list of the refs to be
deleted already during _update instead of waiting until the _commit stage.
Signed-off-by: Ronnie Sahlberg
---
refs.c | 16 +++-
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/refs.c b/refs.c
ind
We no longer need to export close_ref. Make the function static.
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 6933036..a430b22 100644
--- a/refs.c
+++ b/refs.c
@@ -2668,7 +2668,7 @@ int renam
Check for lock conflicts in _update and flag the transaction as errored
instead of waiting until _commit for doing these checks. If there was a lock
failure we check if this was due to a previous update in the same transaction
or not. This so that we can preserve the current error messages on lock
Add a strbug argument to the update reflog transaction call so we can return
an error string back to the caller on failure.
Signed-off-by: Ronnie Sahlberg
---
builtin/reflog.c | 6 --
refs.c | 3 ++-
refs.h | 3 ++-
3 files changed, 8 insertions(+), 4 deletions(-)
diff -
Track the names of the refs we are deleting in the ref_transaction structure
instead of building an array of names during _commit.
Signed-off-by: Ronnie Sahlberg
---
refs.c | 35 +++
1 file changed, 23 insertions(+), 12 deletions(-)
diff --git a/refs.c b/refs.c
i
Allow multiple updates of a ref in the same transaction as long as
each update has have_old and old_sha1 matches the new_sha1 of the
previous update.
Add a test that verifies that a valid sequence such as
create ref a
update ref b a
update ref c b
works and a test that an invalid sequence su
Allow to make multiple reflog updates to the same ref during a transaction.
This means we only need to lock the reflog once, during the first update that
touches the reflog, and that all further updates can just write the reflog
entry since the reflog is already locked.
This allows us to write cod
We no longer need to export commit_ref. Make the function static.
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 a430b22..0cb4ae8 100644
--- a/refs.c
+++ b/refs.c
@@ -2676,7 +2676,7 @@ static i
The tests for stdin -z fails for update/delete/verify are of the form
update refs/heads/a $m $m $m
and rely on the fact that when parsed we will first parse everything except
the trailing $m. And once that command has completed it will start parsing
the next command, find the trailing $m from befor
Change lock_ref_sha1_basic to return an error instead of dying when
we fail to lock a file during a transaction.
Signed-off-by: Ronnie Sahlberg
---
refs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/refs.c b/refs.c
index 3249576..8212d77 100644
--- a/refs.c
+++ b/refs.c
@
reflog.c has a transaction for updating the reflog. Use this transaction
also for locking the ref itself and updating the ref instead of
locking the file directly and writing to it. This now completely eliminates
the refs and reflog implementation from reflog.c.
Signed-off-by: Ronnie Sahlberg
---
Update the signatures for transaction create/delete/update and add
a strbuf err argument we can use to pass an error back to the caller.
We will need this later once we start moving checks from _commit to _update.
Change all callers that would die() on _commit failures to handle _update
failures si
Signed-off-by: Ronnie Sahlberg
---
refs.c | 13 +++--
refs.h | 7 ---
2 files changed, 7 insertions(+), 13 deletions(-)
diff --git a/refs.c b/refs.c
index aed700b..fe195dd 100644
--- a/refs.c
+++ b/refs.c
@@ -3354,17 +3354,10 @@ int ref_transaction_create(struct ref_transaction
*tr
If there are remaining locks held when we free a transaction, make sure that
we release them instead of relying on the atexit magic to release them for
us. Otherwise, if we perform two transactions on the same ref and the first
transaction is aborted then the second transaction will fail to lock th
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 | 8 +---
refs.h | 1 +
2 files changed, 6 insertio
Move the struct ref_update definition and some enums to earlier in the file.
This does not change any actual code or definitions but just moves them
to a different place in the code since we will soon reference some of these
from the rename_ref function.
Signed-off-by: Ronnie Sahlberg
Conflicts:
Try to lock the ref during the transaction update instead of later during the
commit phase. This allows us to do things such as :
t = transaction_begin()
transaction_update_sha1(t, ref, ...) /* locking ref */
...
do stuff while we know that ref is locked
...
transaction_commit(t)
Signed-off-by:
We have a transaction in rename_ref to managing the ref during the rename.
Use this transaction to manage the changes to the reflog too.
This now means that rename_ref is almost completely agnostic about how refs
storage is implemented and should be easier to migrate if/when we allow a
different st
We no longer need the function lock_any_ref_for_update so lets remove it.
Signed-off-by: Ronnie Sahlberg
---
refs.c | 7 ---
refs.h | 4
2 files changed, 11 deletions(-)
diff --git a/refs.c b/refs.c
index 0cb4ae8..918cda3 100644
--- a/refs.c
+++ b/refs.c
@@ -2167,13 +2167,6 @@ static s
If a previous transaction operation has failed and flagged a transaction
as having an error, then return immediately from commit and indicate failure.
Once we move checks from _commit to _update, _update will already have updated
the error string so the caller will know what failed. Thus we don't n
Break out the code to create the string and writing it to the file descriptor
from log_ref_write and into a dedicated function log_ref_write_fd. For now
this is only used from log_ref_write but later on we will call this function
from reflog transactions too which means that we will end up with onl
We no longer need to expose the ref_lock structure to any external callers.
Make it private to refs.c.
Signed-off-by: Ronnie Sahlberg
---
refs.c | 9 +
refs.h | 9 -
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/refs.c b/refs.c
index 918cda3..8129b20 100644
--- a
In many places in the code we do not have access to the individual fields
in the committer data. Instead we might only have access to prebaked data
such as what is returned by git_committer_info() containing a string
that consists of email, timestamp, zone etc.
This makes it inconvenient to use tr
On Sun, May 11, 2014 at 02:20:57PM -0500, Elliott Cable wrote:
> So, I've spent some time in the #git channel on Freenode chatting
> about this, and we couldn't figure it out. I can't reproduce it in a
> newly-made repository, but it's reproducible with the repository I've
> been working in.
>
>
When git show -s is called for merge commit it prints extra newline
after any merge commit. This differs from output for commits with one
parent. Fix it by more thorough checking that diff output is disabled.
The code in question exists since commit 3969cf7db1. The additional
newline is really nee
Felipe Contreras writes:
> David Kastrup wrote:
>> Felipe Contreras writes:
>>
>> > Philippe Vaucher wrote:
>>
>> [...]
>>
>> >> > Do you feel Felipe is in control of what you label bad behavior? Do you
>> >> > feel you are in control over how you react to his behavior?
>> >>
>> >> I feel t
Hi,
Ronnie Sahlberg wrote:
> --- a/builtin/update-ref.c
> +++ b/builtin/update-ref.c
> @@ -342,6 +342,7 @@ int cmd_update_ref(int argc, const char **argv, const
> char *prefix)
[...]
> @@ -359,17 +360,16 @@ int cmd_update_ref(int argc, const char **argv, const
> char *prefix)
[...]
>
Michael Wagner writes:
> Perl has an internal encoding used to store text strings. Currently, trying to
> view files with UTF-8 encoded names results in an error (either "404 - Cannot
> find file" [blob_plain] or "XML Parsing Error" [blob]). Converting these UTF-8
> encoded file names into Perl's
David Kastrup wrote:
> Felipe Contreras writes:
>
> > Philippe Vaucher wrote:
>
> [...]
>
> >> > Do you feel Felipe is in control of what you label bad behavior? Do you
> >> > feel you are in control over how you react to his behavior?
> >>
> >> I feel that Felipe cannot control this (or deci
Junio C Hamano writes:
> Jens Lehmann writes:
>
>> Junio, I believe this issue needs to be fixed before 2.0 final. Otherwise
>> git gui will not work inside submodules anymore due to the major version
>> number change from 1 to 2. I'd like to hear Pat's opinion on this; even
>> though I think my
James Denholm writes:
> On Tue, May 13, 2014 at 04:12:56PM -0700, Junio C Hamano wrote:
>> James Denholm writes:
>>
>> > I'm not sure that can actually happen - peel_committish is essentially
>> > implemented as `rev-parse $arg^0` (though with a bit of bling, of
>> > course), and to my understa
Jeff King wrote:
> On Wed, May 14, 2014 at 02:35:08PM -0500, Felipe Contreras wrote:
>
> > Prior to his decision there were no complaints about my "manners" since
> > I returned. It was his *TECHNICAL* decision that triggered this.
>
> There have been several complaints about your behavior since
On Tue, May 13, 2014 at 04:12:56PM -0700, Junio C Hamano wrote:
> James Denholm writes:
>
> > I'm not sure that can actually happen - peel_committish is essentially
> > implemented as `rev-parse $arg^0` (though with a bit of bling, of
> > course), and to my understanding FETCH_HEAD will always pa
We have to free the transaction before returning in the early check for
'return early if number of updates == 0' or else the following code would
create a memory leak with the transaction never being freed :
t = ref_transaction_begin()
ref_transaction_commit(t)
Signed-off-by: Ronnie Sahlberg
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
---
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.
Signed-off-by: Ronnie Sahlberg
---
refs.c | 9 ++---
1 file changed, 6 insertions(+),
ref_transaction_create|delete|update has no need to modify the sha1
arguments passed to it so it should use const unsigned char* instead
of unsigned char*.
Some functions, such as fast_forward_to(), already have its old/new
sha1 arguments as consts. This function will at some point need to
use ref
Update replace.c to use ref transactions for updates.
Signed-off-by: Ronnie Sahlberg
---
builtin/replace.c | 14 --
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/builtin/replace.c b/builtin/replace.c
index 3da1bae..11dc2e1 100644
--- a/builtin/replace.c
+++ b/builtin/
Add a strbuf argument to _commit so that we can pass an error string back to
the caller. So that we can do error logging from the caller instead of from
_commit.
Longer term plan is to first convert all callers to use onerr==QUIET_ON_ERR
and craft any log messages from the callers themselves and f
Allow ref_transaction_free to be called with NULL and as a result allow
ref_transaction_rollback to be called for a NULL transaction.
This allows us to write code that will
if ( (!transaction ||
ref_transaction_update(...)) ||
(ref_transaction_commit(...) && !(transaction = NULL))
In s_update_ref there are two calls that when they fail we return an error
based on the errno value. In particular we want to return a specific error
if ENOTDIR happened. Both these functions do have failure modes where they
may return an error without updating errno, in which case a previous and
u
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.
Signed-off-by: Ronnie Sahlberg
---
builtin/update-ref.c | 10 +-
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/builtin/update-ref.c b/b
Do basic error checking in ref_transaction_create() and make it return
non-zero on error. Update all callers to check the result of
ref_transaction_create(). There are currently no conditions in _create that
will return error but there will be in the future.
Signed-off-by: Ronnie Sahlberg
---
bu
This patch series can also be found at
https://github.com/rsahlberg/git/tree/ref-transactions
This patch series is based on next and expands on the transaction API. It
converts all ref updates, inside refs.c as well as external, to use the
transaction API for updates. This makes most of the ref u
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.
Signed-off-by: Ronnie Sahlberg
---
builtin/commit.c | 23 ++-
1 file changed, 10 insertions(+), 13 deletions(-)
diff --git a/builtin/
Update ref_transaction_update() do some basic error checking and return
non-zero on error. Update all callers to check ref_transaction_update() for
error. There are currently no conditions in _update that will return error but
there will be in the future.
Also check for BUGs during update and die(
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.
Signed-off-by: Ronnie Sahlberg
---
builtin/update-ref.c | 3 +--
refs.c | 22 +++---
refs.h
On Wed, May 14, 2014 at 1:14 PM, Matthieu Moy
wrote:
> Elia Pinto writes:
>
>> The following changes since commit 6308767f0bb58116cb405e1f4f77f5dfc1589920:
>> Merge branch 'fc/prompt-zsh-read-from-file' (2014-05-13 11:53:14 -0700)
>> are available in the git repository at:
>> https://github.c
Change tag.c to use ref transactions for all ref updates.
Signed-off-by: Ronnie Sahlberg
---
builtin/tag.c | 14 --
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/builtin/tag.c b/builtin/tag.c
index c6e8a71..bf2a5c3 100644
--- a/builtin/tag.c
+++ b/builtin/tag.c
@@ -54
No external callers reference lock_ref_sha1 any more so lets declare it static.
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 0e88197..b7fa79b 100644
--- a/refs.c
+++ b/refs.c
@@ -2126,7 +2126
Allow passing a list of refs to skip checking to name_conflict_fn.
There are some conditions where we want to allow a temporary conflict and skip
checking those refs. For example if we have a transaction that
1, guarantees that m is a packed refs and there is no loose ref for m
2, the transaction w
Add a new flag REF_ISPACKONLY that we can use in ref_transaction_delete.
This flag indicates that the ref does not exist as a loose ref andf only as
a packed ref. If this is the case we then change the commit code so that
we skip taking out a lock file and we skip calling delete_ref_loose.
Check fo
No external users call write_ref_sha1 any more so lets declare it static.
Signed-off-by: Ronnie Sahlberg
---
refs.c | 4 +++-
refs.h | 3 ---
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/refs.c b/refs.c
index 4673cf4..0e88197 100644
--- a/refs.c
+++ b/refs.c
@@ -251,6 +251,8 @@
Signed-off-by: Ronnie Sahlberg
---
fast-import.c | 17 -
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/fast-import.c b/fast-import.c
index 3e356da..5587cf6 100644
--- a/fast-import.c
+++ b/fast-import.c
@@ -1736,15 +1736,22 @@ static void dump_tags(void)
{
Switch to using ref transactions in walker_fetch(). As part of the refactoring
to use ref transactions we also fix a potential memory leak where in the
original code if write_ref_sha1() would fail we would end up returning from
the function without free()ing the msg string.
This changes the lockin
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.
Signed-off-by: Ronnie Sahlberg
---
refs.c | 30 ++
1 file changed, 6 insertions(+), 24 deletions(-)
Change rename_ref to use a single transaction to perform the ref rename.
Signed-off-by: Ronnie Sahlberg
---
refs.c | 73 ++
1 file changed, 20 insertions(+), 53 deletions(-)
diff --git a/refs.c b/refs.c
index 7569f4e..8e12386 10064
Change s_update_ref to use a ref transaction for the ref update.
Signed-off-by: Ronnie Sahlberg
---
builtin/fetch.c | 17 +
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/builtin/fetch.c b/builtin/fetch.c
index a93c893..b41d7b7 100644
--- a/builtin/fetch.c
+++ b/bu
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 | 37 +
1 file changed, 33 inser
Change to use ref transactions for all updates to refs.
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..9282a12 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -272
Since we only call update_ref_write from a single place and we only call it
with onerr==QUIET_ON_ERR we can just as well get rid of it and just call
write_ref_sha1 directly.
Signed-off-by: Ronnie Sahlberg
---
refs.c | 35 +--
1 file changed, 9 insertions(+), 26 de
Wrap all the ref updates inside a transaction to make the update atomic.
Signed-off-by: Ronnie Sahlberg
---
builtin/receive-pack.c | 20 ++--
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c
index c323081..d580176 100
Change delete_ref to use a ref transaction for the deletion. At the same time
since we no longer have any callers of repack_without_ref we can now delete
this function.
Signed-off-by: Ronnie Sahlberg
---
refs.c | 31 ++-
1 file changed, 10 insertions(+), 21 deletions(
Change store_updated_refs to use a single ref transaction for all refs that
are updated during the fetch. This makes the fetch more atomic when update
failures occur.
Since ref update failures will now no longer occur in the code path for
updating a single ref in s_update_ref, we no longer have as
lock_ref_sha1 was only called from one place in refc.c and only provided
a check that the refname was sane before adding back the initial "refs/"
part of the ref path name, the initial "refs/" that this caller had already
stripped off before calling lock_ref_sha1.
Signed-off-by: Ronnie Sahlberg
-
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.
Signed-off-by: Ronnie Sahlberg
---
branch.c | 6 +++---
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.
Signed-off-by: Ronnie Sahlberg
---
refs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/refs.c b/refs.c
index 9ac9f38..cb1442
Change prune_ref to delete the ref using a ref transaction. To do this we also
need to add a new flag REF_ISPRUNING that will tell the transaction that we
do not want to delete this ref from the packed refs. This flag is private to
refs.c and not exposed to external callers.
Signed-off-by: Ronnie
1 - 100 of 168 matches
Mail list logo