Re: [PATCH] environment: enable core.preloadindex by default

2014-06-03 Thread Steve Hoelzer
On Mon, Jun 2, 2014 at 3:01 PM, Karsten Blees karsten.bl...@gmail.com wrote: Git for Windows users may want to try core.fscache=true as well [1]. This eliminates the UAC penalties for repositories located on the Windows system drive [2]. [1] https://github.com/msysgit/git/pull/94 [2]

Re: [BUG REPORT] Git log pretty date

2014-06-03 Thread Dennis Kaarsemaker
On Mon, Jun 02, 2014 at 11:46:19PM -0400, Jeff King wrote: On Fri, May 30, 2014 at 09:08:57AM +0100, Rodrigo Fernandes wrote: Do you have any idea how does github understand that is a bug and fixes it automatically? (I'm saying this because on Github the date is correct). I looked into

Re: [PATCH] pack-objects: use free()+xcalloc() instead of xrealloc()+memset()

2014-06-03 Thread Jeff King
On Mon, Jun 02, 2014 at 04:09:12PM -0700, Junio C Hamano wrote: I tried git blame -M -C -C -C pack-objects.c but couldn't get anything but the whole thing blamed to 2834bc2. Are you two being a bit too unreasonable, or trying to be fanciful and funny and I am not getting the humor? We

Re: [BUG REPORT] Git log pretty date

2014-06-03 Thread Jeff King
On Tue, Jun 03, 2014 at 08:23:02AM +0200, Dennis Kaarsemaker wrote: On Mon, Jun 02, 2014 at 11:46:19PM -0400, Jeff King wrote: On Fri, May 30, 2014 at 09:08:57AM +0100, Rodrigo Fernandes wrote: Do you have any idea how does github understand that is a bug and fixes it automatically?

[PATCH] error_resolve_conflict: rewrap advice message

2014-06-03 Thread Jeff King
If you try to commit with unresolved conflicts in the index, you get this message: $ git commit U foo error: 'commit' is not possible because you have unmerged files. hint: Fix them up in the work tree, hint: and then use 'git add/rm file' as

[PATCH] error_resolve_conflict: drop quotations around operation

2014-06-03 Thread Jeff King
When you try to commit with unmerged entries, you get an error like: $ git commit error: 'commit' is not possible because you have unmerged files. The quotes around commit are clunky; the user doesn't care that this message is a template with the command-name filled in. Saying: error:

Re: [RFC/PATCH v2 1/2] config: Add hashtable for config parsing retrieval

2014-06-03 Thread Jeff King
On Mon, Jun 02, 2014 at 07:47:39AM -0700, Tanay Abhra wrote: +static int config_cache_entry_cmp_icase(const struct config_cache_entry *e1, + const struct config_cache_entry *e2, const char* key) +{ + return strcasecmp(e1-key, key ? key : e2-key); +} +

Re: [PATCH] environment: enable core.preloadindex by default

2014-06-03 Thread Karsten Blees
Am 03.06.2014 08:18, schrieb Steve Hoelzer: On Mon, Jun 2, 2014 at 3:01 PM, Karsten Blees karsten.bl...@gmail.com wrote: Git for Windows users may want to try core.fscache=true as well [1]. This eliminates the UAC penalties for repositories located on the Windows system drive [2]. [1]

Re: [PATCH] environment: enable core.preloadindex by default

2014-06-03 Thread Duy Nguyen
On Mon, Jun 2, 2014 at 11:43 PM, Steve Hoelzer shoel...@gmail.com wrote: There is consensus that the default should change because it will benefit nearly all users (some just a little, but some a lot). See [1] and replies. [1]:

Re: [PATCH] config: Add documentation for writing config files

2014-06-03 Thread Tanay Abhra
On 06/02/2014 12:37 PM, Matthieu Moy wrote: Tanay Abhra tanay...@gmail.com writes: Signed-off-by: Tanay Abhra tanay...@gmail.com --- Documentation/technical/api-config.txt | 31 ++- 1 file changed, 30 insertions(+), 1 deletion(-) Even though the reason to

[PATCH v2] string-list: Add a value to string_list initializer lists

2014-06-03 Thread Tanay Abhra
STRING_LIST_INIT_{NODUP,DUP} initializers list values only for earlier structure members, relying on the usual convention in C that the omitted members are initailized to 0, i.e. the former is expanded to the latter: struct string_list l = STRING_LIST_INIT_DUP; struct string_list

Re: [ANNOUNCE] Git v2.0.0

2014-06-03 Thread NeilBrown
On Mon, 2 Jun 2014 19:59:53 -0700 Linus Torvalds torva...@linux-foundation.org wrote: On Mon, Jun 2, 2014 at 7:08 PM, NeilBrown ne...@suse.de wrote: git request-pull master git://neil.brown.name/md after tagging the current commit as md/3.15-fixes and pushing out the tag You should

Re: [PATCH v2] string-list: Add a value to string_list initializer lists

2014-06-03 Thread Matthieu Moy
Tanay Abhra tanay...@gmail.com writes: diff --git a/Documentation/technical/api-string-list.txt b/Documentation/technical/api-string-list.txt index 20be348..f1add51 100644 --- a/Documentation/technical/api-string-list.txt +++ b/Documentation/technical/api-string-list.txt @@ -200,3 +200,5

Re: [RFC/PATCH v2 2/2] config: Add new query functions to the api docs

2014-06-03 Thread Matthieu Moy
Tanay Abhra tanay...@gmail.com writes: Add explanations for `git_config_get_string_multi` and `git_config_get_string` which utilize the config hash table for querying in a non-callback manner for a specific variable. I'd squash this into the previous patch: the reader appreciates having the

Re: [PATCH] refs.c: change read_ref_at to use the reflog iterators

2014-06-03 Thread Ronnie Sahlberg
Thanks. On Mon, Jun 2, 2014 at 2:21 PM, Junio C Hamano gits...@pobox.com wrote: Ronnie Sahlberg sahlb...@google.com writes: read_ref_at has its own parsing of the reflog file for no really good reason so lets change this to use the existing reflog iterators. This removes one instance where

[PATCH] refs.c: change read_ref_at to use the reflog iterators

2014-06-03 Thread Ronnie Sahlberg
read_ref_at has its own parsing of the reflog file for no really good reason so lets change this to use the existing reflog iterators. This removes one instance where we manually unmarshall the reflog file format. Remove the now redundant ref_msg function. Log messages for errors are changed

Re: [PATCH v11 35/41] refs.c: pack all refs before we start to rename a ref

2014-06-03 Thread Ronnie Sahlberg
Thanks! On Fri, May 30, 2014 at 11:08 AM, Jonathan Nieder jrnie...@gmail.com wrote: Ronnie Sahlberg wrote: We want to do this to make it easier to handle atomic renames in rename_ref for the case 'git branch -m foo/bar foo'. In an ideal world, a part of me would rather see git branch -m

Re: [PATCH v11 32/41] refs.c: make delete_ref use a transaction

2014-06-03 Thread Ronnie Sahlberg
Thanks! On Fri, May 30, 2014 at 10:28 AM, Jonathan Nieder jrnie...@gmail.com wrote: Ronnie Sahlberg wrote: Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs.c | 34 +- 1 file changed, 13 insertions(+), 21 deletions(-) Reviewed-by: Jonathan Nieder

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

2014-06-03 Thread Ronnie Sahlberg
On Fri, May 30, 2014 at 10:38 AM, Jonathan Nieder jrnie...@gmail.com wrote: Ronnie Sahlberg wrote: 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

Re: [PATCH] error_resolve_conflict: drop quotations around operation

2014-06-03 Thread Junio C Hamano
Jeff King p...@peff.net writes: When you try to commit with unmerged entries, you get an error like: $ git commit error: 'commit' is not possible because you have unmerged files. The quotes around commit are clunky; the user doesn't care that this message is a template with the

Re: [PATCH v5 1/2] refs.c: optimize check_refname_component()

2014-06-03 Thread Junio C Hamano
David Turner dtur...@twopensource.com writes: static int check_refname_component(const char *refname, int flags) { const char *cp; char last = '\0'; for (cp = refname; ; cp++) { - char ch = *cp; - if (ch == '\0' || ch == '/') +

Re: [PATCH v11 39/41] refs.c: propagate any errno==ENOTDIR from _commit back to the callers

2014-06-03 Thread Ronnie Sahlberg
On Fri, May 30, 2014 at 5:22 PM, Jonathan Nieder jrnie...@gmail.com wrote: Hi, Ronnie Sahlberg wrote: For these cases, save the errno value and abort and make sure that the caller can see errno==ENOTDIR. Also start defining specific return codes for _commit, assign -1 as a generic error

[PATCH v5 2/2] refs.c: SSE4.2 optimizations for check_refname_component

2014-06-03 Thread David Turner
Optimize check_refname_component using SSE4.2, where available. 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 SSE4.2:25 ms This is

[PATCH v5 1/2] refs.c: optimize check_refname_component()

2014-06-03 Thread David Turner
In a repository with many refs, check_refname_component can be a major contributor to the runtime of some git commands. One such command is git rev-parse HEAD Timings for one particular repo, with about 60k refs, almost all packed, are: Old: 35 ms New: 29 ms Many other commands which read refs

Paper cut bug: Why isn't git clone xxxx recursive by default?

2014-06-03 Thread Mara Kim
Hello git devs! I'd like to start off by saying that git is an amazing piece of software and every one of you deserve major kudos for your work on the project. However, I'd like to point out a few paper cut bugs (to use the Ubuntu parlance). Apologies if this question has been asked already,

Re: [PATCH v11 00/41] Use ref transactions

2014-06-03 Thread Jonathan Nieder
Hi, Ronnie Sahlberg wrote: 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 updates to become atomic when there are failures locking or

Re: [PATCH v11 36/41] refs.c: move the check for valid refname to lock_ref_sha1_basic

2014-06-03 Thread Ronnie Sahlberg
On Fri, May 30, 2014 at 11:12 AM, Jonathan Nieder jrnie...@gmail.com wrote: Ronnie Sahlberg wrote: 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. Do you know if this will

[PATCH] receive-pack: optionally deny case-clone refs

2014-06-03 Thread David Turner
It is possible to have two branches which are the same but for case. This works great on the case-sensitive filesystems, but not so well on case-insensitive filesystems. It is fairly typical to have case-insensitive clients (Macs, say) with a case-sensitive server (GNU/Linux). Should a user

Re: Paper cut bug: Why isn't git clone xxxx recursive by default?

2014-06-03 Thread Junio C Hamano
Mara Kim mara@vanderbilt.edu writes: Apologies if this question has been asked already, but what is the reasoning behind making git clone not recursive (--recursive) by default? The primary reason why submodules are separate repositories is not to require people to have everything. Some

Re: Reset by checkout?

2014-06-03 Thread Kevin Bracey
On 03/06/2014 00:54, Junio C Hamano wrote: Not that I can think of a better way to update these descriptions, and not that I am opposing to update these descriptions to make it easier for new people to learn, but I am not sure if these treat ORIG_HEAD and the changes since that commit as

Re: [PATCH v12 06/41] refs.c: add an err argument to repack_without_refs

2014-06-03 Thread Ronnie Sahlberg
Thanks. I have done all the additions of save_errno you suggested. On Thu, May 29, 2014 at 11:17 AM, Jonathan Nieder jrnie...@gmail.com wrote: Hi, Ronnie Sahlberg wrote: Update repack_without_refs to take an err argument and update it if there is a failure. Pass the err variable from

Re: [PATCH v4] Add an explicit GIT_DIR to the list of excludes

2014-06-03 Thread Pasha Bolokhov
On Thu, May 29, 2014 at 4:42 AM, Duy Nguyen pclo...@gmail.com wrote: + const char *worktree = get_git_work_tree(); + + if (worktree == NULL || + dir_inside_of(n_git, get_git_work_tree()) = 0) { + struct exclude_list *el =

Re: Paper cut bug: Why isn't git clone xxxx recursive by default?

2014-06-03 Thread Junio C Hamano
Junio C Hamano gits...@pobox.com writes: Mara Kim mara@vanderbilt.edu writes: Apologies if this question has been asked already, but what is the reasoning behind making git clone not recursive (--recursive) by default? The primary reason why submodules are separate repositories is not

Re: [PATCH v11 25/41] fast-import.c: use a ref transaction when dumping tags

2014-06-03 Thread Ronnie Sahlberg
Thanks. I have changed the transaction functions to die(BUG:) if the user tries to call _update/_create/_delete on a failed transaction. On Thu, May 29, 2014 at 10:41 AM, Jonathan Nieder jrnie...@gmail.com wrote: Ronnie Sahlberg wrote: On Wed, May 28, 2014 at 4:39 PM, Jonathan Nieder

Re: [PATCH] receive-pack: optionally deny case-clone refs

2014-06-03 Thread Junio C Hamano
David Turner dtur...@twopensource.com writes: It is possible to have two branches which are the same but for case. This works great on the case-sensitive filesystems, but not so well on case-insensitive filesystems. It is fairly typical to have case-insensitive clients (Macs, say) with a

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

2014-06-03 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 v13 02/41] refs.c: ref_transaction_commit should not free the transaction

2014-06-03 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 v13 19/41] commit.c: use ref transactions for updates

2014-06-03 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 v13 18/41] replace.c: use the ref transaction functions for updates

2014-06-03 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 | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/builtin/replace.c b/builtin/replace.c

[PATCH v13 01/41] refs.c: remove ref_transaction_rollback

2014-06-03 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 v13 11/41] refs.c: remove the onerr argument to ref_transaction_commit

