Re: [PATCH RFC] git-am: support any number of signatures

2014-06-17 Thread Junio C Hamano
On Tue, Jun 17, 2014 at 8:09 PM, Michael S. Tsirkin wrote: > > OK, after looking into this for a while, I realize > this is a special property of the Signed-off-by footer. > For now I think it's reasonable to just avoid de-duplicating > other footers if any. Agree? Not really. I'd rather see "git

[PATCH v11] refs.c: SSE2 optimizations for check_refname_component

2014-06-17 Thread David Turner
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%

[PATCH RFC v2] git-am: support any number of signatures

2014-06-17 Thread Michael S. Tsirkin
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.signoff can be used any number of times:

Why does gpg.program work for commit but not log?

2014-06-17 Thread Jason Pyeron
jpyeron@black /projects/microsoft-smartcard-sign/tmp $ git --version git version 1.7.9 jpyeron@black /projects/microsoft-smartcard-sign/tmp $ GIT_TRACE=1 git commit -S -m 'bin' trace: built-in: git 'commit' '-S' '-m' 'bin' trace: run_command: '/projects/microsoft-smartcard-sign/tmp/bin/logginggpg.s

Re: [PATCH RFC] git-am: support any number of signatures

2014-06-17 Thread Michael S. Tsirkin
On Mon, Jun 16, 2014 at 11:06:20AM -0700, Junio C Hamano wrote: > "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

Re: [PATCH 0/7] Second part of msysgit/unicode

2014-06-17 Thread Stepan Kasal
Hello Karsten, On Tue, Jun 17, 2014 at 11:06:52AM +0200, Karsten Blees wrote: > Am 11.06.2014 11:37, schrieb Stepan Kasal: > > This is the second part of the time-proven unicode suport branch from > > msysgit. > > This batch is a collection of small independent changes, limited to mingw.c. > > Th

Re: [PATCH] Update of unicode_width.h to Unicode Version 7.0

2014-06-17 Thread Jonathan Nieder
Torsten Bögershausen wrote: > Unicode Version 7.0 was released yesterday. > Run ./update_unicode.sh to update the zero_width table. > Note: the double_width is unchanged. > > Signed-off-by: Torsten Bögershausen > --- > unicode_width.h | 49 ++--- > 1 f

Re: [PATCH 1/5] hashmap: add enum for hashmap free_entries option

2014-06-17 Thread Junio C Hamano
Heiko Voigt writes: > If this is such a controversial change for you I will drop this patch in > the next round. I think it would make the callsite more readable without > adding much clutter but I am fine with it either way. OK, let's do that. -- To unsubscribe from this list: send the line "un

[PATCH v4] http: fix charset detection of extract_content_type()

2014-06-17 Thread Yi EungJun
From: Yi EungJun 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 And it also could not handle correctly some

Re: [PATCH v2 1/2] string-list: Add string_list initializer helper functions

2014-06-17 Thread Junio C Hamano
Tanay Abhra writes: > On 06/16/2014 03:59 PM, Junio C Hamano wrote: >> 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 >>> initializatio

Re: [PATCH] doc git: multivar configuration parameters append to existing values

2014-06-17 Thread Philip Oakley
From: "Junio C Hamano" "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 thi

Re: [PATCH v3] http: fix charset detection of extract_content_type()

2014-06-17 Thread Jeff King
On Wed, Jun 18, 2014 at 12:29:59AM +0900, Yi, EungJun wrote: > From: Yi EungJun > > 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/pla

Re: [PATCH v6 4/4] commit: Add commit.verbose configuration

2014-06-17 Thread Jeff King
On Tue, Jun 17, 2014 at 02:37:45PM -0700, Junio C Hamano wrote: > Jeff King writes: > > > On Tue, Jun 17, 2014 at 02:39:00PM -0500, Caleb Thompson wrote: > > > >> diff --git a/t/t7507-commit-verbose.sh b/t/t7507-commit-verbose.sh > >> index 35a4d06..471bd8f 100755 > >> --- a/t/t7507-commit-verbo

Re: [PATCH v6 4/4] commit: Add commit.verbose configuration

2014-06-17 Thread Junio C Hamano
Jeff King writes: > On Tue, Jun 17, 2014 at 02:39:00PM -0500, Caleb Thompson wrote: > >> diff --git a/t/t7507-commit-verbose.sh b/t/t7507-commit-verbose.sh >> index 35a4d06..471bd8f 100755 >> --- a/t/t7507-commit-verbose.sh >> +++ b/t/t7507-commit-verbose.sh >> @@ -7,6 +7,10 @@ write_script check

