Re: [PATCH 2/3] tree-walk: simplify via strnncmp()

2014-06-17 Thread Jeremiah Mahler
Jonathan, On Mon, Jun 16, 2014 at 01:18:06PM -0700, Jonathan Nieder wrote: 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. */

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

2014-06-17 Thread Jeremiah Mahler
Add a strnncmp() function which behaves like strncmp() except it takes the length of both strings instead of just one. Then simplify tree-walk.c and unpack-trees.c using this new function. Replace all occurrences of name_compare() with strnncmp(). Remove name_compare(), which they both had

[PATCH v2 2/3] tree-walk: simplify via strnncmp()

2014-06-17 Thread Jeremiah Mahler
Simplify tree-walk.c using the strnncmp() function and remove the name_compare() function. Signed-off-by: Jeremiah Mahler jmmah...@gmail.com --- tree-walk.c | 16 +++- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/tree-walk.c b/tree-walk.c index 4dc86c7..efbd3b7

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

2014-06-17 Thread Jeremiah Mahler
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 length, the length difference is

[PATCH v2 3/3] unpack-trees: simplify via strnncmp()

2014-06-17 Thread Jeremiah Mahler
Simplify unpack-trees.c using the strnncmp() function and remove the name_compare() function. Signed-off-by: Jeremiah Mahler jmmah...@gmail.com --- unpack-trees.c | 13 + 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/unpack-trees.c b/unpack-trees.c index

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

2014-06-17 Thread Torsten Bögershausen
On 2014-06-17 09.34, Jeremiah Mahler wrote: 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 minimum common length? Isn'n t that

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

2014-06-17 Thread Karsten Blees
Am 12.06.2014 21:12, schrieb Junio C Hamano: Karsten Blees karsten.bl...@gmail.com 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

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

2014-06-17 Thread Karsten Blees
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. The only exception is the last patch: it changes gitk and git-gui. I'm missing the other two

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

2014-06-17 Thread Erik Faye-Lund
On Tue, Jun 17, 2014 at 9:34 AM, Jeremiah Mahler jmmah...@gmail.com wrote: 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

Re: Potential bug in git client

2014-06-17 Thread Michael Haggerty
On 06/11/2014 12:21 PM, Wojciech Przybył wrote: When I was tagging, I think I might have discovered a git client bug. [...] HOW TO REPRODUCE: - Clone a repo into 2 separate directories. Presume there is a tag v0.1 already in there and it is set on say 10 commits ago. - In first directory

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

2014-06-17 Thread Jeff King
On Sun, Jun 15, 2014 at 03:49:34AM +0900, nori wrote: 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

Re: [PATCH] doc: State coding guideline for error message punctuation

2014-06-17 Thread Jeff King
On Mon, Jun 16, 2014 at 01:55:57PM +0100, Philip Oakley wrote: +Error Messages + + - We typically do not end error messages with a full stop. While + we've been rather inconsistent in the past, these days we mostly + settle on no punctuation. Unlike Junio, I do not mind spelling out

Re: Potential bug in git client

2014-06-17 Thread Wojciech Przybył
Hi Thanks, it's exactly what I was after. BTW Just looking at ubuntu packages (I was using 12.04LTS) and it looks like in a recent LTS release (14.04LTS) they still have git version 1.9.1, and only on utopic ubuntu (the newest one) git is 2.0.0. Anyway, it's probably good time to upgrade. Many

Re: Is there a reason the credential cache server cowardly refuses to delete/reuse the socket file?

2014-06-17 Thread Jeff King
On Sun, Jun 15, 2014 at 10:52:09AM -0400, Jason Pyeron wrote: Could this be a cygwin weirdness? I'd be interested to see the output of: echo url=https://example.com | strace -f git credential-cache get On cygwin things can git a bit weird, I changed it to the actual

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

2014-06-17 Thread Torsten Bögershausen
On 2014-06-17 09.34, Jeremiah Mahler wrote: Add a strnncmp() function which behaves like strncmp() except it takes the length of both strings instead of just one. Then simplify tree-walk.c and unpack-trees.c using this new function. Replace all occurrences of name_compare() with strnncmp().

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

2014-06-17 Thread Ronnie Sahlberg
Let me redo it so it applies to current master. On Mon, Jun 16, 2014 at 5:22 PM, Junio C Hamano gits...@pobox.com wrote: 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.

Re: ISO 13485

2014-06-17 Thread agi
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 we use. Do you have a validation document for git that could provide information on how to use it in order to comply with ISO

Re: Our merge bases sometimes suck

2014-06-17 Thread Junio C Hamano
Michael Haggerty mhag...@alum.mit.edu writes: The best merge base = But not all merge bases are created equal. It is possible to define a best merge base that has some nice properties. Let's focus on the command git diff $master...$branch which is equivalent to

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

2014-06-17 Thread Yi, EungJun
From: Yi EungJun eungjun...@navercorp.com 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

RE: ISO 13485

2014-06-17 Thread Jason Pyeron
-Original Message- 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 we use. Do you have a validation document for git

Re: Our merge bases sometimes suck

2014-06-17 Thread Michael Haggerty
On 06/17/2014 05:08 PM, Junio C Hamano wrote: Michael Haggerty mhag...@alum.mit.edu writes: The best merge base = But not all merge bases are created equal. It is possible to define a best merge base that has some nice properties. Let's focus on the command git

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

2014-06-17 Thread Jeremiah Mahler
Torsten, On Tue, Jun 17, 2014 at 10:23:14AM +0200, Torsten Bögershausen wrote: On 2014-06-17 09.34, Jeremiah Mahler wrote: 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

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