2014-06-03 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 v13 13/41] refs.c: change ref_transaction_create to do error checking and return status

2014-06-03 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 v13 28/41] refs.c: remove the update_ref_lock function

2014-06-03 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 v13 20/41] sequencer.c: use ref transactions for all ref updates

2014-06-03 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 v13 21/41] fast-import.c: change update_branch to use ref transactions

2014-06-03 Thread Ronnie Sahlberg
Change update_branch() to use ref transactions for updates. Reviewed-by: Jonathan Nieder jrnie...@gmail.com Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- fast-import.c | 25 +++-- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/fast-import.c

[PATCH v13 37/41] refs.c: call lock_ref_sha1_basic directly from commit

2014-06-03 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 v13 26/41] walker.c: use ref transaction for ref updates

2014-06-03 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 v13 31/41] refs.c: make prune_ref use a transaction to delete the ref

2014-06-03 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. Signed-off-by: Ronnie

[PATCH v13 35/41] refs.c: pack all refs before we start to rename a ref

2014-06-03 Thread Ronnie Sahlberg
This means that most loose refs will no longer be present after the rename which triggered a test failure since it assumes the file for an unrelated ref would still be present after the rename. This also makes the rename itself slightly slower, but as it now results in all refs being packed future

[PATCH v13 34/41] refs.c: pass NULL as *flags to read_ref_full