Re: [PATCH v6 1/4] commit test: Use test_config instead of git-config

2014-06-17 Thread Junio C Hamano
Junio C Hamano writes: > Caleb Thompson writes: > >> 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. > > "were still using" is only a half of the story, and we need to be > more careful than that, t

Re: [PATCH v6 1/4] commit test: Use test_config instead of git-config

2014-06-17 Thread Junio C Hamano
Caleb Thompson writes: > 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. "were still using" is only a half of the story, and we need to be more careful than that, though. > Signed-off-by: Caleb Thomp

Re: [PATCH 02/14] submodules: Add the lib-submodule-update.sh test library

2014-06-17 Thread Junio C Hamano
Jens Lehmann writes: > Oh, I forgot to add a smiley there, I haven't been serious about > that statement. I don't care too deeply about it but feel a bit > more confident with the two explicit tests. Do you want me to > change them to a single "test -e"? I have no strong preference. -- To unsubs

Re: [PATCH/RFC] alias.c: Replace git_config with git_config_get_string

2014-06-17 Thread Jeff King
On Tue, Jun 17, 2014 at 11:51:35AM -0700, Tanay Abhra wrote: > I have read your other two replies related to it. I suggest the following > approach > for git_config_get_string(), it will return, > > 1. Return null if no value was found for the entered key. > > 2. Empty string (""), returned for

Re: [PATCH v6 4/4] commit: Add commit.verbose configuration

2014-06-17 Thread Jeff King
On Tue, Jun 17, 2014 at 02:39:00PM -0500, Caleb Thompson wrote: > diff --git a/t/t7507-commit-verbose.sh b/t/t7507-commit-verbose.sh > index 35a4d06..471bd8f 100755 > --- a/t/t7507-commit-verbose.sh > +++ b/t/t7507-commit-verbose.sh > @@ -7,6 +7,10 @@ write_script check-for-diff <<-'EOF' > e

Re: Annotated tags by default?