2014-06-17 Thread Jeremiah Mahler
Erik, On Tue, Jun 17, 2014 at 11:09:59AM +0200, Erik Faye-Lund wrote: On Tue, Jun 17, 2014 at 9:34 AM, Jeremiah Mahler jmmah...@gmail.com wrote: 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

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

2014-06-17 Thread Jeremiah Mahler
Torsten, On Tue, Jun 17, 2014 at 01:08:05PM +0200, Torsten Bögershausen wrote: On 2014-06-17 09.34, Jeremiah Mahler wrote: Add a strnncmp() function which behaves like strncmp() except it takes the length of both strings instead of just one. Then simplify tree-walk.c and unpack-trees.c

[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

[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.

[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

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

2014-06-17 Thread Ronnie Sahlberg
Reviewed-by: Jonathan Nieder jrnie...@gmail.com Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- 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

[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

[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

[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

[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 sahlb...@google.com --- 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 +++

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

2014-06-17 Thread Ronnie Sahlberg
Reviewed-by: Jonathan Nieder jrnie...@gmail.com Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- 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

[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 jrnie...@gmail.com Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs.c | 2 +- 1 file changed, 1

[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 jrnie...@gmail.com Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- builtin/tag.c | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/builtin/tag.c b/builtin/tag.c index

[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

[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 jrnie...@gmail.com Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff

[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 jrnie...@gmail.com Signed-off-by: Ronnie

[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.

[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 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 sahlb...@google.com --- refs.c | 40 +++- 1

[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

[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

[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 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 sahlb...@google.com --- builtin/fetch.c | 33 +++-- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/builtin/fetch.c b/builtin/fetch.c index faa1233..52f1ebc

[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 jrnie...@gmail.com Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- builtin/replace.c | 17 ++--- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/builtin/replace.c

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 sahlb...@google.com wrote: Let me redo it so it applies to current master. On Mon,

[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 jrnie...@gmail.com Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- builtin/commit.c | 24 +++- 1

[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 sahlb...@google.com --- builtin/receive-pack.c | 96 +- 1 file changed, 63 insertions(+), 33 deletions(-) diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c

[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

[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

[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 jrnie...@gmail.com Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- sequencer.c | 24 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/sequencer.c b/sequencer.c index

[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

[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 sahlb...@google.com --- cache.h | 2 +- refs.c | 19

[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 jrnie...@gmail.com Signed-off-by:

[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 sahlb...@google.com --- 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 ---

[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 sahlb...@google.com

[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

[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

[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 sahlb...@google.com --- cache.h| 2 ++ lockfile.c | 22 -- 2 files changed, 14 insertions(+), 10

[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 jrnie...@gmail.com Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- builtin/update-ref.c | 3

[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 jrnie...@gmail.com Signed-off-by: Ronnie Sahlberg

[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 jrnie...@gmail.com Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- builtin/update-ref.c | 10 +- 1 file changed, 5

[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 sahlb...@google.com --- refs.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff

[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

[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

[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 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

[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 jrnie...@gmail.com Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs.c | 30

[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 jrnie...@gmail.com Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs.c | 25 + 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/refs.c b/refs.c

[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

[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 jrnie...@gmail.com Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs.c | 2 +- refs.h | 6 -- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/refs.c b/refs.c

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

2014-06-17 Thread Junio C Hamano
Karsten Blees karsten.bl...@gmail.com 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

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 jens.lehm...@web.de 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

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

2014-06-17 Thread Junio C Hamano
Karsten Blees karsten.bl...@gmail.com 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();

[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 v17 16/48] refs.c: add an err argument to delete_ref_loose

2014-06-17 Thread Junio C Hamano
Ronnie Sahlberg sahlb...@google.com 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,

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 jens.lehm...@web.de 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

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

2014-06-17 Thread Junio C Hamano
David Turner dtur...@twopensource.com 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?

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 jens.lehm...@web.de 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

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 helpers in

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

2014-06-17 Thread Junio C Hamano
Jeremiah Mahler jmmah...@gmail.com 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

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

2014-06-17 Thread Junio C Hamano
David Turner dtur...@twopensource.com 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

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 dtur...@twopensource.com 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

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

2014-06-17 Thread Junio C Hamano
Jens Lehmann jens.lehm...@web.de writes: Am 17.06.2014 00:49, schrieb Junio C Hamano: Jens Lehmann jens.lehm...@web.de 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

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, you

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 hvo...@hvoigt.net writes: On Thu, Jun 12, 2014 at 02:59:23PM -0700, Junio C Hamano wrote: Heiko Voigt hvo...@hvoigt.net writes: t/t7410-submodule-config.sh | 141 We already

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 karsten.bl...@gmail.com 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

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 tanay...@gmail.com 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

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 shouldn't I want

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 jmmah...@gmail.com 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

[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.

[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

[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 ca...@calebthompson.io Reviewed-by: Jeremiah Mahler jmmah...@gmail.com --- t/t7507-commit-verbose.sh | 4 ++-- 1 file changed,

[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 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 ca...@calebthompson.io --- Documentation/config.txt | 5 + Documentation/git-commit.txt

[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 tbo...@web.de --- unicode_width.h | 49 ++--- 1 file changed, 42 insertions(+),

Re: ISO 13485

2014-06-17 Thread Philip Oakley
Agnes, I'd like to re-emphasise Jason's excellent comments, below: From: Jason Pyeron jpye...@pdinc.us 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

  1   2   >