On Thu, Jun 12, 2014 at 02:39:00PM -0500, Caleb Thompson wrote:
> Use write_script from t/test-lib-functions.sh instead of cat, shebang,
> and chmod. This protects us from potential shell meta-characters in the
> name of our trash directory, which would be interpreted if we set
> $EDITOR directly.
On Tue, Jun 10, 2014 at 05:35:09PM -0400, Jeff King wrote:
> Here's a re-roll of the commit-slab series.
And here is a re-roll of the --show-signature speedup on top (i.e., the
point of the series in the first place), adjusted to use
get_commit_buffer.
-- >8 --
Subject: reuse cached commit buffe
Am 13.06.2014 03:38, schrieb Joey Hess:
If git merge --no-commit is used to merge a commit adding a
file with an unusual mode -- specifically a symlink which has "mode" 12,
it fails to stage the right mode into the index.
This only happens when core.symlinks=false. I noticed it on FAT, but
h
Am 07.06.2014 09:57, schrieb Stepan Kasal:
From: Karsten Blees
Date: Sat, 14 Jan 2012 22:24:19 +0100
Winansi.c has many static variables that are accessed and modified from
the [v][f]printf / fputs functions overridden in the file. This may cause
multi threaded git commands that print to the co
Joey Hess wrote:
> If git merge --no-commit is used to merge a commit adding a
> file with an unusual mode -- specifically a symlink which has "mode" 12,
> it fails to stage the right mode into the index.
>
> This only happens when core.symlinks=false. I noticed it on FAT, but
> have manage
On 2014-06-13 03.18, David Turner wrote:
[]
>
> It is too old for my patch because it doesn't support ifunc (and I
> suspect that no version of GCC for Windows supports ifunc). But that
> does not seem to be what is going on in your error message. Instead,
> when we #include , we get compat/cpui
On 12.06.14 00:30, David Turner wrote:
[]
Just a general question:
> diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c
> index c323081..6431758 100644
> --- a/builtin/receive-pack.c
> +++ b/builtin/receive-pack.c
> @@ -27,6 +27,7 @@ enum deny_action {
>
> static int deny_deletes;
>
On 2014-06-13 01.30, David Turner wrote:
> On Thu, 2014-06-12 at 12:47 -0700, Junio C Hamano wrote:
>> David Turner writes:
>>
>>> This issue bit us again recently.
>>>
>>> In talking with some colleagues, I realized that the previous version
>>> of this patch, in addition to being potentially slo
If git merge --no-commit is used to merge a commit adding a
file with an unusual mode -- specifically a symlink which has "mode" 12,
it fails to stage the right mode into the index.
This only happens when core.symlinks=false. I noticed it on FAT, but
have managed to reproduce it on ext4.
Her
On Tue, 2014-06-10 at 08:04 +0200, Johannes Sixt wrote:
> Am 6/10/2014 1:05, schrieb Junio C Hamano:
> > Junio C Hamano writes:
> >
> >> David Turner writes:
> >>
> >>> Since Junio has picked up the first patch from previous versions of
> >>> this series, I'm just going to send the second (SSE)
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512
On 06/12/2014 09:02 PM, brian m. carlson wrote:
> On Thu, Jun 12, 2014 at 05:01:16PM -0400, Phillip Susi wrote:
>> So nobody has any ideas on what to check for or how to debug
>> this?
>
> I'm assuming this works in the general case, because we have
On Thu, Jun 12, 2014 at 05:01:16PM -0400, Phillip Susi wrote:
> So nobody has any ideas on what to check for or how to debug this?
I'm assuming this works in the general case, because we have tests for
it. Do you perhaps have a repository and a set of reproduction steps we
could use to try to rep
Michael,
On Thu, Jun 12, 2014 at 12:21:48PM +0200, Michael Haggerty wrote:
> On 06/12/2014 09:10 AM, Jeremiah Mahler wrote:
> > On Wed, Jun 11, 2014 at 02:05:35PM +0200, Michael Haggerty wrote:
> >> [...]
> >> If there were a function like strbuf_grow_to(sb, len):
> >>
> >> void strbuf_grow_to(str
Eric,
On Thu, Jun 12, 2014 at 05:48:52PM -0400, Eric Sunshine wrote:
> On Thu, Jun 12, 2014 at 3:31 PM, Jeremiah Mahler wrote:
> > On Thu, Jun 12, 2014 at 11:50:41AM -0700, Junio C Hamano wrote:
> >> I am on the fence.
> >>
> >> I have this suspicion that the addition of strbuf_set() would *only*
On Thu, 2014-06-12 at 12:47 -0700, Junio C Hamano wrote:
> David Turner writes:
>
> > This issue bit us again recently.
> >
> > In talking with some colleagues, I realized that the previous version
> > of this patch, in addition to being potentially slow, was incomplete.
> > Specifically, it didn
On Thu, Jun 12, 2014 at 05:18:29PM -0400, Eric Sunshine wrote:
> On Thu, Jun 12, 2014 at 3:36 PM, Jeremiah Mahler wrote:
> > On Thu, Jun 12, 2014 at 11:51:19AM -0700, Junio C Hamano wrote:
> >> Jeremiah Mahler writes:
> >>
> >> > Thomas,
> >> >
> >> > On Thu, Jun 12, 2014 at 10:11:36AM +0200, Tho
Ronnie Sahlberg writes:
> Final version.
>
> 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
> tr
I've been thinking a lot about merge bases lately and think I have
discovered something interesting.
tl;dr:
When two branches have multiple merge bases,
git merge-base $master $branch
picks one merge base more or less arbitrarily. Here I describe a
criterion for picking a "best" merge base
On Thu, Jun 12, 2014 at 04:08:55PM -0400, Jeff King wrote:
> So just putting in the safety check is probably the least-disruptive
> thing. It doesn't automatically adapt to a change in the underlying
> commit_buffer code, but it would at least notice it.
Here is that commit with the check you sug
Hmph, this seems to conflict in a meaningful (and painful) way with
Jens's "jl/submodule-recursive-checkout".
--
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
Heiko Voigt writes:
> t/t7410-submodule-config.sh | 141
We already use 7410 for something else in 'pu'; please avoid dups
waiting to happen.
> test-hashmap.c | 6 +-
> test-submodule-config.c | 74
Heiko Voigt writes:
> ...
> +static int is_cache_init = 0;
Please don't initialise variables in the .bss to zero by hand.
> + ...
> + warning("%s:.gitmodules, multiple configurations found for "
> + "submodule.%s.%s. Skipping second one!",
> + commit_
On Thu, Jun 12, 2014 at 3:31 PM, Jeremiah Mahler wrote:
> On Thu, Jun 12, 2014 at 11:50:41AM -0700, Junio C Hamano wrote:
>> I am on the fence.
>>
>> I have this suspicion that the addition of strbuf_set() would *only*
>> help when the original written with reset-and-then-add sequence was
>> subop
On Thu, Jun 12, 2014 at 3:36 PM, Jeremiah Mahler wrote:
> On Thu, Jun 12, 2014 at 11:51:19AM -0700, Junio C Hamano wrote:
>> Jeremiah Mahler writes:
>>
>> > Thomas,
>> >
>> > On Thu, Jun 12, 2014 at 10:11:36AM +0200, Thomas Braun wrote:
>> >> Am 12.06.2014 09:29, schrieb Jeremiah Mahler:
>> >> >
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
So nobody has any ideas on what to check for or how to debug this?
On 6/10/2014 2:57 PM, Phillip Susi wrote:
> I'm in the middle of a long rebase and have had no trouble with
> git rebase --skip several times, but now it has become stuck:
>
> psusi@d
On Thu, Jun 12, 2014 at 02:38:58PM -0500, Caleb Thompson wrote:
> This patch allows people to set commit.verbose to implicitly send
> --verbose to git-commit.
>
> This version incorporates changes suggested by Eric Sunshine, Duy
> Nguyen, and Jeremiah Mahler.
>
> It introduces several cleanup pat
On Thu, Jun 12, 2014 at 11:22:31AM -0700, Junio C Hamano wrote:
> > Note that we also need to provide a "detach" mechanism for
> > the weird case in fsck which passes the buffer back to be
> > freed.
>
> I find that last sentence a bit of white lie ;-).
>
> The sole caller of "detach" is in inde
Add a new configuration variable commit.verbose to implicitly pass
--verbose to git-commit. Ensure that --no-verbose to git-commit
negates that setting.
Signed-off-by: Caleb Thompson
---
Documentation/config.txt | 5 +
Documentation/git-commit.txt | 8 +++-
buil
On Thu, Jun 12, 2014 at 11:15:49AM -0700, Junio C Hamano wrote:
> Why do we need an initialiser at this point (in other words, how
> have other existing slab users coped without having one)?
>
> I think they call init_*_slab() when the slab is needed/used the
> first time (e.g. it is not even wor
David Turner writes:
> This issue bit us again recently.
>
> In talking with some colleagues, I realized that the previous version
> of this patch, in addition to being potentially slow, was incomplete.
> Specifically, it didn't handle the case of refs/heads/case/one vs
> refs/heads/CASE/two; the
t/t7507-commit-verbose.sh was using a global test_set_editor call to
build its environment.
Improve robustness against global state changes by having only tests
which intend to use the $EDITOR to check for presence of a diff in the
editor set up the test-editor to use check-for-diff rather than re
Some of the tests in t/t7507-commit-verbose.sh were still using
git-config to set configuration. Change them to use the test_config
helper.
Signed-off-by: Caleb Thompson
---
t/t7507-commit-verbose.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/t/t7507-commit-verbose.s
Use write_script from t/test-lib-functions.sh instead of cat, shebang,
and chmod. This protects us from potential shell meta-characters in the
name of our trash directory, which would be interpreted if we set
$EDITOR directly.
Signed-off-by: Caleb Thompson
---
t/t7507-commit-verbose.sh | 6 ++---
This patch allows people to set commit.verbose to implicitly send
--verbose to git-commit.
This version incorporates changes suggested by Eric Sunshine, Duy
Nguyen, and Jeremiah Mahler.
It introduces several cleanup patches to t/t7505-commit-verbose.sh to
bring it closer to the current state of t
Junio,
On Thu, Jun 12, 2014 at 11:51:19AM -0700, Junio C Hamano wrote:
> Jeremiah Mahler writes:
>
> > Thomas,
> >
> > On Thu, Jun 12, 2014 at 10:11:36AM +0200, Thomas Braun wrote:
> >> Am 12.06.2014 09:29, schrieb Jeremiah Mahler:
> >> > A common use case with strubfs is to set the buffer to a
Junio,
Comments below...
On Thu, Jun 12, 2014 at 11:50:41AM -0700, Junio C Hamano wrote:
> Jeremiah Mahler writes:
>
> > A common use case with strubfs is to set the buffer to a new value.
> > This must be done in two steps: a reset followed by an add.
> >
> > strbuf_reset(buf);
> > strbuf_
Am 12.06.2014 18:12, schrieb Michael S. Tsirkin:
@@ -136,7 +136,7 @@ fall_back_3way () {
eval "$cmd" &&
GIT_INDEX_FILE="$dotest/patch-merge-tmp-index" \
git write-tree >"$dotest/patch-merge-base+" ||
-cannot_fallback "$(gettext "Repository lacks necessary blobs to fall back
Jeremiah,
That looks great. Since I'm not seeing any more feedback on the code for this
set of patches, I'll go ahead and send up another set.
Thank you for those pointers.
Caleb Thompson
On Thu, Jun 12, 2014 at 11:46:37AM -0700, Jeremiah Mahler wrote:
> Caleb,
>
> On Thu, Jun 12, 2014 at 01:23
Karsten Blees writes:
> Am 10.06.2014 12:17, schrieb Heiko Voigt:
>> The intention of Jonathans critique here[1] was that you do not see what
>> this parameter does on the callsite. I.e.:
>>
>> hashmap_free(&map, 1);
>>
>> compared to
>>
>> hashmap_free(&map, HASHMAP_FREE_ENTRIES);
>
"Michael S. Tsirkin" writes:
> I'm using different signature tags for git am depending on the patch,
> project and other factors.
>
> Sometimes I add multiple tags as well, e.g. QEMU
> wants both Reviewed-by and Signed-off-by tags.
>
> This patch makes it easy to do so:
> 1. new parameter am.sig
Jeremiah Mahler writes:
> Thomas,
>
> On Thu, Jun 12, 2014 at 10:11:36AM +0200, Thomas Braun wrote:
>> Am 12.06.2014 09:29, schrieb Jeremiah Mahler:
>> > A common use case with strubfs is to set the buffer to a new value.
strubfs???
>> > This must be done in two steps: a reset followed by an ad
Jeremiah Mahler writes:
> A common use case with strubfs is to set the buffer to a new value.
> This must be done in two steps: a reset followed by an add.
>
> strbuf_reset(buf);
> strbuf_add(buf, new_buf, len);
>
> In cases where the buffer is being built up in steps, these operations
> make
'!f() { ... }; f' and "!sh -c ''" are recommended patterns for
declaring more complex aliases (see git wiki [1]). This commit teaches
the completion to handle them.
When determining which completion to use for an alias, an opening brace
or single quote is now skipped, and the search for a git
Caleb,
On Thu, Jun 12, 2014 at 01:23:41PM -0500, Caleb Thompson wrote:
> Jeremiah,
>
> On Thu, Jun 12, 2014 at 11:04:59AM -0700, Jeremiah Mahler wrote:
> >
...
> >
> > How are you preparing your patches. 'git format-patch' with a 'git
> > send-email'?
>
> I'm so glad you asked, because I've jus
On Jun 10, 2014, at 7:27 AM, Junio C Hamano wrote:
> Steffen Prohaska writes:
>
> I tend to prefer writing it like so instead:
>
>sh -c '...' -
>
> so that I won't clobber "f" (or any other name). I wonder if you
> can help users of this other pattern as well.
I'll send an updated patc
Karsten Blees writes:
> Here's v5 of the performance tracing patch series, now including a bunch of
> cleanups and adding timestamp, file and line to all trace output.
>
> I'm particularly interested in feedback for the output format. As file names
> have different lengths, printing file:line a
Jeremiah,
On Thu, Jun 12, 2014 at 11:04:59AM -0700, Jeremiah Mahler wrote:
>
> Thanks for checking. Unfortunately the problem persists for me.
>
> It seems to be related to there not being a space at the left most part
> of the patch. It is just a tab with no space. So 'git am' has a
> problem
Jeff King writes:
> This converts two lines into one at each caller. But more
> importantly, it abstracts the concept of freeing the buffer,
> which will make it easier to change later.
>
> Note that we also need to provide a "detach" mechanism for
> the weird case in fsck which passes the buffer
Suggested-by: Stefan Beller
Signed-off-by: Ralf Thielow
---
Am 12. Juni 2014 19:59 schrieb Stefan Beller :
> On 12.06.2014 18:12, Ralf Thielow wrote:
>> Signed-off-by: Ralf Thielow
>> #, c-format
>> msgid "Switched to a new branch '%s'\n"
>> -msgstr "Gewechselt zu einem neuem Branch '%s'\n"
>
Jeff King writes:
> Callers currently must use init_foo_slab() at runtime before
> accessing a slab. For global slabs, it's much nicer if we
> can initialize them in BSS, so that each user does not have
> to add code to check-and-initialize.
>
> Signed-off-by: Jeff King
> ---
> There was no comm
On Thu, Jun 12, 2014 at 11:04:59AM -0700, Jeremiah Mahler wrote:
> Caleb,
>
...
>
> Thanks for checking. Unfortunately the problem persists for me.
>
> It seems to be related to there not being a space at the left most part
> of the patch. It is just a tab with no space. So 'git am' has a
> pr
On Thu, Jun 12, 2014 at 06:05:10PM +0200, Charles Brossollet wrote:
> The two problems I'm pointing are:
>
> 1. After checkout of a branch that tracks /user/main repo, call git
>init submodule motors. Git registers it in .git/config with URL
>/user/sub, while it should be /central/sub acco
Caleb,
On Thu, Jun 12, 2014 at 08:51:31AM -0500, Caleb Thompson wrote:
> I assume that you're running it against master?
>
> I rebased the branch yesterday, but I'll give it another shot. Obviously I
> didn't use git-am, but I can try that.
>
> Caleb Thompson
>
> On Thu, Jun 12, 2014 at 01:41:5
On 12.06.2014 18:12, Ralf Thielow wrote:
> Signed-off-by: Ralf Thielow
> ---
> po/de.po | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/po/de.po b/po/de.po
> index b777ef4..d7bc424 100644
> --- a/po/de.po
> +++ b/po/de.po
> @@ -3503,7 +3503,7 @@ msgstr "Gewechselt zu umg
Add an err argument to _begin so that on non-fatal failures in future ref
backends we can report a nice error back to the caller.
While _begin can currently never fail for other reasons than OOM, in which
case we die() anyway, we may add other types of backends in the future.
For example, a hypothe
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/b
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 ++
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 4a7b196..587ef4a 100644
--- a/fast-import.c
+++ b/fast-import.c
@@ -1735,15 +1735,3
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
@@
Final Final version.
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 ma
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 4b3705d..cf92e5d 100644
--- a/b
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/refs.
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
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. Add an err argument that will be updated on
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 30b5db1..8c0f046 100644
--- a/ref
Change create_branch to use a ref transaction when creating the new branch.
This also fixes a race condition in the old code where two concurrent
create_branch could race since the lock_any_ref_for_update/write_ref_sha1
did not protect against the ref already existing. I.e. one thread could end up
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 +++--
Change update_branch() to use ref transactions for updates.
Reviewed-by: Jonathan Nieder
Signed-off-by: Ronnie Sahlberg
---
fast-import.c | 25 +++--
1 file changed, 15 insertions(+), 10 deletions(-)
diff --git a/fast-import.c b/fast-import.c
index 6707a66..4a7b196 100644
-
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 be618e8..6
In _commit, ENOTDIR can happen in the call to lock_ref_sha1_basic, either when
we lstat the new refname and it returns ENOTDIR or if the name checking
function reports that the same type of conflict happened. In both cases it
means that we can not create the new ref due to a name conflict.
For the
Jeff King writes:
> On Tue, Jun 10, 2014 at 05:35:09PM -0400, Jeff King wrote:
>
>> Here's a re-roll of the commit-slab series. It fixes the issues pointed
>> out by Eric and Christian (thanks, both).
>
> Side note: I marked this as v2, but forgot to do so in each individual
> patch (I write my 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/t
Change ref_transaction_delete() to do basic error checking and return
non-zero of error. 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. Add an err argument that
will be updated
Wrap all the ref updates inside a transaction.
Free commands when we are finished with them instead of leaking.
Signed-off-by: Ronnie Sahlberg
---
builtin/receive-pack.c | 74 +++---
1 file changed, 52 insertions(+), 22 deletions(-)
diff --git a/built
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 in
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
---
branch
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.
Note that this function
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 dele
Making errno from write_ref_sha1() meaningful, which should fix
* a bug in "git checkout -b" where it prints strerror(errno)
despite errno possibly being zero or clobbered
* a bug in "git fetch"'s s_update_ref, which trusts the result of an
errno == ENOTDIR check to detect D/F conflicts
Sign
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/sequenc
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 8523c39..30b5db1 100644
--- a/re
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 change
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. Add an err argument that
will be updated
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 in
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 f
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
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. This changes the return status for _commit from
1 to -1 on failures when writing to the ref. Eventually we will want
_commit
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 8917832..31d7616 100644
--- a/refs.c
+++ b/refs.c
@@ -2639,6
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.
Reviewed-by: Jonathan Nieder
Sig
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.
Change delete_ref to return 0 on success and 1 on failure instead of the
previous 0 on success either 1 or -1 on failure.
Review
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.
Reviewed-by: Jonathan
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 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/builti
Move the check for check_refname_format from lock_any_ref_for_update
to lock_ref_sha1_basic. At some later stage we will get rid of
lock_any_ref_for_update completely.
If lock_ref_sha1_basic fails the check_refname_format test, set errno to
EINVAL before returning NULL. This to guarantee that we w
Making errno when returning from lock_file() meaningful, which should
fix
* an existing almost-bug in lock_ref_sha1_basic where it assumes
errno==ENOENT is meaningful and could waste some work on retries
* an existing bug in repack_without_refs where it prints
strerror(errno) and picks ad
Add an err argument to delete_loose_ref so that we can pass a descriptive
error string back to the caller. Pass the err argument from transaction
commit to this function so that transaction users will have a nice error
string if the transaction failed due to delete_loose_ref.
Add a new function un
Making errno when returning from verify_lock() meaningful, which
should almost but not completely fix
* a bug in "git fetch"'s s_update_ref, which trusts the result of an
errno == ENOTDIR check to detect D/F conflicts
ENOTDIR makes sense as a sign that a file was in the way of a
directory we
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/
We do not yet need both a rollback and a free function for transactions.
Remove ref_transaction_rollback and use ref_transaction_free instead.
At a later stage we may reintroduce a rollback function if we want to start
adding reusable transactions and similar.
Reviewed-by: Jonathan Nieder
Signed
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
---
1 - 100 of 124 matches
Mail list logo