2014-06-17 Thread Junio C Hamano
Robert Dailey writes: > Is there a config option or some way for `git tag -a` to be the > default? I could create an alias but would make more sense to have a > config: > > git config --global tag.alwaysannotate true If you really wanted to, you could do the following (and you must to do all of

Re: [PATCH 02/14] submodules: Add the lib-submodule-update.sh test library

2014-06-17 Thread Jens Lehmann
Am 17.06.2014 20:44, schrieb Junio C Hamano: > Jens Lehmann writes: > >> Am 17.06.2014 00:49, schrieb Junio C Hamano: >>> Jens Lehmann writes: + GIT_WORK_TREE=. git config --unset core.worktree >>> >>> Hmph. What does GIT_WORK_TREE=. alone without GIT_DIR= >>> do? It's not like i

Kindly Contact: (Mr. Chen Zan)

2014-06-17 Thread Standard Chartered Bank
-- Good day, Permit my mode of initial contact with you. My initial letter to you returned undelivered. I am an investment relationship manager with Standard Chartered Bank, Hong Kong and It is essential we confirm you are still at this email address before we divulge details of the discreet pro

Annotated tags by default?

2014-06-17 Thread Robert Dailey
Is there a config option or some way for `git tag -a` to be the default? I could create an alias but would make more sense to have a config: git config --global tag.alwaysannotate true -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kern

Re: ISO 13485

2014-06-17 Thread Philip Oakley
Agnes, I'd like to re-emphasise Jason's excellent comments, below: From: "Jason Pyeron" From: agi Sent: Tuesday, June 17, 2014 10:58 Hi Jason, Thanks for the speedy reply. We are in the process of trying to make our software product ISO13485 compatible and we are assessing all systems that w

[PATCH] Update of unicode_width.h to Unicode Version 7.0

2014-06-17 Thread Torsten Bögershausen
Unicode Version 7.0 was released yesterday. Run ./update_unicode.sh to update the zero_width table. Note: the double_width is unchanged. Signed-off-by: Torsten Bögershausen --- unicode_width.h | 49 ++--- 1 file changed, 42 insertions(+), 7 deletions(-

[PATCH v6 4/4] commit: Add commit.verbose configuration

2014-06-17 Thread Caleb Thompson
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

[PATCH v6 0/4] commit: Add commit.verbose configuration

2014-06-17 Thread Caleb Thompson
This patch allows people to set commit.verbose to implicitly send --verbose to git-commit. It introduces several cleanup patches to t/t7505-commit-verbose.sh to bring it closer to the current state of the tests as they have been explained to me, then adds the verbose config and --no-verbose flag.

[PATCH v6 2/4] commit test: Use write_script

2014-06-17 Thread Caleb Thompson
Use write_script from t/test-lib-functions.sh instead of cat, shebang, and chmod. This aids in readability for creating the script by using the named function and allows us to turn off interpolation in the heredoc of the script body to avoid extra escaping, since $SHELL_PATH is handled for us. Sig

[PATCH v6 3/4] commit test: test_set_editor in each test

2014-06-17 Thread Caleb Thompson
t/t7507-commit-verbose.sh was using a global test_set_editor call to build its environment. The $EDITOR being used was not necessary for all tests, and was in fact circumvented using subshells in some cases. To improve robustness against global state changes and avoid the use of subshells to tempo

[PATCH v6 1/4] commit test: Use test_config instead of git-config

2014-06-17 Thread Caleb Thompson
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 Reviewed-by: Jeremiah Mahler --- t/t7507-commit-verbose.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --

Re: [PATCH v2 1/3] add strnncmp() function

2014-06-17 Thread Jeremiah Mahler
Junio, On Tue, Jun 17, 2014 at 10:55:18AM -0700, Junio C Hamano wrote: > Jeremiah Mahler writes: > > > Add a strnncmp() function which behaves like strncmp() except it takes > > the length of both strings instead of just one. It behaves the same as > > strncmp() up to the minimum common length

Re: [PATCH v2 0/3] add strnncmp() function

2014-06-17 Thread Jeremiah Mahler
Jonathan, On Tue, Jun 17, 2014 at 10:48:17AM -0700, Jonathan Nieder wrote: > >> On 2014-06-17 09.34, Jeremiah Mahler wrote: > > >>> Also, strnncmp() was switched from using memcmp() to strncmp() > >>> internally to make it clear that this is meant for strings, not > >>> general buffers. > > Why

Re: [PATCH v2 1/2] string-list: Add string_list initializer helper functions

2014-06-17 Thread Tanay Abhra
On 06/16/2014 03:59 PM, Junio C Hamano wrote: > 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

Re: Re: [PATCH 1/5] hashmap: add enum for hashmap free_entries option

2014-06-17 Thread Heiko Voigt
On Tue, Jun 17, 2014 at 10:30:35AM +0200, Karsten Blees wrote: > Am 12.06.2014 21:12, schrieb Junio C Hamano: > > 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 th

Re: Re: [PATCH 0/5] submodule config lookup API

2014-06-17 Thread Heiko Voigt
On Mon, Jun 16, 2014 at 10:58:25AM -0700, Junio C Hamano wrote: > Heiko Voigt writes: > > > On Thu, Jun 12, 2014 at 02:59:23PM -0700, Junio C Hamano wrote: > >> Heiko Voigt writes: > >> > >> > t/t7410-submodule-config.sh | 141 > >> > >> We already use 7410 for so

Re: [PATCH/RFC] alias.c: Replace git_config with git_config_get_string

2014-06-17 Thread Tanay Abhra
On 06/16/2014 10:43 PM, Jeff King wrote: > >> +v = git_config_get_string(alias_key); >> +if (!v) >> +config_error_nonbool(alias_key); > > What does a NULL output from git_config_get_string mean? I think with > the current code, it means "no such key was found". In which case

Re: [PATCH 02/14] submodules: Add the lib-submodule-update.sh test library

2014-06-17 Thread Junio C Hamano
Jens Lehmann writes: > Am 17.06.2014 00:49, schrieb Junio C Hamano: >> Jens Lehmann writes: >>> + git checkout -b "add_sub1" && >>> + git submodule add ./. sub1 && >> >> This is not technically wrong per-se, but having the project's >> history itself as its own submodule *is

Re: [PATCH v10 1/1] refs.c: SSE2 optimizations for check_refname_component

2014-06-17 Thread David Turner
On Tue, 2014-06-17 at 11:03 -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

Re: [PATCH v10 1/1] refs.c: SSE2 optimizations for check_refname_component

2014-06-17 Thread Junio C Hamano
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:

Re: [PATCH v2 1/3] add strnncmp() function

2014-06-17 Thread Junio C Hamano
Jeremiah Mahler writes: > Add a strnncmp() function which behaves like strncmp() except it takes > the length of both strings instead of just one. It behaves the same as > strncmp() up to the minimum common length between the strings. When the > strings are identical up to this minimum common l

Re: [PATCH v2 0/3] add strnncmp() function

2014-06-17 Thread Jonathan Nieder
>> On 2014-06-17 09.34, Jeremiah Mahler wrote: >>> Also, strnncmp() was switched from using memcmp() to strncmp() >>> internally to make it clear that this is meant for strings, not >>> general buffers. Why shouldn't I want to use this helper on arbitrary data? One of the advantages of other hel

Re: [PATCH 09/14] rebase: add t3426 for submodule updates

2014-06-17 Thread Jens Lehmann
Am 16.06.2014 11:57, schrieb Eric Sunshine: > On Sun, Jun 15, 2014 at 1:02 PM, Jens Lehmann wrote: >> Test that the rebase command updates the work tree as expected for >> changes which don't result in conflicts. To make that work add two >> helper functions that add a commit only touching files a

Re: [PATCH v9] refs.c: SSE2 optimizations for check_refname_component

2014-06-17 Thread Junio C Hamano
David Turner writes: > git-compat-util.h | 11 +++ > refs.c | 223 > - > t/t5511-refspec.sh | 20 + > 3 files changed, 236 insertions(+), 18 deletions(-) Hmph, on what branch are you basing your patch? As a follow-up to yo

Re: [PATCH 02/14] submodules: Add the lib-submodule-update.sh test library

2014-06-17 Thread Jens Lehmann
Am 17.06.2014 00:49, schrieb Junio C Hamano: > 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_submo

Re: [PATCH v17 16/48] refs.c: add an err argument to delete_ref_loose

2014-06-17 Thread Junio C Hamano
Ronnie Sahlberg writes: > Thanks. > > I have rebased it on current master and re-sent it as v18 > > I passes all tests, except t0008 which is unrelated to this series. I think You need to either have 97c1364b (t0008: do not depend on 'echo' handling backslashes specially, 2014-06-13), or avoid u

[PATCH v10 1/1] refs.c: SSE2 optimizations for check_refname_component

2014-06-17 Thread David Turner
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%

[no subject]

2014-06-17 Thread David Turner
This version changes only the commit message; there is no longer any configure.ac code. -- 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

Re: [PATCH v5 10/11] trace: add trace_performance facility to debug performance issues

2014-06-17 Thread Junio C Hamano
Karsten Blees writes: > Simple use case (measure one code section): > > uint64_t start = getnanotime(); > /* code section to measure */ > trace_performance_since(start, "foobar"); > > Medium use case (measure consecutive code sections): > > uint64_t start = getnanotime(); > /* first cod

Re: [PATCH 01/14] test-lib: add test_dir_is_empty()

2014-06-17 Thread Jens Lehmann
Am 17.06.2014 00:05, schrieb Junio C Hamano: > 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. >> >>

Re: [PATCH v5 09/11] trace: add high resolution timer function to debug performance issues

2014-06-17 Thread Junio C Hamano
Karsten Blees writes: > Am 11.06.2014 10:01, schrieb Karsten Blees: >> the epoch allows using the results (div 10e9) with other time-related APIs. > > s/10e9/1e9/ That replacement is fine but the "(div 1e9)" still wants to be clarified. What did you exactly mean by that? If the result is divid

[PATCH v18 35/48] refs.c: make lock_ref_sha1 static

2014-06-17 Thread Ronnie Sahlberg
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 af211b6..56a52e0 100644 --- a/ref

[PATCH v18 38/48] refs.c: remove lock_ref_sha1

2014-06-17 Thread Ronnie Sahlberg
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

[PATCH v18 30/48] branch.c: use ref transaction for all ref updates

2014-06-17 Thread Ronnie Sahlberg
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

[PATCH v18 36/48] refs.c: remove the update_ref_lock function

2014-06-17 Thread Ronnie Sahlberg
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

[PATCH v18 31/48] refs.c: change update_ref to use a transaction

2014-06-17 Thread Ronnie Sahlberg
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 be29f66..af211b6 100644 --- a/re

[PATCH v18 00/48] Use ref transactions

2014-06-17 Thread Ronnie Sahlberg
This patch series can also be found at https://github.com/rsahlberg/git/tree/ref-transactions This patch series is based on current master 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

[PATCH v18 18/48] update-ref: use err argument to get error from ref_transaction_commit

2014-06-17 Thread Ronnie Sahlberg
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 --

[PATCH v18 11/48] refs.c: make remove_empty_directories alwasy set errno to something sane

2014-06-17 Thread Ronnie Sahlberg
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.

[PATCH v18 21/48] refs.c: change ref_transaction_create to do error checking and return status

2014-06-17 Thread 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

[PATCH v18 03/48] refs.c: constify the sha arguments for ref_transaction_create|delete|update

2014-06-17 Thread Ronnie Sahlberg
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

[PATCH v18 08/48] refs.c: add an err argument to repack_without_refs

2014-06-17 Thread Ronnie Sahlberg
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 --- builtin/remote

[PATCH v18 05/48] refs.c: add a strbuf argument to ref_transaction_commit for error logging

2014-06-17 Thread Ronnie Sahlberg
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

[PATCH v18 17/48] refs.c: make update_ref_write update a strbuf on failure

2014-06-17 Thread Ronnie Sahlberg
Change update_ref_write to also update an error strbuf on failure. This makes the error available to ref_transaction_commit callers if the transaction failed due to update_ref_sha1/write_ref_sha1 failures. Reviewed-by: Jonathan Nieder Signed-off-by: Ronnie Sahlberg --- refs.c | 9 ++--- 1 f

[PATCH v18 13/48] refs.c: make resolve_ref_unsafe set errno to something meaningful on error

2014-06-17 Thread Ronnie Sahlberg
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

[PATCH v18 15/48] refs.c: make ref_update_reject_duplicates take a strbuf argument for errors

2014-06-17 Thread Ronnie Sahlberg
Make ref_update_reject_duplicates return any error that occurs through a new strbuf argument. This means that when a transaction commit fails in this function we will now be able to pass a helpful error message back to the caller. Reviewed-by: Jonathan Nieder Signed-off-by: Ronnie Sahlberg ---

[PATCH v18 09/48] refs.c: make sure log_ref_setup returns a meaningful errno

2014-06-17 Thread Ronnie Sahlberg
Making errno when returning from log_ref_setup() meaningful, Signed-off-by: Ronnie Sahlberg --- refs.c | 27 +++ refs.h | 4 +++- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/refs.c b/refs.c index 67a0217..9ea519c 100644 --- a/refs.c +++ b/refs.c @@ -2

[PATCH v18 06/48] lockfile.c: add a new public function unable_to_lock_message

2014-06-17 Thread Ronnie Sahlberg
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/

[PATCH v18 19/48] refs.c: remove the onerr argument to ref_transaction_commit

2014-06-17 Thread Ronnie Sahlberg
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 +++--

[PATCH v18 12/48] refs.c: commit_packed_refs to return a meaningful errno on failure

2014-06-17 Thread Ronnie Sahlberg
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

[PATCH v18 28/48] sequencer.c: use ref transactions for all ref updates

2014-06-17 Thread Ronnie Sahlberg
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

[PATCH v18 20/48] refs.c: change ref_transaction_update() to do error checking and return status

2014-06-17 Thread Ronnie Sahlberg
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

[PATCH v18 16/48] refs.c: add an err argument to delete_ref_loose

2014-06-17 Thread Ronnie Sahlberg
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

[PATCH v18 14/48] refs.c: log_ref_write should try to return meaningful errno

2014-06-17 Thread Ronnie Sahlberg
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

[PATCH v18 26/48] replace.c: use the ref transaction functions for updates

2014-06-17 Thread Ronnie Sahlberg
Update replace.c to use ref transactions for updates. Reviewed-by: Jonathan Nieder Signed-off-by: Ronnie Sahlberg --- builtin/replace.c | 17 ++--- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/builtin/replace.c b/builtin/replace.c index 1bb491d..054f5ef 100644 ---

Re: [PATCH v17 16/48] refs.c: add an err argument to delete_ref_loose

2014-06-17 Thread Ronnie Sahlberg
Thanks. I have rebased it on current master and re-sent it as v18 I passes all tests, except t0008 which is unrelated to this series. regards ronnie sahlberg On Tue, Jun 17, 2014 at 7:34 AM, Ronnie Sahlberg wrote: > Let me redo it so it applies to current master. > > On Mon, Jun 16, 2014 at 5

[PATCH v18 27/48] commit.c: use ref transactions for updates

2014-06-17 Thread Ronnie Sahlberg
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

[PATCH v18 47/48] fetch.c: change s_update_ref to use a ref transaction

2014-06-17 Thread Ronnie Sahlberg
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

[PATCH v18 39/48] refs.c: make prune_ref use a transaction to delete the ref

2014-06-17 Thread Ronnie Sahlberg
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

[PATCH v18 24/48] refs.c: add transaction.status and track OPEN/CLOSED/ERROR

2014-06-17 Thread Ronnie Sahlberg
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

[PATCH v18 32/48] receive-pack.c: use a reference transaction for updating the refs

2014-06-17 Thread Ronnie Sahlberg
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

[PATCH v18 40/48] refs.c: make delete_ref use a transaction

2014-06-17 Thread Ronnie Sahlberg
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

[PATCH v18 37/48] refs.c: remove the update_ref_write function

2014-06-17 Thread Ronnie Sahlberg
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

[PATCH v18 29/48] fast-import.c: change update_branch to use ref transactions

2014-06-17 Thread Ronnie Sahlberg
Change update_branch() to use ref transactions for updates. Reviewed-by: Jonathan Nieder Signed-off-by: Ronnie Sahlberg --- fast-import.c | 26 +++--- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/fast-import.c b/fast-import.c index 6707a66..cd929dc 100644

[PATCH v18 22/48] refs.c: update ref_transaction_delete to check for error and return status

2014-06-17 Thread Ronnie Sahlberg
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

[PATCH v18 34/48] walker.c: use ref transaction for ref updates

2014-06-17 Thread Ronnie Sahlberg
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

[PATCH v18 33/48] fast-import.c: use a ref transaction when dumping tags

2014-06-17 Thread Ronnie Sahlberg
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 cd929dc..191fc47 100644 --- a/fast-import.c +++ b/fast-import.c @@ -1734,15 +1734,3

[PATCH v18 23/48] refs.c: make ref_transaction_begin take an err argument

2014-06-17 Thread Ronnie Sahlberg
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

[PATCH v18 44/48] refs.c: call lock_ref_sha1_basic directly from commit

2014-06-17 Thread Ronnie Sahlberg
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 31d41fb..6

[PATCH v18 41/48] refs.c: pass the ref log message to _create/delete/update instead of _commit

2014-06-17 Thread Ronnie Sahlberg
Change the reference transactions so that we pass the reflog message through to the create/delete/update function instead of the commit message. This allows for individual messages for each change in a multi ref transaction. Reviewed-by: Jonathan Nieder Signed-off-by: Ronnie Sahlberg --- branch

[PATCH v18 46/48] refs.c: propagate any errno==ENOTDIR from _commit back to the callers

2014-06-17 Thread Ronnie Sahlberg
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

[PATCH v18 48/48] refs.c: make write_ref_sha1 static

2014-06-17 Thread Ronnie Sahlberg
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 362ff1b..dfbf003 100644 --- a/refs.c +++ b/refs.c @@ -2666,6

[PATCH v18 07/48] lockfile.c: make lock_file return a meaningful errno on failurei

2014-06-17 Thread Ronnie Sahlberg
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

[PATCH v18 10/48] refs.c: verify_lock should set errno to something meaningful

2014-06-17 Thread Ronnie Sahlberg
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

[PATCH v18 45/48] refs.c: pass a skip list to name_conflict_fn

2014-06-17 Thread Ronnie Sahlberg
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

[PATCH v18 25/48] tag.c: use ref transactions when doing updates

2014-06-17 Thread Ronnie Sahlberg
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

[PATCH v18 02/48] refs.c: ref_transaction_commit should not free the transaction

2014-06-17 Thread Ronnie Sahlberg
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

[PATCH v18 42/48] refs.c: pass NULL as *flags to read_ref_full

2014-06-17 Thread Ronnie Sahlberg
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

[PATCH v18 43/48] refs.c: move the check for valid refname to lock_ref_sha1_basic

2014-06-17 Thread Ronnie Sahlberg
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

[PATCH v18 04/48] refs.c: allow passing NULL to ref_transaction_free

2014-06-17 Thread Ronnie Sahlberg
Allow ref_transaction_free(NULL) as a no-op. This makes ref_transaction_free easier to use and more similar to plain 'free'. In particular, it lets us rollback unconditionally as part of cleanup code after setting 'transaction = NULL' if a transaction has been committed or rolled back already. Re

[PATCH v18 01/48] refs.c: remove ref_transaction_rollback

2014-06-17 Thread Ronnie Sahlberg
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

  1   2   >