On Tue, Jun 17, 2014 at 01:34:36AM -0400, Jeff King wrote:
> You need some mechanism to store entries that are NULL. It may be enough
> to silently convert them into the string "true" inside the cached
> storage. But there may be callers who treat NULL specially (e.g., a
> tri-state true/false/aut
On Mon, Jun 16, 2014 at 02:15:54AM -0700, Tanay Abhra wrote:
> **DOUBT**
> This patch builds on top of patch series[1]. The first patch in the
> replace `git_config` series is [2], which passed all the tests.
>
> But this patch falters at this test in t1300-repo-config.sh,
>
> git config alias.
On Mon, Jun 16, 2014 at 01:27:12AM -0700, Tanay Abhra wrote:
> +static int config_cache_callback(const char *key, const char *value, void
> *unused)
> +{
> + config_cache_set_value(key, value);
> + return 0;
> +}
This gets the normalized key, which is good; you should be able to just
has
Optimize check_refname_component using SSE2 on x86_64.
git rev-parse HEAD is a good test-case for this, since it does almost
nothing except parse refs. For one particular repo with about 60k
refs, almost all packed, the timings are:
Look up table: 29 ms
SSE2: 23 ms
This cuts about 20%
From: Yi EungJun
Signed-off-by: Yi EungJun
---
Documentation/technical/http-protocol.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Documentation/technical/http-protocol.txt
b/Documentation/technical/http-protocol.txt
index 544373b..2d0eb19 100644
--- a/Documentation/te
Thanks for your advice. i'll resend it.
2014-06-17 3:26 GMT+09:00 Junio C Hamano :
> Yi EungJun writes:
>
>> Could you change the author to "Yi EungJun "
>> if you apply this patch?
>
> You can send a patch with the desired "From: " line that matches the
> identity on the "Signed-off-by: " line a
On Mon, 2014-06-16 at 17:06 -0700, Junio C Hamano wrote:
> David Turner writes:
>
> > Optimize check_refname_component using SSE2 on x86_64.
> >
> > git rev-parse HEAD is a good test-case for this, since it does almost
> > nothing except parse refs. For one particular repo with about 60k
> > ref
The series applies cleanly up to 25/48 or so to 'master', but this
step already breaks tests, at least t1400 but possibly others.
Please do not make me bisect X-<.
Thanks.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More
If the user asks for --format=%G with nothing else, we
correctly realize that "%G" is not a valid placeholder (it
should be "%G?", "%GK", etc). But we still tell the
strbuf_expand code that we consumed 2 characters, causing it
to jump over the trailing NUL and output garbage.
This also fixes the c
David Turner writes:
> Optimize check_refname_component using SSE2 on x86_64.
>
> git rev-parse HEAD is a good test-case for this, since it does almost
> nothing except parse refs. For one particular repo with about 60k
> refs, almost all packed, the timings are:
>
> Look up table: 29 ms
> SSE2:
We do not check these along with the other pretty-format
placeholders in t6006, because we need signed commits to
make them interesting. t7510 has such commits, and can
easily exercise them in addition to the regular
--show-signature code path.
Signed-off-by: Jeff King
---
Similar to before, but
We tested both good and bad signatures, but not ones made
correctly but with a key for which we have no trust.
Signed-off-by: Jeff King
---
I'm not happy about grepping more gpg output, but perhaps this "not
certified" is no worse than the current 'Good signature from" greps we
have?
The interna
From: Michael J Gruber
We check multiple commits in a loop. Because we want to
break out of the loop if any single iteration fails, we use
a subshell/exit like:
(
for i in $stuff
do
do-something $i || exit 1
done
)
However, we are inconsistent in our
Our setup creates a sequence of commits, each with its own
tag. However, we sometimes refer to "seventh-signed" as
"master". This works, since it is at the tip of the created
branch, but is brittle if new tests need to add more
commits. Let's use its tag name to be unambiguous.
Signed-off-by: Jeff
On Mon, Jun 16, 2014 at 07:36:49PM -0400, Jeff King wrote:
> On Mon, Jun 16, 2014 at 05:50:14PM -0400, Eric Sunshine wrote:
>
> > > +test_expect_success GPG 'show good signature with custom format' '
> > > + cat >expect <<-\EOF
> >
> > Broken &&-chain (and in tests below).
>
> Whoops, tha
On Mon, Jun 16, 2014 at 05:50:14PM -0400, Eric Sunshine wrote:
> > +test_expect_success GPG 'show good signature with custom format' '
> > + cat >expect <<-\EOF
>
> Broken &&-chain (and in tests below).
Whoops, thanks. Re-roll coming in a minute. I'm also reorganizing the
two patches a bit
Tanay Abhra writes:
> When a compound construct like a string_list within another
> struct is used, the default initializer macros are useless.
> For such cases add helper functions for string_list
> initialization for both DUP and NODUP modes.
>
> Signed-off-by: Tanay Abhra
> ---
Sorry, but I
Jens Lehmann writes:
> Add this test library to simplify covering all combinations of submodule
> update scenarios without having to add those to a test of each work tree
> manipulating command over and over again.
>
> The functions test_submodule_switch() and test_submodule_forced_switch()
> are
Caleb Thompson writes:
>> Again, what are we testing, exactly?
>>
>> We do not want to see "^diff --git" in the output file, in other
>> words, we want to make sure "^diff --git" does not appear in the
>> output.
>>
>> So
>>
>> write_script check-for-no-diff <<-\EOF
>> ! grep '^di
Jens Lehmann writes:
> For the upcoming submodule test framework we often need to assert that an
> empty directory exists in the work tree. Add the test_dir_is_empty()
> function which asserts that the given argument is an empty directory.
>
> Signed-off-by: Jens Lehmann
> ---
> t/test-lib-func
On Mon, Jun 16, 2014 at 4:26 PM, Jeff King wrote:
> On Mon, Jun 16, 2014 at 04:13:11PM -0400, Jeff King wrote:
>
>> It doesn't look like we have any tests of "%G*" and friends at all. :(
>
> Maybe we can add this:
>
> -- >8 --
> Subject: t7510: check %G* pretty-format output
>
> We do not check th
"Philip Oakley" writes:
>> ---once
>> the reader
>> understands that Git reads all configuration varilables of the
>> same name and the code paths that *use* one of them pick the one
>> defined the last,
> It's this step tha
On Mon, Jun 16, 2014 at 01:34:20PM -0700, Junio C Hamano wrote:
> > Your middle example above did make me think of one other thing, though.
> > As you noted, we actually have _three_ signature types:
> >
> > 1. signed tags
> >
> > 2. signed commits
> >
> > 3. merges with embedded mergetag he
Jeff King writes:
> On Fri, Jun 13, 2014 at 10:06:10AM -0700, Junio C Hamano wrote:
> ...
>> and more, perhaps?
>
> That is certainly the direction I was thinking of when I suggested "git
> verify".
>
> However, I do not think it is too bad a thing to add a verify-commit
> that matches verify-tag
"brian m. carlson" writes:
> If git rebase --merge encountered a conflict, --skip would not work if the
> next commit also conflicted. The msgnum file would never be updated with
> the new patch number, so no patch would actually be skipped, resulting in an
> inescapable loop.
>
> Update the msg
Jeremiah Mahler writes:
> On Fri, Jun 13, 2014 at 11:49:10AM -0500, Caleb Thompson wrote:
> ...
>> > The patches look good, they apply clean ('git am'), and all tests pass.
>> >
>> > Reviewed-by: Jeremiah Mahler
>>
>> So that I'm clear on the etiquitte, is it appropriate for me to add this
>> R
On Mon, Jun 16, 2014 at 04:13:11PM -0400, Jeff King wrote:
> It doesn't look like we have any tests of "%G*" and friends at all. :(
Maybe we can add this:
-- >8 --
Subject: t7510: check %G* pretty-format output
We do not check these along with the other pretty-format
placeholders in t6006, beca
Jeremiah Mahler wrote:
> --- a/tree-walk.c
> +++ b/tree-walk.c
[...]
> @@ -174,7 +164,7 @@ static int check_entry_match(const char *a, int a_len,
> const char *b, int b_len)
>* scanning further.
>*/
>
> - int cmp = name_compare(a, a_len, b, b_len);
> + int cmp = strnncmp
Jeremiah Mahler wrote:
> --- a/unpack-trees.c
> +++ b/unpack-trees.c
[...]
> @@ -678,7 +667,7 @@ static int find_cache_pos(struct traverse_info *info,
> ce_len = ce_slash - ce_name;
> else
> ce_len = ce_namelen(ce) - pfxlen;
> -
Jeremiah Mahler wrote:
> Add a strnncmp() function which behaves like strncmp() except it uses
> the length of both strings instead of just one.
The above description isn't very clear to me. Problems:
- strncmp compares prefixes of \0-terminated strings. This function
compares two binary b
If the user asks for --format=%G with nothing else, we
correctly realize that "%G" is not a valid placeholder (it
should be "%G?", "%GK", etc). But we still tell the
strbuf_expand code that we consumed 2 characters, causing it
to jump over the trailing NUL and output garbage.
This also fixes the c
On Mon, Jun 16, 2014 at 01:06:45PM -0700, Junio C Hamano wrote:
> Caleb Thompson writes:
>
> > On Fri, Jun 13, 2014 at 10:48:55AM -0700, Junio C Hamano wrote:
> >> Caleb Thompson writes:
> >>
> >> > diff --git a/t/t7507-commit-verbose.sh b/t/t7507-commit-verbose.sh
> >> > index 35a4d06..402d6a1 1
Caleb Thompson writes:
> On Fri, Jun 13, 2014 at 10:48:55AM -0700, Junio C Hamano wrote:
>> Caleb Thompson writes:
>>
>> > diff --git a/t/t7507-commit-verbose.sh b/t/t7507-commit-verbose.sh
>> > index 35a4d06..402d6a1 100755
>> > --- a/t/t7507-commit-verbose.sh
>> > +++ b/t/t7507-commit-verbose.
On Mon, Jun 16, 2014 at 02:50:57PM -0500, Caleb Thompson wrote:
> On Fri, Jun 13, 2014 at 10:48:55AM -0700, Junio C Hamano wrote:
> > Caleb Thompson writes:
> >
> > > diff --git a/t/t7507-commit-verbose.sh b/t/t7507-commit-verbose.sh
> > > index 35a4d06..402d6a1 100755
> > > --- a/t/t7507-commit-v
From: "Junio C Hamano"
Philip Oakley writes:
Clarify error message puntuation to reduce review workload [1].
[1] http://article.gmane.org/gmane.comp.version-control.git/251547
(see trailing 'nit' item).
Signed-off-by: Philip Oakley
---
Hmmm. Do we really need to spell everything out?
It
On Fri, Jun 13, 2014 at 10:06:10AM -0700, Junio C Hamano wrote:
> Jeff King writes:
>
> > I realize this isn't really your itch to scratch. It's just that when I
> > see a description like "verify a commit", I wonder what exactly "verify"
> > means.
>
> I think that is an important point. If a
On Fri, Jun 13, 2014 at 10:48:55AM -0700, Junio C Hamano wrote:
> Caleb Thompson writes:
>
> > diff --git a/t/t7507-commit-verbose.sh b/t/t7507-commit-verbose.sh
> > index 35a4d06..402d6a1 100755
> > --- a/t/t7507-commit-verbose.sh
> > +++ b/t/t7507-commit-verbose.sh
> > @@ -7,6 +7,10 @@ write_scr
On Mon, Jun 16, 2014 at 11:43:32AM -0700, Junio C Hamano wrote:
> I have two doubts, while appreciating the overall direction to
> clarify things very much.
>
> * "single overrides, multiple appends" is not a wrong explanation
>per-se, but sounds like an arbitrary rule that forces people to
From: "Tanay Abhra"
On 06/16/2014 05:49 AM, Philip Oakley wrote:
Pass a configuration parameter to the command. The value
- given will override values from configuration files.
+ given will override single valued variables from configuration
+ files, and append to multivar variables. Previous
From: "Junio C Hamano"
Philip Oakley writes:
When the '-c' option is used to pass alternate URLs or similar
multivar parameters to git commands the effect is not what the user
expected [1,2].
Clarify that multivar configuration parameters do not supercede
previous values. Suggest an alternat
Optimize check_refname_component using SSE2 on x86_64.
git rev-parse HEAD is a good test-case for this, since it does almost
nothing except parse refs. For one particular repo with about 60k
refs, almost all packed, the timings are:
Look up table: 29 ms
SSE2: 23 ms
This cuts about 20%
On Mon, Jun 16, 2014 at 11:29:39AM -0700, Junio C Hamano wrote:
> nori writes:
>
> > extract_content_type() could not extract a charset parameter if the
> > parameter is not the first one and there is a whitespace and a following
> > semicolon just before the parameter. For example:
> >
> >
Simplify tree-walk.c using the strnncmp() function and remove the
name_compare() function.
Signed-off-by: Jeremiah Mahler
---
tree-walk.c | 16 +++-
1 file changed, 3 insertions(+), 13 deletions(-)
diff --git a/tree-walk.c b/tree-walk.c
index 4dc86c7..efbd3b7 100644
--- a/tree-walk.
Add a strnncmp() function which behaves like strncmp() except it uses
the length of both strings instead of just one.
Signed-off-by: Jeremiah Mahler
---
strbuf.c | 6 ++
strbuf.h | 2 ++
2 files changed, 8 insertions(+)
diff --git a/strbuf.c b/strbuf.c
index ac62982..bd486c3 100644
--- a/st
Simplify unpack-trees.c using the strnncmp() function and remove the
name_compare() function.
Signed-off-by: Jeremiah Mahler
---
unpack-trees.c | 13 +
1 file changed, 1 insertion(+), 12 deletions(-)
diff --git a/unpack-trees.c b/unpack-trees.c
index 4a9cdf2..9a71b5a 100644
--- a/un
Add a strnncmp() function which behaves like strncmp() except it uses
the length of both strings instead of just one.
Then simplify tree-walk.c and unpack-trees.c using this new function.
Replace all occurances of name_compare() with strnncmp(). Remove
name_compare(), which they both had identica
Caleb Thompson writes:
> On Fri, Jun 13, 2014 at 07:41:29PM -0400, Jeff King wrote:
>> On Fri, Jun 13, 2014 at 10:42:26AM -0700, Junio C Hamano wrote:
>>
>> > Jeff King writes:
>> >
>> > > [1] It might make sense for test_set_editor, when run from within a
>> > > test, to behave more like te
Philip Oakley writes:
> Clarify error message puntuation to reduce review workload [1].
>
> [1] http://article.gmane.org/gmane.comp.version-control.git/251547
> (see trailing 'nit' item).
>
> Signed-off-by: Philip Oakley
> ---
Hmmm. Do we really need to spell everything out?
I would rather ho
Philip Oakley writes:
> When the '-c' option is used to pass alternate URLs or similar
> multivar parameters to git commands the effect is not what the user
> expected [1,2].
>
> Clarify that multivar configuration parameters do not supercede
> previous values. Suggest an alternative style parame
On 06/16/2014 05:49 AM, Philip Oakley wrote:
> Pass a configuration parameter to the command. The value
> - given will override values from configuration files.
> + given will override single valued variables from configuration
> + files, and append to multivar variables. Previou
nori writes:
> extract_content_type() could not extract a charset parameter if the
> parameter is not the first one and there is a whitespace and a following
> semicolon just before the parameter. For example:
>
> text/plain; format=fixed ;charset=utf-8
>
> Signed-off-by: Yi EungJun
> ---
P
Yi EungJun writes:
> Could you change the author to "Yi EungJun "
> if you apply this patch?
You can send a patch with the desired "From: " line that matches the
identity on the "Signed-off-by: " line at the beginning of the log
message, like this:
From: nori
Subject: [PATCH] h
Nick Dimov writes:
> Im struggling for a couple of hours to make git store metadata of the
> files using metastore and I use hooks/pre-commit for this.
The pre-commit hook is about checking if the commits being created
is sensible and rejecting otherwise, and it is not designed to allow
futzing
David Aguilar writes:
> Hmm.. I guess what I could do is keep the old behavior (having gitk ignore
> TMPDIR)
> on Windows and only use the new code path on non-Windows.
Or perhaps attempt to create, catch error and then retry the old way?
Hopefully Windows folks do not have to worry about forg
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
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
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
Reviewed-by: Jonathan Nieder
Signed-off-by: Ronnie Sahlberg
---
fast-import.c | 29 +++--
1 file changed, 23 insertions(+), 6 deletions(-)
diff --git a/fast-import.c b/fast-import.c
index 0752f0a..42a607d 100644
--- a/fast-import.c
+++ b/fast-import.c
@@ -1730,15 +1730,3
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
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
---
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
Wrap all the ref updates inside a transaction.
Signed-off-by: Ronnie Sahlberg
---
builtin/receive-pack.c | 96 +-
1 file changed, 63 insertions(+), 33 deletions(-)
diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c
index c323081..b51f8ae
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 up
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
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 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
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
@@
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
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
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 the update_ref helper function to use a ref transaction internally.
Reviewed-by: Jonathan Nieder
Signed-off-by: Ronnie Sahlberg
---
refs.c | 25 +
1 file changed, 21 insertions(+), 4 deletions(-)
diff --git a/refs.c b/refs.c
index b75523f..50e5475 100644
--- a/re
Making errno when returning from commit_packed_refs() meaningful,
which should fix
* a bug in "git clone" where it prints strerror(errno) based on
errno, despite errno possibly being zero and potentially having
been clobbered by that point
* the same kind of bug in "git pack-refs"
and pre
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
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.
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
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
Call ref_transaction_commit with QUIET_ON_ERR and use the strbuf that is
returned to print a log message if/after the transaction fails.
Reviewed-by: Jonathan Nieder
Signed-off-by: Ronnie Sahlberg
---
builtin/update-ref.c | 10 +-
1 file changed, 5 insertions(+), 5 deletions(-)
diff --
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
Update repack_without_refs to take an err argument and update it if there
is a failure. Pass the err variable from ref_transaction_commit to this
function so that callers can print a meaningful error message if _commit
fails due to this function.
Signed-off-by: Ronnie Sahlberg
---
refs.c | 19 ++
Since all callers now use QUIET_ON_ERR we no longer need to provide an onerr
argument any more. Remove the onerr argument from the ref_transaction_commit
signature.
Reviewed-by: Jonathan Nieder
Signed-off-by: Ronnie Sahlberg
---
builtin/update-ref.c | 3 +--
refs.c | 22 +++--
Track the status of a transaction in a new status field. Check the field for
sanity, i.e. that status must be OPEN when _commit/_create/_delete or
_update is called or else die(BUG:...)
Signed-off-by: Ronnie Sahlberg
---
refs.c | 40 +++-
1 file changed, 39 in
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
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
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
No external users call write_ref_sha1 any more so lets declare it static.
Signed-off-by: Ronnie Sahlberg
---
refs.c | 10 --
refs.h | 3 ---
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/refs.c b/refs.c
index 47575e8..cb56e38 100644
--- a/refs.c
+++ b/refs.c
@@ -2639,6
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
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
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
"Michael S. Tsirkin" writes:
> Now A wants to sign this patch.
>
> I think there are two reasonable ways to behave:
> 1. What you describe above:
> A
> B
> A
That is the only sensible thing to do for Signed-off-by footers.
> 2. For things like Tested-by: tags, removing tag from
> where it was a
No external callers reference lock_ref_sha1 any more so lets declare it static.
Reviewed-by: Jonathan Nieder
Signed-off-by: Ronnie Sahlberg
---
refs.c | 2 +-
refs.h | 6 --
2 files changed, 1 insertion(+), 7 deletions(-)
diff --git a/refs.c b/refs.c
index 50e5475..bb12e65 100644
--- a/ref
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
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
Update replace.c to use ref transactions for updates.
Reviewed-by: Jonathan Nieder
Signed-off-by: Ronnie Sahlberg
---
builtin/replace.c | 15 +--
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/builtin/replace.c b/builtin/replace.c
index b62420a..24f0dc9 100644
--- a/b
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
Skip using the lock_any_ref_for_update wrapper and call lock_ref_sha1_basic
directly from the commit function.
Reviewed-by: Jonathan Nieder
Signed-off-by: Ronnie Sahlberg
---
refs.c | 12 ++--
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/refs.c b/refs.c
index 69815d9..d
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
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 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
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
1 - 100 of 141 matches
Mail list logo