2014-06-03 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 v13 40/41] fetch.c: change s_update_ref to use a ref transaction

2014-06-03 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 v13 15/41] refs.c: make ref_transaction_begin take an err argument

2014-06-03 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 v13 00/41] Use ref transactions

2014-06-03 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 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

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

2014-06-03 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 v13 06/41] refs.c: add an err argument to repack_without_refs

2014-06-03 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 a problem in repack_without_refs. Add a new function

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

2014-06-03 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 v13 10/41] update-ref: use err argument to get error from ref_transaction_commit

2014-06-03 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 v13 30/41] refs.c: remove lock_ref_sha1

2014-06-03 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 v13 04/41] refs.c: allow passing NULL to ref_transaction_free

2014-06-03 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 v13 23/41] refs.c: change update_ref to use a transaction

2014-06-03 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 v13 16/41] refs.c: add transaction.status and track OPEN/CLOSED/ERROR

2014-06-03 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 v13 22/41] branch.c: use ref transaction for all ref updates

2014-06-03 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 v13 38/41] refs.c: pass a skip list to name_conflict_fn

2014-06-03 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 v13 36/41] refs.c: move the check for valid refname to lock_ref_sha1_basic

2014-06-03 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 v13 32/41] refs.c: make delete_ref use a transaction

2014-06-03 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 v13 14/41] refs.c: update ref_transaction_delete to check for error and return status

