It only cares about the packed-refs part of the reference store.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 10 +-
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index bc5c0de84e..4943207098 100644
--- a/refs
It only cares about the packed-refs part of the reference store.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 26 --
1 file changed, 12 insertions(+), 14 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index f061506bf0..b2ef7b3bb9
The old code ignored any lines that it didn't understand. This is
dangerous. Instead, `die()` if the `packed-refs` file contains any
lines that we don't know how to handle.
Signed-off-by: Michael Haggerty
---
refs/packed-backend.c | 6 +++---
1 file changed, 3 insertions(+), 3
Instead, change the callers of `commit_packed_refs()` to call
`packed_refs_unlock()`.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 2 ++
refs/packed-backend.c | 18 --
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/refs/files-backend.c b/refs
will eventually make it
possible to fix some longstanding races.
The only semantic change here is that `repack_without_refs()` used to
forgot to release the lock in the `if (!removed)` exit path. That
omission is now fixed.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 47
That way the callers don't have to come up with error messages
themselves.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 6 ++
refs/packed-backend.c | 17 +++--
refs/packed-backend.h | 6 +++---
3 files changed, 16 insertions(+), 13 deletions(-)
diff --
cause problems.
Signed-off-by: Junio C Hamano
Signed-off-by: Michael Haggerty
---
t/t1408-packed-refs.sh | 46 ++
1 file changed, 46 insertions(+)
create mode 100755 t/t1408-packed-refs.sh
diff --git a/t/t1408-packed-refs.sh b/t/t1408-packed-refs.sh
new
It only cares about the packed-refs part of the reference store.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 13 ++---
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 2b0db60b2b..f061506bf0 100644
--- a/refs
Start extracting the packed-refs-related data structures into a new
class, `packed_ref_store`. It doesn't yet implement `ref_store`, but
it will.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 42 +-
1 file changed, 33 insertions(
It only cares about the packed-refs part of the reference store.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 10 +-
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index b2ef7b3bb9..bc5c0de84e 100644
--- a/refs
shortly.
Signed-off-by: Michael Haggerty
---
refs/packed-backend.c | 40
1 file changed, 32 insertions(+), 8 deletions(-)
diff --git a/refs/packed-backend.c b/refs/packed-backend.c
index 18ce47fcb7..71f92ed6f0 100644
--- a/refs/packed-backend.c
+++ b/refs
no (1):
t1408: add a test of stale packed refs covered by loose refs
Michael Haggerty (28):
add_packed_ref(): teach function to overwrite existing refs
packed_ref_store: new struct
packed_ref_store: move `packed_refs_path` here
packed_ref_store: move `packed_refs_lock` member here
clear_p
Move the `packed_refs_lock` member from `files_ref_store` to
`packed_ref_store`, and rename it to `lock` since it's now more
obvious what it is locking.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 31 ---
1 file changed, 16 insertions(+), 15 dele
Move `packed_refs_path` from `files_ref_store` to `packed_ref_store`,
and rename it to `path` since its meaning is clear from its new
context.
Inline `files_packed_refs_path()`.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 25 -
1 file changed, 12
mit moves code around and adjusts its visibility, but doesn't
change anything.
Signed-off-by: Michael Haggerty
---
Makefile | 1 +
refs.c| 18 ++
refs/files-backend.c | 640 +
Report errors via a `struct strbuf *err` rather than by calling
`die()`. To enable this goal, change `write_packed_entry()` to report
errors via a return value and `errno` rather than dying.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 10 +++---
refs/packed-backend.c | 85
It only cares about the packed-refs part of the reference store.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 16
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index de8293493f..2b0db60b2b 100644
--- a
It only cares about the packed-refs part of the reference store.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 18 +-
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 0d8f39089f..5d159620f0 100644
--- a
: Michael Haggerty
---
refs/files-backend.c | 40 ++--
1 file changed, 18 insertions(+), 22 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index b040bb3b0a..87cecde231 100644
--- a/refs/files-backend.c
+++ b/refs/files-backend.c
@@ -413,15
Add the infrastructure to iterate over a `packed_ref_store`. It's a
lot of boilerplate, but it's all part of a campaign to make
`packed_ref_store` implement `ref_store`. In the future, this iterator
will work much differently.
Signed-off-by: Michael Haggerty
---
refs/files-backe
This will later become a method of `packed_ref_store`.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 26 +++---
1 file changed, 15 insertions(+), 11 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index c206791b91..185d05e1d6 100644
--- a
It only cares about the packed-refs part of the reference store.
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 a08d3fbadf..2b9d93d3b6 100644
--- a/refs
It only cares about the packed-refs part of the reference store.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 15 +++
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 5d159620f0..a08d3fbadf 100644
--- a
implemented (e.g., those having to do
with symrefs or reflogs).
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 16 ++--
refs/packed-backend.c | 231 +-
refs/packed-backend.h | 23 ++---
refs/refs-internal.h | 1 +
4 files changed
On 06/19/2017 09:53 PM, Jeff King wrote:
> On Mon, Jun 19, 2017 at 03:43:15PM -0400, Jeff King wrote:
>
Is the iterator over packed-refs correctly skipping over what are
covered by loose refs? The entries in the packed-refs file that are
superseded by loose refs should be allowed t
for_each_ref_in_submodule()`.
* Add a test.
Signed-off-by: Michael Haggerty
Signed-off-by: Jeff King
---
refs.c | 12
refs.h | 5 -
revision.c | 2 +-
t/t6002-rev-list-bisect.sh | 14 ++
4 files changed, 31 insertions
continue to refuse to trim *more*
characters than the refname contains, as that really makes no sense.
Signed-off-by: Michael Haggerty
---
refs/iterator.c | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/refs/iterator.c b/refs/iterator.c
index 4cf449ef66..de52d5fe93 100644
. If it is
included, regressions are less likely, but we won't learn about other
misuses of the API. I have no strong opinion either way.
Michael
[1] http://public-inbox.org/git/cover.1497430232.git.mhag...@alum.mit.edu/
Michael Haggerty (2):
for_each_bisect_ref(): don't tri
On 06/16/2017 07:42 AM, Stefan Beller wrote:
> On Thu, Jun 15, 2017 at 7:47 AM, Michael Haggerty
> wrote:
>> This will later become a method of `packed_ref_store`.
>
> Also while touching it, maybe rename sha1 to object_hash
> (not saying object_id as that would be conf
On 06/16/2017 07:39 AM, Stefan Beller wrote:
> On Thu, Jun 15, 2017 at 7:47 AM, Michael Haggerty
> wrote:
>> [...]
>> @@ -125,7 +125,7 @@ static void clear_packed_ref_cache(struct
>> files_ref_store *refs)
>> if (refs->packed_ref_store-&g
That way the callers don't have to come up with error messages
themselves.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 6 ++
refs/packed-backend.c | 17 +++--
refs/packed-backend.h | 6 +++---
3 files changed, 16 insertions(+), 13 deletions(-)
diff --
The existing callers already check that the lock isn't held just
before calling `clear_packed_ref_cache()`, and in the near future we
want to be able to call this function when the lock is held.
Signed-off-by: Michael Haggerty
---
refs/packed-backend.c | 2 --
1 file changed, 2 dele
Start extracting the packed-refs-related data structures into a new
class, `packed_ref_store`. It doesn't yet implement `ref_store`, but
it will.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 42 +-
1 file changed, 33 insertions(
will eventually make it
possible to fix some longstanding races.
The only semantic change here is that `repack_without_refs()` used to
forgot to release the lock in the `if (!removed)` exit path. That
omission is now fixed.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 47
It only cares about the packed-refs part of the reference store.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 15 +++
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 5d159620f0..a08d3fbadf 100644
--- a
It only cares about the packed-refs part of the reference store.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 16
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index de8293493f..2b0db60b2b 100644
--- a
It only cares about the packed-refs part of the reference store.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 13 ++---
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 2b0db60b2b..f061506bf0 100644
--- a/refs
Instead, change the callers of `commit_packed_refs()` to call
`packed_refs_unlock()`.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 2 ++
refs/packed-backend.c | 18 --
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/refs/files-backend.c b/refs
The old code ignored any lines that it didn't understand. This is
dangerous. Instead, `die()` if the `packed-refs` file contains any
lines that we don't know how to handle.
Signed-off-by: Michael Haggerty
---
refs/packed-backend.c | 6 +++---
1 file changed, 3 insertions(+), 3
It only cares about the packed-refs part of the reference store.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 18 +-
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 0d8f39089f..5d159620f0 100644
--- a
It only cares about the packed-refs part of the reference store.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 20 ++--
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 2b9d93d3b6..c206791b91 100644
It only cares about the packed-refs part of the reference store.
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 a08d3fbadf..2b9d93d3b6 100644
--- a/refs
implemented (e.g., those having to do
with symrefs or reflogs).
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 16 ++--
refs/packed-backend.c | 231 +-
refs/packed-backend.h | 23 ++---
refs/refs-internal.h | 1 +
4 files changed
Add two new public functions, `packed_refs_unlock()` and
`packed_refs_is_locked()`, with which callers can manage and query the
`packed-refs` lock externally.
Call `packed_refs_unlock()` from `commit_packed_refs()` and
`rollback_packed_refs()`.
Signed-off-by: Michael Haggerty
---
refs/packed
Add a new function, `packed_read_raw_ref()`, which is nearly a
`read_raw_ref_fn`. Use it in place of `resolve_packed_ref()`.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 36 +---
1 file changed, 17 insertions(+), 19 deletions(-)
diff --git a/refs
mit moves code around and adjusts its visibility, but doesn't
change anything.
Signed-off-by: Michael Haggerty
---
Makefile | 1 +
refs.c| 18 ++
refs/files-backend.c | 640 +
shortly.
Signed-off-by: Michael Haggerty
---
refs/packed-backend.c | 40
1 file changed, 32 insertions(+), 8 deletions(-)
diff --git a/refs/packed-backend.c b/refs/packed-backend.c
index 5bee49d497..6619052e96 100644
--- a/refs/packed-backend.c
+++ b/refs
Rename `lock_packed_refs()` to `packed_refs_lock()` for consistency
with how other methods are named. Also, it's about to get some
companions.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 4 ++--
refs/packed-backend.c | 10 +-
refs/packed-backend.h | 2 +-
3
Report errors via a `struct strbuf *err` rather than by calling
`die()`. To enable this goal, change `write_packed_entry()` to report
errors via a return value and `errno` rather than dying.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 10 +++---
refs/packed-backend.c | 85
Add the infrastructure to iterate over a `packed_ref_store`. It's a
lot of boilerplate, but it's all part of a campaign to make
`packed_ref_store` implement `ref_store`. In the future, this iterator
will work much differently.
Signed-off-by: Michael Haggerty
---
refs/files-backe
It only cares about the packed-refs part of the reference store.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 31 ++-
1 file changed, 22 insertions(+), 9 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 4943207098..0d8f39089f
This will later become a method of `packed_ref_store`.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 26 +++---
1 file changed, 15 insertions(+), 11 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index c206791b91..185d05e1d6 100644
--- a
It only cares about the packed-refs part of the reference store.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 26 --
1 file changed, 12 insertions(+), 14 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index f061506bf0..b2ef7b3bb9
It only cares about the packed-refs part of the reference store.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 10 +-
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index bc5c0de84e..4943207098 100644
--- a/refs
It only cares about the packed-refs part of the reference store.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 10 +-
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index b2ef7b3bb9..bc5c0de84e 100644
--- a/refs
Move the `packed_refs_lock` member from `files_ref_store` to
`packed_ref_store`, and rename it to `lock` since it's now more
obvious what it is locking.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 31 ---
1 file changed, 16 insertions(+), 15 dele
-refs-store-prep:
* lock_packed_refs(): fix cache validity check
* for_each_bisect_ref(): don't trim refnames
The patches can also be obtained from my GitHub fork [2] as branch
"packed-ref-store".
Michael
[1] http://public-inbox.org/git/cover.1490026594.git.mhag...@alum.
: Michael Haggerty
---
refs/files-backend.c | 40 ++--
1 file changed, 18 insertions(+), 22 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index b040bb3b0a..87cecde231 100644
--- a/refs/files-backend.c
+++ b/refs/files-backend.c
@@ -413,15
Move `packed_refs_path` from `files_ref_store` to `packed_ref_store`,
and rename it to `path` since its meaning is clear from its new
context.
Inline `files_packed_refs_path()`.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 25 -
1 file changed, 12
ce names. So
* Add a new function, `for_each_fullref_in_submodule()`, to the refs
API.
* Change `for_each_bad_bisect_ref()` to call the new function rather
than `for_each_ref_in_submodule()`.
Signed-off-by: Michael Haggerty
---
refs.c | 12
refs.h | 5 -
revision.c
old behavior,
patch 2 is my suggestion for how to do it.
This patch series can be applied on top of branch
`mh/packed-ref-store-prep`, but it also applies cleanly to master. It
is also available as branch `fix-bisect-trim-check` from my GitHub
fork [1].
Michael
[1] https://github.com/mhagge
continue to refuse to trim *more*
characters than the refname contains, as that really makes no sense.
Signed-off-by: Michael Haggerty
---
refs/iterator.c | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/refs/iterator.c b/refs/iterator.c
index 4cf449ef66..de52d5fe93 100644
On 06/14/2017 02:06 AM, Øyvind A. Holm wrote:
> Commit b9c8e7f2fb6e ("prefix_ref_iterator: don't trim too much") breaks
> git bisect visualize, this reproduces the bug:
>
> $ git bisect start
> $ git bisect bad
> $ git bisect good HEAD^^
> $ git bisect visualize
> fatal: BUG: attempt to
applies on top of mh/packed-ref-store-prep and merges to
master without problems.
Michael
Michael Haggerty (1):
lock_packed_refs(): fix cache validity check
refs/files-backend.c | 32 +++-
1 file changed, 23 insertions(+), 9 deletions(-)
--
2.11.0
_packed_ref_cache()` to call the new function, but only
if the lock *isn't* held.
* Change `lock_packed_refs()` to call the new function in any case
before calling `get_packed_ref_cache()`.
* Fix the comment in `lock_packed_refs()`.
Signed-off-by: Michael Haggerty
---
If anybody i
On Mon, Jun 5, 2017 at 8:23 PM, Stefan Beller wrote:
>
> > [...]
> > "git diff" has been taught to optionally paint new lines that are
> > the same as deleted lines elsewhere differently from genuinely new
> > lines.
> >
> > Are we happy with these changes?
I've been studiously ignoring this
On 05/23/2017 09:45 PM, Jeff King wrote:
> On Mon, May 22, 2017 at 04:17:55PM +0200, Michael Haggerty wrote:
>
>> So:
>>
>> * Move the responsibility for doing the prefix check directly to
>> `cache_ref_iterator`. This means that `cache_ref_iterator_begin()`
>
Move the check that `transaction->state` is valid from
`files_transaction_commit()` to `ref_transaction_commit()`, where
other future reference backends can benefit from it as well.
Signed-off-by: Michael Haggerty
---
refs.c | 12
refs/files-backend.c | 3 ---
Extract a function for deciding whether a reference should be packed.
It is a self-contained bit of logic, so splitting it out improves
readability.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 42 --
1 file changed, 28 insertions(+), 14
re such problems. So report any failures that are not due to
ENOENT.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 14 --
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index b4fa745cd7..dbfd03f989 100644
--- a/refs/f
Only one caller was using it, so move the check to that caller.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 12
refs/ref-cache.c | 6 +-
refs/ref-cache.h | 3 +--
3 files changed, 10 insertions(+), 11 deletions(-)
diff --git a/refs/files-backend.c b
). So, since this is just an optimization, punt on the case of
multiple patterns.
Signed-off-by: Jeff King
Signed-off-by: Michael Haggerty
---
ref-filter.c | 64 +++-
1 file changed, 63 insertions(+), 1 deletion(-)
diff --git a/ref-filte
e latter yet, because it might be useful for another
patch series that I'm working on.
Signed-off-by: Michael Haggerty
---
refs/ref-cache.c | 94 ++--
1 file changed, 84 insertions(+), 10 deletions(-)
diff --git a/refs/ref-cache.c b/refs/ref
If we've got the "packed-refs" file locked, then it can't change;
there's no need to keep calling `stat_validity_check()` on it.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 16 +++-
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git
It will soon have some other users.
Signed-off-by: Michael Haggerty
---
refs.c | 17 +
refs/files-backend.c | 17 -
refs/refs-internal.h | 8
3 files changed, 25 insertions(+), 17 deletions(-)
diff --git a/refs.c b/refs.c
index b3860a9e33
Instead of handling `GIT_REF_PARANOIA` in
`files_ref_iterator_begin()`, handle it in
`refs_ref_iterator_begin()`, where it will cover all reference stores.
Signed-off-by: Michael Haggerty
---
refs.c | 5 +
refs/files-backend.c | 11 ---
2 files changed, 9 insertions
It's pretty cheap to make sure that the caller didn't pass us an
unsorted list by accident, so do so.
Signed-off-by: Michael Haggerty
---
refs.c | 10 --
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/refs.c b/refs.c
index 143936a9c3..d1c781d94e 100644
--- a/re
Teach `read_packed_refs()` to also
* Allocate and initialize the new `packed_ref_cache`
* Open and close the `packed-refs` file
* Update the `validity` field of the new object
This decreases the coupling between `packed_refs_cache` and
`files_ref_store` by a little bit.
Signed-off-by: Michael
f the changes (which
works but is not yet polished), checkout the `mmap-packed-refs` branch
from the same place.
Michael
[1] http://public-inbox.org/git/cover.1495014840.git.mhag...@alum.mit.edu/
[2] https://github.com/mhagger/git
Jeff King (1):
ref-filter: limit traversal to prefix
Michael Hag
p track of whether it is
locked. This keeps related data together and makes the main reference
store less of a special case.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 29 +++--
1 file changed, 11 insertions(+), 18 deletions(-)
diff --git a/refs/files-backen
Move the `lock` member from `packed_ref_cache` to `files_ref_store`,
since at most one cache can have a locked "packed-refs" file
associated with it. Rename it to `packed_refs_lock` to make its
purpose clearer in its new home. More changes are coming here shortly.
Signed-off-by: Michae
7;s be cautious here. Report a bug if ever asked to trim a
reference whose name is not longer than `trim`.
Signed-off-by: Michael Haggerty
---
refs/iterator.c | 18 +-
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/refs/iterator.c b/refs/iterator.c
index bce1f19
The former is by far more common in our codebase.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index cb1f528cbe..fa5d2b6f08 100644
--- a/refs/files-backend.c
+++ b
In particular, make it clear that they make copies of the sha1
arguments.
Signed-off-by: Michael Haggerty
---
refs.h | 13 +
1 file changed, 13 insertions(+)
diff --git a/refs.h b/refs.h
index 685a979a0e..ec8c6bfbbb 100644
--- a/refs.h
+++ b/refs.h
@@ -427,6 +427,19 @@ struct
`test_when_finished` block so that it
can't be skipped.
Signed-off-by: Michael Haggerty
---
t/t3600-rm.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/t/t3600-rm.sh b/t/t3600-rm.sh
index 5f9913ba33..f8568f8841 100755
--- a/t/t3600-rm.sh
+++ b/t/t3600-rm.sh
@@
Extract the cleanup functionality from `files_transaction_commit()`
into a new function. It will soon have another caller.
Use the common cleanup code even on early exit if the transaction is
empty, to reduce code duplication.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 33
efs_delete_refs()`.
Signed-off-by: Michael Haggerty
---
builtin/fetch.c| 2 +-
builtin/remote.c | 4 ++--
refs.c | 11 ++-
refs.h | 12 +++-
refs/files-backend.c | 4 ++--
refs/refs-internal.h
Eliminate a theoretical risk of integer overflow if the two types have
different sizes.
Signed-off-by: Michael Haggerty
---
refs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/refs.c b/refs.c
index beb49fb297..143936a9c3 100644
--- a/refs.c
+++ b/refs.c
@@ -1705,7 +1705,7
Eliminate any chance of integer overflow on platforms where the two
types have different sizes.
Signed-off-by: Michael Haggerty
---
refs.c | 2 +-
refs/files-backend.c | 6 --
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/refs.c b/refs.c
index 8494b1f20d
The backend already correctly restricts its output to references whose
names start with the prefix. By passing the prefix again to
`prefix_ref_iterator`, we were forcing that iterator to do redundant
prefix comparisons. So set it to the empty string.
Signed-off-by: Michael Haggerty
---
refs.c
_abort`. A `ref_transaction_commit()` now basically calls
methods `transaction_prepare` then `transaction_finish`.
Signed-off-by: Michael Haggerty
---
refs.c | 74 --
refs.h | 124 ---
refs/files-backe
It will soon prove useful.
Signed-off-by: Michael Haggerty
---
lockfile.h | 8
1 file changed, 8 insertions(+)
diff --git a/lockfile.h b/lockfile.h
index 7b715f9e77..572064939c 100644
--- a/lockfile.h
+++ b/lockfile.h
@@ -175,6 +175,14 @@ static inline int hold_lock_file_for_update
, `cache_ref_iterator_begin()`
(from which the files reference iterator gets its values)
automatically wraps its output using `prefix_ref_iterator_begin()`
when necessary, so it has the stricter behavior.
Signed-off-by: Michael Haggerty
---
refs/refs-internal.h | 7 ---
1 file changed, 4 insertions
On 05/17/2017 03:38 PM, Jeff King wrote:
> On Wed, May 17, 2017 at 02:05:45PM +0200, Michael Haggerty wrote:
>
>> From: Jeff King
>
> This patch did originate with me, but I know you had to fix several
> things to integrate it in your series. So I'll review it anyway,
On 05/17/2017 07:44 PM, Stefan Beller wrote:
> On Wed, May 17, 2017 at 5:05 AM, Michael Haggerty
> wrote:
>> Break the function `ref_transaction_commit()` into two functions,
>> `ref_transaction_prepare()` and `ref_transaction_finish()`, with a
>> third function, `ref_tr
On 05/17/2017 03:19 PM, Jeff King wrote:
> On Wed, May 17, 2017 at 02:05:34PM +0200, Michael Haggerty wrote:
>
>> Extract function from `files_transaction_commit()`. It will soon have
>> another caller.
>> [...]
>> @@ -2868,10 +2889,8 @@ static int files_trans
On 05/17/2017 07:26 PM, Stefan Beller wrote:
> On Wed, May 17, 2017 at 5:05 AM, Michael Haggerty
> wrote:
>> Extract function from `files_transaction_commit()`. It will soon have
>> another caller.
>
> This sounds odd to me. Maybe it is missing words?
> of s/fu
On 05/17/2017 07:18 PM, Stefan Beller wrote:
> On Wed, May 17, 2017 at 6:17 AM, Jeff King wrote:
>> On Wed, May 17, 2017 at 02:05:33PM +0200, Michael Haggerty wrote:
>>
>>> Instead of using a global `lock_file` instance for the main
>>> "packed-refs" f
On 05/18/2017 06:10 AM, Junio C Hamano wrote:
> Michael Haggerty writes:
>
>> The test of failing `git rm -f` removes the write permissions on the
>> test directory, but fails to restore them if the test fails. This
>> means that the test temporary directory cannot be cl
On 05/17/2017 06:59 PM, Stefan Beller wrote:
> On Wed, May 17, 2017 at 5:05 AM, Michael Haggerty
> wrote:
>
> Now this would want to have some selling words for it?
> I do not see an advantage of this patch as-is.
>
> I mean technically we don't need a sign, so we
301 - 400 of 3206 matches
Mail list logo