Signed-off-by: Michael Haggerty
---
refs.c | 2 +-
refs/files-backend.c | 3 ++-
refs/refs-internal.h | 24
3 files changed, 15 insertions(+), 14 deletions(-)
diff --git a/refs.c b/refs.c
index bda8fc1..d1ab20b 100644
--- a/refs.c
+++ b/refs.c
@@ -1157,7
-submodule references. And, since the code is now agnostic
about reference backends, it will work for any future references
backend (so move its definition to refs.c).
Signed-off-by: Michael Haggerty
---
refs.c | 24 +++
refs/files-back
Signed-off-by: Michael Haggerty
---
refs.c | 11 ++-
refs.h | 9 +
2 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/refs.c b/refs.c
index 7a8ef6d..c39f85a 100644
--- a/refs.c
+++ b/refs.c
@@ -1299,22 +1299,23 @@ const char *resolve_ref_unsafe(const char *refname
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 16 +---
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 5bfa912..57f1965 100644
--- a/refs/files-backend.c
+++ b/refs/files-backend.c
@@ -1407,11 +1407,9 @@ int
ff-by: Michael Haggerty
---
This patch doesn't fix the known problem [1] that worktree reflogs are
not considered when considering reachability, but I think this whole
patch series will make the problem easier to fix in a relatively
elegant way.
[1] http://thread.gmane.org/gmane.comp.version-c
Signed-off-by: Michael Haggerty
---
refs.c | 7 +++
refs/files-backend.c | 6 --
refs/refs-internal.h | 4
3 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/refs.c b/refs.c
index 79ef443..f4f5f32 100644
--- a/refs.c
+++ b/refs.c
@@ -1418,6 +1418,13
Signed-off-by: Michael Haggerty
---
refs.c | 10 ++
refs/files-backend.c | 14 --
refs/refs-internal.h | 7 +++
3 files changed, 25 insertions(+), 6 deletions(-)
diff --git a/refs.c b/refs.c
index 1798f66..79ef443 100644
--- a/refs.c
+++ b/refs.c
Now that resolve_packed_ref() can work with an arbitrary
files_ref_store, there is no need to have a separate
resolve_gitlink_packed_ref() function.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 26 +-
1 file changed, 5 insertions(+), 21 deletions(-)
diff
Signed-off-by: Michael Haggerty
---
refs.c | 2 +-
refs/files-backend.c | 4 ++--
refs/refs-internal.h | 8
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/refs.c b/refs.c
index 2d84c5c..bda8fc1 100644
--- a/refs.c
+++ b/refs.c
@@ -1157,7 +1157,7 @@ static
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 12 +++-
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 91dcfcb..48b37fa 100644
--- a/refs/files-backend.c
+++ b/refs/files-backend.c
@@ -2388,14 +2388,14 @@ static
: David Turner
Signed-off-by: Junio C Hamano
Signed-off-by: Michael Haggerty
---
I think that we could get away without this method if we make
ref_transactions a bit smarter (for example, by supporting best-effort
updates that can fail without causing the entire transaction to be
aborted). But that
iterating.
Signed-off-by: David Turner
Signed-off-by: Junio C Hamano
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 4
refs/refs-internal.h | 10 +-
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 53d0ba1
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 11 ++-
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index bc7d250..225e0af 100644
--- a/refs/files-backend.c
+++ b/refs/files-backend.c
@@ -3485,20 +3485,21 @@ static
, the backends cannot do anything.
Signed-off-by: Ronnie Sahlberg
Signed-off-by: David Turner
Signed-off-by: Junio C Hamano
Signed-off-by: Jeff King
Signed-off-by: Michael Haggerty
---
refs.c | 19 +++
refs.h | 2 ++
refs/files-backend.c | 5
From: David Turner
Signed-off-by: David Turner
Signed-off-by: Junio C Hamano
Signed-off-by: Michael Haggerty
---
refs/refs-internal.h | 5 +
1 file changed, 5 insertions(+)
diff --git a/refs/refs-internal.h b/refs/refs-internal.h
index efe5847..d8a2606 100644
--- a/refs/refs-internal.h
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 9 +
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 8ef79c2..5bfa912 100644
--- a/refs/files-backend.c
+++ b/refs/files-backend.c
@@ -1196,10 +1196,9 @@ static
e refs
refs: make lock generic
refs: implement iteration over only per-worktree refs
Michael Haggerty (28):
resolve_gitlink_ref(): eliminate temporary variable
refs: rename struct ref_cache to files_ref_store
refs: create a base class "ref_store" for files_ref_store
add_packed_r
Add a new function, resolve_ref_recursively(), which is basically like
the old resolve_ref_unsafe() except that it takes a (ref_store *)
argument and also works for submodules.
Re-implement resolve_ref_unsafe() as a thin wrapper around
resolve_ref_recursively().
Signed-off-by: Michael Haggerty
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 11 +--
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 50bfe97..b54355d 100644
--- a/refs/files-backend.c
+++ b/refs/files-backend.c
@@ -1333,10 +1333,9 @@ static
Reference backends will be able to customize this function to implement
reference reading.
Signed-off-by: Michael Haggerty
---
refs.c | 4 ++--
refs/files-backend.c | 14 --
refs/refs-internal.h | 36 +++-
3 files changed, 29 insertions
And make the function work for submodules.
Signed-off-by: Michael Haggerty
---
refs.c | 4 +++-
refs/files-backend.c | 18 +-
refs/refs-internal.h | 9 ++---
3 files changed, 22 insertions(+), 9 deletions(-)
diff --git a/refs.c b/refs.c
index 904e758
These functions currently only work in the main repository, so add an
assert_main_repository() check to each function.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 32
1 file changed, 16 insertions(+), 16 deletions(-)
diff --git a/refs/files
If we don't have to strip trailing '/' from the submodule path, then
don't allocate and copy the submodule name.
Signed-off-by: Michael Haggerty
---
refs.c | 20 +---
1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/refs.c b/refs.c
index 5e0
From: Ronnie Sahlberg
Signed-off-by: Ronnie Sahlberg
Signed-off-by: David Turner
Signed-off-by: Junio C Hamano
Signed-off-by: Jeff King
Signed-off-by: Michael Haggerty
---
refs.c | 9 +
refs/files-backend.c | 10 ++
refs/refs-internal.h | 5 +
3 files
Move resolve_gitlink_ref() and related functions lower in the file to
avoid the need for forward declarations in the next step.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 166 +--
1 file changed, 83 insertions(+), 83 deletions
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 36bf128..2f9d79a 100644
--- a/refs/files-backend.c
+++ b/refs/files-backend.c
@@ -1387,7 +1387,7 @@ static int
to hold the reference caches. So let's treat ref_caches
as embryo ref_stores, and build them out from there.
As the first step, simply rename `ref_cache` to `files_ref_store`, and
rename some functions and attributes correspondingly.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c
Free up the old name for a more general purpose.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 142c977..1a46f32 100644
--- a/refs/files-backend.c
+++ b/refs
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 9 -
refs/refs-internal.h | 10 +-
2 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 1230dfb..68db3e8 100644
--- a/refs/files-backend.c
+++ b/refs/files
If there is not a nonbare repository where a submodule is supposedly
located, then don't instantiate a ref_cache for it.
The analogous check can be removed from resolve_gitlink_ref().
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 33 ++---
1
tHub repo [2] as branch "ref-iterators".
Michael
[1] http://thread.gmane.org/gmane.comp.version-control.git/295860
[2] https://github.com/mhagger/git
Michael Haggerty (13):
refs: remove unnecessary "extern" keywords
do_for_each_ref(): move docstring to the header file
refs: use
option set to REF_NODEREF.
Signed-off-by: Michael Haggerty
---
builtin/remote.c | 6 +-
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/builtin/remote.c b/builtin/remote.c
index 1bbf9b4..c4b4d67 100644
--- a/builtin/remote.c
+++ b/builtin/remote.c
@@ -539,10 +539,6 @@ static int
trees and possibly other types of
iterators in the future.
Signed-off-by: Michael Haggerty
---
Makefile | 1 +
iterator.h | 81
refs.h | 4 +-
refs/files-backend.c | 281 +
.
Signed-off-by: Michael Haggerty
---
Makefile | 1 +
dir-iterator.c | 185 +
dir-iterator.h | 86 +++
3 files changed, 272 insertions(+)
create mode 100644 dir-iterator.c
create mode 100644 dir-iterator.h
This will be useful for passing REF_NODEREF through.
Signed-off-by: Michael Haggerty
---
builtin/fetch.c | 2 +-
builtin/remote.c | 4 ++--
refs.h | 5 +++--
refs/files-backend.c | 4 ++--
4 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/builtin/fetch.c b
Extract new function ref_resolves_to_object() from
entry_resolves_to_object(). It can be used even if there is no ref_entry
at hand.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 33 +++--
1 file changed, 23 insertions(+), 10 deletions(-)
diff --git a
ation
in a more straightforward manner.
If we rewrite all callers to use the reference iteration API, then we
can remove the current_ref_iter hack permanently.
Signed-off-by: Michael Haggerty
---
refs.c | 20 +
refs/files-backend.c | 206 ++
In the context of the for_each_ref() functions, call the prefix that
references must start with "prefix". (In some places it was called
"base".) This is clearer, and also prevents confusion with another
planned use of the word "base".
Signed-off-by: Michael Hagge
fter this patch).
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 113 ---
refs/refs-internal.h | 7
2 files changed, 78 insertions(+), 42 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index e8dd9d1..36bf1
es for the
purpose of determining object reachability!) and wouldn't benefit from
a truncated iteration anyway.
So instead, emit an error message and skip the "broken" reflog, but
continue with the iteration.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 2 +-
1
There's continuing work in this area, so clean up unneeded "extern"
keywords rather than schlepping them around. Also split up some overlong
lines and add parameter names in a couple of places.
Signed-off-by: Michael Haggerty
--
On 06/01/2016 02:12 AM, David Turner wrote:
> On Mon, 2016-05-30 at 09:55 +0200, Michael Haggerty wrote:
>> +struct dir_iterator_level {
>> +int initialized;
>> +
>> +DIR *dir;
>> +
>> +/*
>> + * The length of the directory part of r
On 06/01/2016 01:12 AM, Eric Sunshine wrote:
> On Tue, May 31, 2016 at 3:59 AM, Michael Haggerty
> wrote:
>> On 05/31/2016 07:29 AM, Eric Sunshine wrote:
>>> On Mon, May 30, 2016 at 3:55 AM, Michael Haggerty
>>> wrote:
>>>> +struct r
On 06/02/2016 12:08 PM, Duy Nguyen wrote:
> On Mon, May 30, 2016 at 2:55 PM, Michael Haggerty
> wrote:
>> Currently, the API for iterating over references is via a family of
>> for_each_ref()-type functions that invoke a callback function for each
>> selected reference.
e it fit better with the rest
of the Git documentation, and because having verbatim copies of the same
text in two places seems a little bit silly. But that's up to you.
Signed-off-by: Michael Haggerty
Michael
--
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-info.html
On 06/02/2016 11:53 AM, Duy Nguyen wrote:
> (from patch 4/4 mail)
>
> On Wed, Jun 1, 2016 at 10:51 PM, Michael Haggerty
> wrote:
>>> + path = xstrdup(worktree_git_path(wt, "logs/refs/bisect"));
>>> + if (file_exists(path))
>>> +
On 06/01/2016 11:07 PM, Jeff King wrote:
> On Wed, Jun 01, 2016 at 03:42:18AM -0400, Jeff King wrote:
>
>> I have no idea if those ideas would work. But I wouldn't want to start
>> looking into either of them without some idea of how much time we're
>> actually spending on strbuf mallocs (or how m
On 06/01/2016 09:39 PM, Junio C Hamano wrote:
> Michael Haggerty writes:
>
>> I argue that the fundamental concept in terms of the implementation
>> should be the individual physical reference stores, and these should be
>> compounded together to form the logical refer
On 06/01/2016 05:15 PM, Junio C Hamano wrote:
> Michael Haggerty writes:
>
>> I think reference stores are going to need two distinct types of
>> reference iteration: one to iterate over the *logical* reference space
>> of a single repo or worktree, and one to find all *
On 06/01/2016 12:45 PM, Nguyễn Thái Ngọc Duy wrote:
> [...]
> +void add_worktree_reflogs_to_pending(struct rev_info *revs, unsigned flags,
> + struct worktree *wt)
> +{
> + struct all_refs_cb cb;
> + char *path;
> +
> + cb.all_revs = revs;
> + cb.all
On 06/01/2016 12:14 AM, Jeff King wrote:
> [...]
> Michael (cc'd) noted to me off-list recently that there may be some
> special cases there regarding reflogs in other worktrees (i.e., that we
> don't always include them for our reachability checks). I don't know the
> details, though.
That's corr
On 05/31/2016 08:10 AM, Junio C Hamano wrote:
> Michael Haggerty writes:
>
>> This commit introduces a new iteration primitive for references: a
>> ref_iterator. A ref_iterator is a polymorphic object that a reference
>> storage backend can be asked to instantiate. T
On 05/31/2016 08:41 AM, Johannes Schindelin wrote:
> Hi Michael,
>
> On Tue, 31 May 2016, Michael Haggerty wrote:
>
>> On 05/30/2016 02:13 PM, Johannes Schindelin wrote:
>>> [...]
>>>> @@ -38,7 +67,11 @@ char *strbuf_detach(struct strbuf *sb
On 05/31/2016 07:29 AM, Eric Sunshine wrote:
> On Mon, May 30, 2016 at 3:55 AM, Michael Haggerty
> wrote:
>> [...]
> [...]
> Either:
>
> s/false/something other than ITER_OK/
>
> or:
>
> s/false/ITER_DONE or ITER_ERROR/
Thanks.
>> +in
On 05/30/2016 08:21 PM, Pranit Bauva wrote:
> Reimplement `bisect_clean_state` shell function in C and add a
> `bisect-clean-state` subcommand to `git bisect--helper` to call it from
> git-bisect.sh .
>
> Using `bisect_clean_state` subcommand is a measure to port shell
> function to C so as to use
On 05/30/2016 02:52 PM, Matthieu Moy wrote:
> [...]
I feel bad bikeshedding about names, especially since you took some of
the original names from my RFC. But names are very important, so I think
it's worth considering whether the current names could be improved upon.
When reading this patch seri
On 05/30/2016 02:13 PM, Johannes Schindelin wrote:
> [...]
>> @@ -38,7 +67,11 @@ char *strbuf_detach(struct strbuf *sb, size_t *sz)
>> {
>> char *res;
>> strbuf_grow(sb, 0);
>> -res = sb->buf;
>> +if (sb->flags & STRBUF_OWNS_MEMORY)
>> +res = sb->buf;
>> +else
>>
Hi,
Cool that you are working on this! See my comments below.
On 05/30/2016 12:36 PM, William Duclot wrote:
> Test the strbuf API. Being used throughout all Git the API could be
> considered tested, but adding specific tests makes it easier to improve
> and extend the API.
> ---
> Makefile
On 05/30/2016 06:57 PM, Ramsay Jones wrote:
>
>
> On 30/05/16 16:22, Ramsay Jones wrote:
>>
>>
>> On 30/05/16 08:55, Michael Haggerty wrote:
>> [snip]
>>
>>> /* Reference is a symbolic reference. */
>>> diff --git a/refs/files-backend.c
option set to REF_NODEREF.
Signed-off-by: Michael Haggerty
---
builtin/remote.c | 6 +-
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/builtin/remote.c b/builtin/remote.c
index 1bbf9b4..c4b4d67 100644
--- a/builtin/remote.c
+++ b/builtin/remote.c
@@ -539,10 +539,6 @@ static int
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 9 -
refs/refs-internal.h | 10 +-
2 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 1230dfb..68db3e8 100644
--- a/refs/files-backend.c
+++ b/refs/files
trees and possibly other types of
iterators in the future.
Signed-off-by: Michael Haggerty
---
Makefile | 1 +
iterator.h | 81
refs.h | 4 +-
refs/files-backend.c | 282 ++
This will be useful for passing REF_NODEREF through.
Signed-off-by: Michael Haggerty
---
builtin/fetch.c | 2 +-
builtin/remote.c | 4 ++--
refs.h | 5 +++--
refs/files-backend.c | 4 ++--
4 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/builtin/fetch.c b
In the context of the for_each_ref() functions, call the prefix that
references must start with "prefix". (In some places it was called
"base".) This is clearer, and also prevents confusion with another
planned use of the word "base".
Signed-off-by: Michael Hagge
There's continuing work in this area, so clean up unneeded "extern"
keywords rather than schlepping them around. Also split up some overlong
lines and add parameter names in a couple of places.
Signed-off-by: Michael Haggerty
--
ation
in a more straightforward manner.
If we rewrite all callers to use the reference iteration API, then we
can remove the current_ref_iter hack permanently.
Signed-off-by: Michael Haggerty
---
refs.c | 20 +
refs/files-backend.c | 206 ++
If there is not a nonbare repository where a submodule is supposedly
located, then don't instantiate a ref_cache for it.
The analogous check can be removed from resolve_gitlink_ref().
Signed-off-by: Michael Haggerty
---
This doesn't actually reduce the number of ref_cache instances
ge
Extract new function ref_resolves_to_object() from
entry_resolves_to_object(). It can be used even if there is no ref_entry
at hand.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 33 +++--
1 file changed, 23 insertions(+), 10 deletions(-)
diff --git a
es for the
purpose of determining object reachability!) and wouldn't benefit from
a truncated iteration anyway.
So instead, emit an error message and skip the "broken" reflog, but
continue with the iteration.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 2 +-
1
f these changes, but I will work on
that next.
Michael
[1] http://thread.gmane.org/gmane.comp.version-control.git/290409
[2]
http://mid.gmane.org/89634d216544d1102dafd5d18247bff2581d48a8.1464537050.git.mhag...@alum.mit.edu
[3] https://github.com/mhagger/git
Michael Haggerty (13):
refs: remove un
.
Signed-off-by: Michael Haggerty
---
Makefile | 1 +
dir-iterator.c | 180 +
dir-iterator.h | 86 +++
3 files changed, 267 insertions(+)
create mode 100644 dir-iterator.c
create mode 100644 dir-iterator.h
fter this patch).
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 113 ---
refs/refs-internal.h | 7
2 files changed, 78 insertions(+), 42 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index a7cc0e2..2e0d0
Free up the old name for a more general purpose.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 142c977..1a46f32 100644
--- a/refs/files-backend.c
+++ b/refs
flogs for symbolic references
if there is a concurrent update by another process, since the old_oid
of a symref is determined before the lock on the pointed-to ref is
held.
Both problems will soon be fixed.
Signed-off-by: David Turner
Signed-off-by: Junio C Hamano
Signed-off-by: Mi
On 05/12/2016 10:25 AM, Jeff King wrote:
> On Thu, May 12, 2016 at 03:45:28AM -0400, Jeff King wrote:
>
>> So I'd expect us to hit that lock_ref_for_update() for each of the new
>> refs. But then we end up in verify_refname_available_dir(), which wants
>> to read all of the loose refs again. So we
On 05/09/2016 11:05 PM, Junio C Hamano wrote:
> David Turner writes:
>> [...]
>> I generally like to put the bug fixes before the tests for those fixes
>> (so that bisect on the complete suite works). But maybe the git policy
>> is different.
>
> The Git policy only asks not to break bisection.
_lock::orig_ref_name
* Remove local variable orig_refname from lock_ref_sha1_basic()
* ref_name can be initialize once and its value reused
* commit_ref_update() never has to write to the reflog for
lock->orig_ref_name
Signed-off-by: Michael Haggerty
---
refs/files-backen
From: David Turner
The refs infrastructure learns about log-only ref updates, which only
update the reflog. Later, we will use this to separate symbolic
reference resolution from ref updating.
Signed-off-by: David Turner
Signed-off-by: Junio C Hamano
Signed-off-by: Michael Haggerty
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 7cc680a..f4f7953 100644
--- a/refs/files-backend.c
+++ b/refs/files-backend.c
@@ -3139,6 +3139,7 @@ int ref_transaction_commit(struct
e the read_ref_full() call into the (update->type & REF_ISSYMREF)
block.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 52
1 file changed, 32 insertions(+), 20 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-bac
ff-by: Michael Haggerty
---
refs/files-backend.c | 20 +---
1 file changed, 9 insertions(+), 11 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 80d346f..93a94af 100644
--- a/refs/files-backend.c
+++ b/refs/files-backend.c
@@ -3076,7 +3076,6 @
It is nonsensical (and a little bit dangerous) to use REF_ISPRUNING
without REF_NODEREF. Forbid it explicitly. Change the one REF_ISPRUNING
caller to pass REF_NODEREF too.
Signed-off-by: Michael Haggerty
---
refs.c | 3 +++
refs/files-backend.c | 2 +-
refs/refs-internal.h | 2
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 9 +++--
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 2d3a8c6..80d346f 100644
--- a/refs/files-backend.c
+++ b/refs/files-backend.c
@@ -2360,20 +2360,17 @@ int
Extract a new function, lock_ref_for_update(), from
ref_transaction_commit().
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 152 ---
1 file changed, 85 insertions(+), 67 deletions(-)
diff --git a/refs/files-backend.c b/refs/files
After all, it doesn't hold the symbolic reference, but rather the
reference referred to.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 21 +++--
refs/refs-internal.h | 2 +-
2 files changed, 12 insertions(+), 11 deletions(-)
diff --git a/refs/files-backen
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 38 --
refs/refs-internal.h | 38 ++
2 files changed, 38 insertions(+), 38 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 73717dd
The return value of resolve_ref_unsafe() is not guaranteed to stay
around as long as we need it, so use resolve_refdup() instead.
Signed-off-by: Michael Haggerty
---
builtin/branch.c | 19 +++
1 file changed, 11 insertions(+), 8 deletions(-)
diff --git a/builtin/branch.c b
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 24
1 file changed, 24 insertions(+)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 1f38076..ad9cd86 100644
--- a/refs/files-backend.c
+++ b/refs/files-backend.c
@@ -2457,6 +2457,30 @@ static int
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 0cc116d..2d3a8c6 100644
--- a/refs/files-backend.c
+++ b/refs/files-backend.c
@@ -2719,7 +2719,7 @@ static int
* Always start error messages with a lower-case letter.
* Always enclose reference names in single quotes.
Signed-off-by: Michael Haggerty
---
refs.c| 8
refs/files-backend.c | 32
t/t1400-update-ref.sh | 4 ++--
3 files changed, 22
resolve_ref_unsafe() can cope with being called with NULL passed to its
flags argument. So lock_ref_sha1_basic() can just hand its own type
parameter through.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 9 +++--
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a
The reference name is going to be compared to other reference names, so
it should be in its normalized form.
Signed-off-by: Michael Haggerty
---
refs.c | 9 +++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/refs.c b/refs.c
index ca0280f..b18d995 100644
--- a/refs.c
+++ b
in the old code, the
old_sha1 of the symref was resolved before the reference that it pointed
at was locked. So it was possible that the old_sha1 value logged to the
symref's reflog could be wrong if another process changed the downstream
reference before it was locked.
Signed-off-by: Michael
Change add_update() to initialize all of the fields in the new
ref_update object. Rename the function to ref_transaction_add_update(),
and increase its visibility to all of the refs-related code.
All of this makes the function more useful for other future callers.
Signed-off-by: Michael Haggerty
commit_ref_update() is now only called with flags=0. So remove the flags
parameter entirely.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 14 +++---
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 08ec293
If the user has asked that a new value be set for a reference, we use
check_refname_format() to verify that the reference name satisfies all
of the rules. But in other cases, at least check that refname_is_safe().
Signed-off-by: Michael Haggerty
---
refs.c | 5 +++--
t/t1400
flogs for symbolic references
if there is a concurrent update by another process, since the old_oid
of a symref is determined before the lock on the pointed-to ref is
held.
Both problems will soon be fixed.
Signed-off-by: David Turner
Signed-off-by: Junio C Hamano
Signed-off-by: Mi
The two string_list arguments can be const.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 4 ++--
refs/refs-internal.h | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index ad53b6e..f0eef9e 100644
--- a/refs/files
Among other things, document the (important!) requirement that input
refname be checked for safety before calling this function.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 41 -
1 file changed, 24 insertions(+), 17 deletions(-)
diff --git
This is more convenient and less error-prone for callers.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index fa8bbd6..8ced104 100644
--- a/refs/files-backend.c
+++ b/refs/files-backend.c
901 - 1000 of 3206 matches
Mail list logo