2014-06-03 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 v13 09/41] refs.c: make update_ref_write update a strbuf on failure

2014-06-03 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 v13 24/41] receive-pack.c: use a reference transaction for updating the refs

2014-06-03 Thread Ronnie Sahlberg
Wrap all the ref updates inside a transaction. Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- builtin/receive-pack.c | 31 ++- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c index c323081..13f4a63

[PATCH v13 12/41] refs.c: change ref_transaction_update() to do error checking and return status

2014-06-03 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 v13 07/41] refs.c: make ref_update_reject_duplicates take a strbuf argument for errors

2014-06-03 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 v13 08/41] refs.c: add an err argument to delete_ref_loose

2014-06-03 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 v13 17/41] tag.c: use ref transactions when doing updates

2014-06-03 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 v13 29/41] refs.c: remove the update_ref_write function

2014-06-03 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 v13 25/41] fast-import.c: use a ref transaction when dumping tags

2014-06-03 Thread Ronnie Sahlberg
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 4a7b196..587ef4a 100644 --- a/fast-import.c +++ b/fast-import.c @@ -1735,15 +1735,32 @@

[PATCH v13 39/41] refs.c: propagate any errno==ENOTDIR from _commit back to the callers

2014-06-03 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 v13 41/41] refs.c: make write_ref_sha1 static

2014-06-03 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 | 6 +- refs.h | 3 --- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/refs.c b/refs.c index bcf238e..f8a6c9a 100644 --- a/refs.c +++

[PATCH v13 27/41] refs.c: make lock_ref_sha1 static

2014-06-03 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 | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/refs.c b/refs.c

Re: Reset by checkout?

2014-06-03 Thread Felipe Contreras
Kevin Bracey wrote: Maybe we just need to tighten up the EXAMPLES section? Give it easy-to-locate path/--soft/--mixed/--keep subheadings, covering all those common use cases (in clean trees...), including a before/after git status views. Then normal users could skip the top technical section

Re: [PATCH] receive-pack: optionally deny case-clone refs

2014-06-03 Thread David Turner
On Tue, 2014-06-03 at 14:33 -0700, Junio C Hamano wrote: David Turner dtur...@twopensource.com writes: It is possible to have two branches which are the same but for case. This works great on the case-sensitive filesystems, but not so well on case-insensitive filesystems. It is fairly

Re: [PATCH v5 2/2] refs.c: SSE4.2 optimizations for check_refname_component

2014-06-03 Thread Junio C Hamano
David Turner dtur...@twopensource.com writes: diff --git a/git-compat-util.h b/git-compat-util.h index f6d3a46..254487a 100644 --- a/git-compat-util.h +++ b/git-compat-util.h @@ -668,6 +668,26 @@ void git_qsort(void *base, size_t nmemb, size_t size, #endif #endif +#ifndef NO_SSE42

Re: [PATCH] receive-pack: optionally deny case-clone refs

2014-06-03 Thread Junio C Hamano
David Turner dtur...@twopensource.com writes: I would be happy to add case-clone to the glossary -- would that be OK with you? I do not immediately think of the better term. Somehow case-clone sounds strange, though X-. (Mental note to the reviewer himself) This returns true iff there is

[PATCH v2 0/9] Clarify two uses of remote.*.fetch

2014-06-03 Thread Junio C Hamano
The early part of this has been sent to the list and this round contains updates based on review comments. The new patches at the end clarifies how remote.*.fetch configuration variables are used in two conceptually different ways. We would need a similar update for the git push side, which uses

What's cooking in git.git (Jun 2014, #01; Tue, 3)

2014-06-03 Thread Junio C Hamano
Here are the topics that have been cooking. Commits prefixed with '-' are only in 'pu' (proposed updates) while commits prefixed with '+' are in 'next'. The first batch of topics, all of which have been cooking for quite a while on the 'next' branch, have been merged to 'master'. I'll - merge

[PATCH v2 2/9] fetch doc: move FETCH_HEAD material lower and add an example

2014-06-03 Thread Junio C Hamano
From: Marc Branchaud marcn...@xiplink.com Signed-off-by: Marc Branchaud marcn...@xiplink.com Signed-off-by: Junio C Hamano gits...@pobox.com --- Documentation/git-fetch.txt | 29 + 1 file changed, 21 insertions(+), 8 deletions(-) diff --git

[PATCH v2 1/9] fetch doc: update introductory part for clarity

2014-06-03 Thread Junio C Hamano
- Branches is a more common way to say heads in these days. - Remote-tracking branches are used a lot more these days and it is worth mentioning that it is one of the primary side effects of the command to update them. - Avoid X. That means Y. If Y is easier to understand to

[PATCH v2 4/9] fetch doc: remove notes on outdated mixed layout

2014-06-03 Thread Junio C Hamano
In old days before Git 1.5, it was customery for git fetch to use the same local branch namespace to keep track of the remote-tracking branches, and it was necessary to tell users not to check them out and commit on them. Since everybody uses the separate remote layout these days, there is no

[PATCH v2 3/9] fetch doc: update note on '+' in front of the refspec

2014-06-03 Thread Junio C Hamano
While it is not *wrong* per-se to say that pulling a rewound/rebased branch will lead to an unnecessary merge conflict, that is not what the leading + sign to allow non-fast-forward update of remote-tracking branch is at all. Helped-by: Marc Branchaud marcn...@xiplink.com Signed-off-by: Junio C

[PATCH v2 9/9] fetch: allow explicit --refmap to override configuration

2014-06-03 Thread Junio C Hamano
Since the introduction of opportunisitic updates of remote-tracking branches, started at around f2690487 (fetch: opportunistically update tracking refs, 2013-05-11) with a few updates in v1.8.4 era, the remote.*.fetch configuration always kicks in even when a refspec to specify what to fetch is

[PATCH v2 5/9] fetch doc: on pulling multiple refspecs

2014-06-03 Thread Junio C Hamano
Replace desription of old-style Pull: lines in remotes/ configuration with modern remote.*.fetch variables. As this note applies only to git pull, enable it only in git-pull manual page. Signed-off-by: Junio C Hamano gits...@pobox.com --- Documentation/pull-fetch-param.txt | 12 1

[PATCH v2 8/9] fetch doc: add a section on configured remote-tracking branches

2014-06-03 Thread Junio C Hamano
To resurrect a misleading mention removed in the previous step, add a section to explain how the remote-tracking configuration interacts with the refspecs given as the command-line arguments. Signed-off-by: Junio C Hamano gits...@pobox.com --- Documentation/git-fetch.txt | 43

[PATCH v2 6/9] fetch doc: update refspec format description

2014-06-03 Thread Junio C Hamano
The text made it sound as if the leading plus is the only thing that is optional, and forgot that lhs is the same as lhs:, i.e. fetch it and do not store anywhere. Signed-off-by: Junio C Hamano gits...@pobox.com --- Documentation/pull-fetch-param.txt | 1 + 1 file changed, 1 insertion(+) diff

[PATCH v2 7/9] fetch doc: remove short-cut section

2014-06-03 Thread Junio C Hamano
It is misleading to mention that ref that does not store is to fetch the ref into FETCH_HEAD, because a refspec that does store is also to fetch the LHS into FETCH_HEAD. It is doubly misleading to list it as part of short-cut. ref stands for a refspec that has it on the LHS with a colon and an

Re: [PATCH v13 00/41] Use ref transactions

2014-06-03 Thread Jonathan Nieder
Ronnie Sahlberg wrote: This patch series can also be found at https://github.com/rsahlberg/git/tree/ref-transactions Applies with two minor conflicts on top of a merge of mh/ref-transaction, rs/ref-update-check-errors-early, and rs/reflog-exists. Previously: motivation:

Re: Paper cut bug: Why isn't git clone xxxx recursive by default?

2014-06-03 Thread Mara Kim
That is good to hear. I would be pretty happy about that. ^.^ Obviously any major changes will need to be done carefully. I was thinking of the way that you guys introduced new defaults for Git 2.0, phasing them in slowly through the 1.x cycle. Maybe I can get my hopes up for Git 3.0 --- 9

Re: What's cooking in git.git (Jun 2014, #01; Tue, 3)

2014-06-03 Thread Richard Hansen
On 2014-06-03 18:16, Junio C Hamano wrote: * rh/prompt-tests (2014-05-30) 10 commits - t9904: new __git_ps1 tests for Zsh - lib-prompt-tests.sh: add variable for string that encodes percent in PS1 - lib-prompt-tests.sh: put all tests inside a function - t9903: move prompt tests to a new

Re: [PATCH 4/4] git-ack: record an ack

2014-06-03 Thread Fabian Ruch
Hi Michael, I have some inline comments below. Also, some parts of the patch do not adhere to the style rules - tabs for indentation - $(...) for command substitution - no space after redirection operators - double-quotes around redirection targets for shell scripts (from the file

Kitchen Sale Stirlingshire

2014-06-03 Thread pogopogo
This Forum is probably the best forum that i have ever used and i would just like to say how proud i am to be a member of this forum -- View this message in context: http://git.661346.n2.nabble.com/Kitchen-Sale-Stirlingshire-tp7612292.html Sent from the git mailing list archive at Nabble.com.

Re: [PATCH] receive-pack: optionally deny case-clone refs

2014-06-03 Thread David Turner
On Tue, 2014-06-03 at 15:13 -0700, Junio C Hamano wrote: David Turner dtur...@twopensource.com writes: I would be happy to add case-clone to the glossary -- would that be OK with you? I do not immediately think of the better term. Somehow case-clone sounds strange, though X-. Case

[PATCH v2] receive-pack: optionally deny case clone refs

2014-06-03 Thread David Turner
It is possible to have two branches which are the same but for case. This works great on the case-sensitive filesystems, but not so well on case-insensitive filesystems. It is fairly typical to have case-insensitive clients (Macs, say) with a case-sensitive server (GNU/Linux). Should a user

Re: [PATCH v5 2/2] refs.c: SSE4.2 optimizations for check_refname_component

2014-06-03 Thread David Turner
On Tue, 2014-06-03 at 15:05 -0700, Junio C Hamano wrote: + if (((uintptr_t) vp (PAGE_SIZE - 1)) PAGE_SIZE - BLOCK_SIZE) + /* End-of-page; fall back to slow method for +* this entire component. */ + return

  1   2   >