[PATCH] Document RUN_SETUP_GENTLY

2014-04-28 Thread David Turner
Document RUN_SETUP_GENTLY Signed-off-by: David Turner dtur...@twitter.com --- Documentation/technical/api-builtin.txt | 5 + 1 file changed, 5 insertions(+) diff --git a/Documentation/technical/api-builtin.txt b/Documentation/technical/api-builtin.txt index e3d6e7a..1bbeda2 100644

Bug: Case-insensitive filesystems can cause merge and checkout problems

2014-04-29 Thread David Turner
By default, git sets core.ignorecase=true when git init or git clone is run on a machine with a case-insensitive filesystem. Here's a test-case for some problems that this causes: git checkout master touch TestCase git add TestCase git commit -m 'add TestCase' git checkout -b with-camel touch

[PATCH v2] Document RUN_SETUP_GENTLY

2014-04-29 Thread David Turner
Sorry about that -- the documentation of RUN_SETUP confused me. So I have a new patch that edits that as well. -- RUN_SETUP_GENTLY and improve RUN_SETUP docs Signed-off-by: David Turner dtur...@twitter.com --- Documentation/technical/api-builtin.txt | 13 + 1 file changed, 9

[PATCH] merge-recursive.c: Fix case-changing merge bug

2014-05-01 Thread David Turner
as the new name, the new file would in fact be deleted. We avoid this by not deleting files that have a case-clone in the index at stage 0. Signed-off-by: David Turner dtur...@twitter.com --- merge-recursive.c | 6 ++ t/t7063-merge-ignorecase.sh | 32

RE: Watchman support for git

2014-05-02 Thread David Turner
On Fri, 2014-05-02 at 18:20 -0500, Felipe Contreras wrote: dturner@ wrote: Test repository 1: Linux Linux is about 45k files in 3k directories. The average length of a filename is about 32 bytes. Git status timing: no watchman: 125ms watchman: 90ms That's very interesting.

Re: Watchman support for git

2014-05-02 Thread David Turner
On Sat, 2014-05-03 at 07:52 +0700, Duy Nguyen wrote: On Sat, May 3, 2014 at 6:14 AM, dtur...@twopensource.com wrote: The index format change might be less important with the split index; I haven't investigated that since at the time I wrote these patches, it didn't exist. This is the

Re: Watchman support for git

2014-05-03 Thread David Turner
On Sat, 2014-05-03 at 15:49 +0700, Duy Nguyen wrote: On Sat, May 3, 2014 at 11:39 AM, David Turner dtur...@twopensource.com wrote: Index v4 and split index (and the following read-cache daemon, hopefully) Looking at some of the archives for read-cache daemon, it seems to be somewhat

RE: Watchman support for git

2014-05-05 Thread David Turner
On Fri, 2014-05-02 at 22:40 -0500, Felipe Contreras wrote: David Turner wrote: On Fri, 2014-05-02 at 18:20 -0500, Felipe Contreras wrote: dturner@ wrote: Test repository 1: Linux Linux is about 45k files in 3k directories. The average length of a filename is about 32 bytes

Re: Watchman support for git

2014-05-05 Thread David Turner
On Sun, 2014-05-04 at 07:15 +0700, Duy Nguyen wrote: I would like to merge the feature into master. It works well for me, and some of my colleagues who have tried it out. Have you tried to turn watchman on by default, then run it with git test suite? That usually helps. I have. The

Re: [PATCH] merge-recursive.c: Fix case-changing merge bug

2014-05-06 Thread David Turner
On Tue, 2014-05-06 at 10:07 -0700, Junio C Hamano wrote: David Turner dtur...@twopensource.com writes: On a case-insensitive filesystem, when merging, a file would be wrongly deleted from the working tree if an incoming commit had renamed it changing only its case. When merging a rename

Re: [PATCH 1/3] After chdir to run grep, return to old directory

2014-05-06 Thread David Turner
On Tue, 2014-05-06 at 15:24 -0700, Junio C Hamano wrote: dtur...@twopensource.com writes: From: David Turner dtur...@twitter.com Signed-off-by: David Turner dtur...@twitter.com Ehh, why? Briefly, because otherwise ./t7811-grep-open.sh fails when run under watchman. This is actually

Re: [PATCH 1/3] After chdir to run grep, return to old directory

2014-05-06 Thread David Turner
This causes my test to pass and generally seems correct to me. On Tue, 2014-05-06 at 23:00 -0400, Jeff King wrote: ... That being said, this really seems like something that the run-command interface should be doing, since it can handle the chdir in the forked child. And indeed, it seems to

Re: [PATCH 2/2] ignorecase: Fix git mv on insensitive filesystems

2014-05-07 Thread David Turner
On Wed, 2014-05-07 at 08:17 +0200, Johannes Sixt wrote: } else if (cache_name_pos(src, length) 0) bad = _(not under version control); - else if (lstat(dst, st) == 0) { + else if (lstat(dst, dst_st) == 0 +

Re: [PATCH 2/2] ignorecase: Fix git mv on insensitive filesystems

2014-05-07 Thread David Turner
On Wed, 2014-05-07 at 10:46 -0700, Junio C Hamano wrote: David Turner dtur...@twopensource.com writes: On Wed, 2014-05-07 at 08:17 +0200, Johannes Sixt wrote: } else if (cache_name_pos(src, length) 0) bad = _(not under version control

Re: [PATCH 1/3] After chdir to run grep, return to old directory

2014-05-07 Thread David Turner
On Wed, 2014-05-07 at 10:42 -0700, Junio C Hamano wrote: David Turner dtur...@twopensource.com writes: This causes my test to pass and generally seems correct to me. Yes, this approach is very sensible, and I'll queue. But watchman support _should_ be prepared for a program that does

Re: [PATCH 2/2] ignorecase: Fix git mv on insensitive filesystems

2014-05-08 Thread David Turner
On Thu, 2014-05-08 at 12:54 -0700, Junio C Hamano wrote: dtur...@twopensource.com writes: From: David Turner dtur...@twitter.com Make it possible to change the case of a filename on a case-insensitive filesystem using git mv. Change git mv to allow moves where the destination file

Re: Watchman support for git

2014-05-09 Thread David Turner
On Fri, 2014-05-09 at 00:08 -0700, David Lang wrote: On Thu, 8 May 2014, Sebastian Schuberth wrote: On 03.05.2014 05:40, Felipe Contreras wrote: That's very interesting. Do you get similar improvements when doing something similar in Merurial (watchman vs . no watchman). I have not

Re: Watchman support for git

2014-05-09 Thread David Turner
On Fri, 2014-05-09 at 11:08 -0700, David Lang wrote: On Fri, 9 May 2014, David Turner wrote: On Fri, 2014-05-09 at 00:08 -0700, David Lang wrote: On Thu, 8 May 2014, Sebastian Schuberth wrote: On 03.05.2014 05:40, Felipe Contreras wrote: That's very interesting. Do you get similar

Re: Watchman support for git

2014-05-09 Thread David Turner
On Fri, 2014-05-09 at 11:27 -0700, David Lang wrote: That's not my understanding from Durham Goode's talk in January. Yes, operations involving history go to the server. But the client also maintains a copy of the working tree, and it is for this that watchman is used. Otherwise, why

Re: Watchman support for git

2014-05-10 Thread David Turner
On Sat, 2014-05-10 at 12:26 +0700, Duy Nguyen wrote: On Sat, May 3, 2014 at 6:14 AM, dtur...@twopensource.com wrote: The most sigificant patch uses Facebook's watchman daemon[1] to monitor the repository work tree for changes. This makes allows git status to avoid traversing the entire

Re: Watchman support for git

2014-05-11 Thread David Turner
On Sun, 2014-05-11 at 07:21 +0700, Duy Nguyen wrote: On Sun, May 11, 2014 at 1:38 AM, David Turner dtur...@twopensource.com wrote: I got warning: Watchman watch error: Got bad JSON from watchman get-sockname: '[' or '{' expected near end of file. Any ideas what I did wrong? I'm using

Re: Watchman support for git

2014-05-13 Thread David Turner
On Mon, 2014-05-12 at 17:45 +0700, Duy Nguyen wrote: This is your quote from above, moved down a bit: update_fs_cache should only have to update based on what it has learned from watchman. So if no .gitignore has been changed, it should not have to do very much work. I could take the

Re: Watchman support for git

2014-05-13 Thread David Turner
On Wed, 2014-05-14 at 05:54 +0700, Duy Nguyen wrote: On Wed, May 14, 2014 at 5:38 AM, David Turner dtur...@twopensource.com wrote: On Mon, 2014-05-12 at 17:45 +0700, Duy Nguyen wrote: This is your quote from above, moved down a bit: update_fs_cache should only have to update based

Re: Watchman support for git

2014-05-13 Thread David Turner
On Sat, 2014-05-10 at 15:16 +0700, Duy Nguyen wrote: On Sat, May 3, 2014 at 6:14 AM, dtur...@twopensource.com wrote: The most sigificant patch uses Facebook's watchman daemon[1] to monitor the repository work tree for changes. This makes allows git status to avoid traversing the entire

Re: Watchman support for git

2014-05-15 Thread David Turner
On Wed, 2014-05-14 at 17:36 +0700, Duy Nguyen wrote: With that in mind, I think you don't need to keep a fs cache on disk at all. All you need to store (in the index) is the clock value from watchman. After we parse the index, we perform a since query to get path names (and perhaps

Re: [PATCH 01/22] refs.c: create a public function for is_refname_available

2014-08-08 Thread David Turner
On Fri, 2014-08-08 at 09:44 -0700, Ronnie Sahlberg wrote: + * Check is a particular refname is available for creation. skip contains s/Check is/Check that/' + * a list of refnames to exclude from the refname collission tests. collision + */ +int is_refname_available(const char *refname,

Re: [PATCH 17/22] refs.c: add a backend method structure with transaction functions

2014-08-08 Thread David Turner
On Fri, 2014-08-08 at 09:45 -0700, Ronnie Sahlberg wrote: +struct ref_be refs_files = { + .transaction_begin = files_transaction_begin, + .transaction_update_sha1= files_transaction_update_sha1, + .transaction_create_sha1=

Re: [PATCH v4 0/1] receive-pack: optionally deny case clone refs

2014-08-13 Thread David Turner
On Wed, 2014-08-13 at 09:20 -0700, Ronnie Sahlberg wrote: David, One possible solution can be to use the external database daemon I am working of for ref transactions. Since this makes all refs be stored in a dedicated database instead of the filesystem you no longer are dependent on file

Re: [PATCH 16/18] receive-pack: GPG-validate push certificates

2014-08-20 Thread David Turner
On Tue, 2014-08-19 at 15:06 -0700, Junio C Hamano wrote: Reusing the GPG signature check helpers we already have, verify the signature in receive-pack and give the results to the hooks via GIT_PUSH_CERT_{SIGNER,KEY,STATUS} environment variables. Policy decisions, such as accepting or

Re: [PATCH 16/18] receive-pack: GPG-validate push certificates

2014-08-20 Thread David Turner
On Wed, 2014-08-20 at 10:29 -0700, Junio C Hamano wrote: On Wed, Aug 20, 2014 at 9:56 AM, David Turner dtur...@twopensource.com wrote: On Tue, 2014-08-19 at 15:06 -0700, Junio C Hamano wrote: Reusing the GPG signature check helpers we already have, verify the signature in receive-pack

Re: [PATCH 16/18] receive-pack: GPG-validate push certificates

2014-08-21 Thread David Turner
On Wed, 2014-08-20 at 12:38 -0700, Junio C Hamano wrote: David Turner dtur...@twopensource.com writes: On Wed, 2014-08-20 at 10:29 -0700, Junio C Hamano wrote: On Wed, Aug 20, 2014 at 9:56 AM, David Turner dtur...@twopensource.com wrote: On Tue, 2014-08-19 at 15:06 -0700, Junio C

Re: [PATCH 18/18] signed push: final protocol update

2014-08-21 Thread David Turner
On Tue, 2014-08-19 at 15:06 -0700, Junio C Hamano wrote: +If the receiving end does not support push-cert, the sending end MUST +NOT send a push-cert command. + +When a push-cert command is sent, command-list MUST NOT be sent; the +commands recorded in the push certificate is used instead.

mktree: multiple same-named objects

2014-08-26 Thread David Turner
git mktree seems to allow the creation of a tree object with multiple objects of the same name but different SHAs. This leads to weird behavior later, unsurprisingly. For instance, if there are two tree objects with the same name but different SHAs, the checked out tree will be the union of them

Re: mktree: multiple same-named objects

2014-08-27 Thread David Turner
On Wed, 2014-08-27 at 12:01 +0700, Duy Nguyen wrote: On Wed, Aug 27, 2014 at 11:41 AM, David Turner dtur...@twopensource.com wrote: Summary: git mktree ought to forbid this, and possibly there ought to be other checks (for instance, when unpacking) to prevent this. Does fsck detect

git fsck exit code?

2014-08-27 Thread David Turner
It looks like git fsck exits with 0 status even if there are some errors. The only case where there's a non-zero exit code is if verify_pack reports errors -- but not e.g. fsck_object_dir. Is that really the intended behavior? I think it would be nice to at least support --exit-code (but

Re: revert top most commit

2014-08-27 Thread David Turner
On Wed, 2014-08-27 at 21:14 +, Keller, Jacob E wrote: Hi, I am having trouble using revert. If I attempt to $ git revert sha1id where sha1id is the same as the HEAD commit, I instead get the output of what looks like git status. Is there anything specific about git revert that

Re: git fsck exit code?

2014-09-01 Thread David Turner
On Sun, 2014-08-31 at 20:54 +0200, Øyvind A. Holm wrote: On 29 August 2014 22:18, David Turner dtur...@twopensource.com wrote: On Fri, 2014-08-29 at 12:21 -0700, Junio C Hamano wrote: Jeff King p...@peff.net writes: On Wed, Aug 27, 2014 at 06:10:12PM -0400, David Turner wrote

git reset for index restoration?

2014-05-22 Thread David Turner
If I have a git repository with a clean working tree, and I delete the index, then I can use git reset (with no arguments) to recreate it. However, when I do recreate it, it doesn't come back the same. I have not analyzed this in detail, but the effect is that commands like git status take much

Re: [PATCH 8/8] read-cache: inform the daemon that the index has been updated

2014-05-22 Thread David Turner
On Tue, 2014-05-13 at 18:15 +0700, Nguyễn Thái Ngọc Duy wrote: + if (run_command(cp)) + warning(_(failed to start read-cache--daemon: %s), + strerror(errno)); errno is not always (ever?) set, so if read-cache--daemon is missing, you

Re: git reset for index restoration?

2014-05-22 Thread David Turner
On Thu, 2014-05-22 at 12:46 -0400, Jeff King wrote: On Thu, May 22, 2014 at 12:22:43PM -0400, David Turner wrote: If I have a git repository with a clean working tree, and I delete the index, then I can use git reset (with no arguments) to recreate it. However, when I do recreate

Re: git reset for index restoration?

2014-05-22 Thread David Turner
On Thu, 2014-05-22 at 09:46 -0700, Elijah Newren wrote: On Thu, May 22, 2014 at 9:22 AM, David Turner dtur...@twopensource.com wrote: If I have a git repository with a clean working tree, and I delete the index, then I can use git reset (with no arguments) to recreate it. However, when I

Re: git reset for index restoration?

2014-05-22 Thread David Turner
On Thu, 2014-05-22 at 14:39 -0400, Jeff King wrote: does show some improvement. Perhaps git reset is not writing out the cache-tree extension? Yes, that seems to be exactly what is going on; the two indexes are identical up to the point where the TREE extension appears. Thanks for clearing

Re: git reset for index restoration?

2014-05-22 Thread David Turner
On Thu, 2014-05-22 at 14:23 -0400, Jeff King wrote: On Thu, May 22, 2014 at 02:08:16PM -0400, David Turner wrote: On Thu, 2014-05-22 at 12:46 -0400, Jeff King wrote: On Thu, May 22, 2014 at 12:22:43PM -0400, David Turner wrote: If I have a git repository with a clean working tree

Re: git reset for index restoration?

2014-05-22 Thread David Turner
On Thu, 2014-05-22 at 14:34 -0700, Junio C Hamano wrote: Jeff King p...@peff.net writes: [+cc Junio for cache-tree expertise] ... We never call reset_index now, because we handle it via diff. We could call prime_cache_tree in this case, but I'm not sure if that is a good idea,

Re: git reset for index restoration?

2014-05-22 Thread David Turner
On Thu, 2014-05-22 at 15:29 -0700, Junio C Hamano wrote: Junio C Hamano gits...@pobox.com writes: But at least my understanding has been that git commit (no partial commit, write the whole index as a commit) which uses the git write-tree machinery knows which subtree has what tree object

Re: git reset for index restoration?

2014-05-22 Thread David Turner
On Fri, 2014-05-23 at 06:33 +0700, Duy Nguyen wrote: On Fri, May 23, 2014 at 5:18 AM, Junio C Hamano gits...@pobox.com wrote: ... and the incrementally repair Peff talks about would be to cover more cases where we may know (either because we have already computed it to write out a subtree,

RFC: optionally reject case-clone branch names

2014-05-27 Thread David Turner
At present, 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).

Re: RFC: optionally reject case-clone branch names

2014-05-28 Thread David Turner
On Wed, 2014-05-28 at 10:14 -0700, Junio C Hamano wrote: David Turner dtur...@twopensource.com writes: RFC follows: 1. On a case-insensitive server, git receive-pack ought to always reject branches which are same-but-for-case of existing branches. 2. On a case-sensitive server

[PATCH] check_refname_component: Optimize

2014-05-28 Thread David Turner
for machines without. The speedup for this command on one particular repo (with about 60k refs) is about 12% for the SSE version and 8% for the non-SSE version. Signed-off-by: David Turner dtur...@twitter.com --- Makefile | 6 +++ configure.ac | 6 +++ refs.c | 143

[PATCH] check_refname_component: Optimize

2014-05-28 Thread David Turner
for machines without. The speedup for this command on one particular repo (with about 60k refs) is about 12% for the SSE version and 8% for the non-SSE version. Signed-off-by: David Turner dtur...@twitter.com --- Makefile | 6 +++ configure.ac | 6 +++ refs.c | 152

[PATCH v2 0/1] check_refname_component: Optimize

2014-05-28 Thread David Turner
I just tested the previous patch on a Mac with clang and it needed some tweaks. Also, I should clarify that this represents a real use-case: we really do have tens of thousands of branches on some repos. It would be nice if people would clean up after themselves, but they don't. (Also, it's

Re: [PATCH] check_refname_component: Optimize

2014-05-28 Thread David Turner
On Wed, 2014-05-28 at 23:44 +0200, Michael Haggerty wrote: On 05/28/2014 11:04 PM, David Turner wrote: In a repository with tens of thousands of refs, the command ~/git/git-diff-index --cached --quiet --ignore-submodules [revision] is a bit slow. check_refname_component is a major

[PATCH v3] refs.c: optimize check_refname_component()

2014-05-28 Thread David Turner
repo, with about 60k refs, almost all packed, are: Old: 35ms New (no SSE): 29 ms New (SSE): 25 ms Many other commands which read refs are also sped up. Add some tests around 16-byte boundaries to ensure that the SSE code correctly handles edge-cases. Signed-off-by: David Turner dtur

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

2014-05-31 Thread David Turner
are also sped up. Signed-off-by: David Turner dtur...@twitter.com --- refs.c | 68 -- 1 file changed, 41 insertions(+), 27 deletions(-) diff --git a/refs.c b/refs.c index 28d5eca..62e2301 100644 --- a/refs.c +++ b/refs.c @@ -5,9

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

2014-05-31 Thread David Turner
This is about a 15% improvement. The configure.ac changes include code from the GNU C Library written by Joseph S. Myers joseph at codesourcery dot com. Signed-off-by: David Turner dtur...@twitter.com --- Makefile | 6 +++ aclocal.m4 | 6 +++ configure.ac | 17 git

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

2014-06-02 Thread David Turner
are also sped up. Signed-off-by: David Turner dtur...@twitter.com --- refs.c | 67 +++--- t/t5511-refspec.sh | 6 - 2 files changed, 44 insertions(+), 29 deletions(-) diff --git a/refs.c b/refs.c index 28d5eca..dd28f2a 100644

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

2014-06-02 Thread David Turner
This is about a 15% improvement. The configure.ac changes include code from the GNU C Library written by Joseph S. Myers joseph at codesourcery dot com. Signed-off-by: David Turner dtur...@twitter.com --- Makefile | 6 +++ aclocal.m4 | 6 +++ configure.ac | 17 git

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

2014-06-03 Thread David Turner
This is about a 15% improvement. The configure.ac changes include code from the GNU C Library written by Joseph S. Myers joseph at codesourcery dot com. Signed-off-by: David Turner dtur...@twitter.com --- Makefile | 6 +++ aclocal.m4 | 6 +++ configure.ac | 17 git

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

2014-06-03 Thread David Turner
are also sped up. Signed-off-by: David Turner dtur...@twitter.com --- refs.c | 67 +++--- t/t5511-refspec.sh | 6 - 2 files changed, 44 insertions(+), 29 deletions(-) diff --git a/refs.c b/refs.c index 28d5eca..46139d2 100644

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

2014-06-03 Thread David Turner
branch. This setting is turned on by default if core.ignorecase is set, but not otherwise. Signed-off-by: David Turner dtur...@twitter.com --- builtin/receive-pack.c | 29 - t/t5400-send-pack.sh | 20 2 files changed, 48 insertions(+), 1

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] 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
branch. This setting is turned on by default if core.ignorecase is set, but not otherwise. Signed-off-by: David Turner dtur...@twitter.com --- Documentation/config.txt | 6 ++ Documentation/git-push.txt | 5 +++-- Documentation/glossary-content.txt | 5 + builtin

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

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

2014-06-03 Thread David Turner
are also sped up. Signed-off-by: David Turner dtur...@twitter.com --- refs.c | 67 +++--- t/t5511-refspec.sh | 6 - 2 files changed, 44 insertions(+), 29 deletions(-) diff --git a/refs.c b/refs.c index 28d5eca..46139d2 100644

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

2014-06-03 Thread David Turner
This is about a 15% improvement. The configure.ac changes include code from the GNU C Library written by Joseph S. Myers joseph at codesourcery dot com. Signed-off-by: David Turner dtur...@twitter.com --- Makefile | 6 +++ aclocal.m4 | 6 +++ configure.ac | 17 git

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

2014-06-04 Thread David Turner
On Wed, 2014-06-04 at 08:06 +0200, Johannes Sixt wrote: +receive.denyCaseCloneBranches:: + If set to true, git-receive-pack will deny a ref update that creates + a ref which is the same but for case as an existing ref. This is + useful when clients are on a case-insensitive

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

2014-06-04 Thread David Turner
On Wed, 2014-06-04 at 10:04 +0200, Torsten Bögershausen wrote: [snip discussion of compiler flags; I'll look into a cpuid approach] --- a/git-compat-util.h +++ b/git-compat-util.h @@ -668,6 +668,28 @@ void git_qsort(void *base, size_t nmemb, size_t size, #endif #endif +#ifndef

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

2014-06-04 Thread David Turner
On Wed, 2014-06-04 at 16:25 +0200, Torsten Bögershausen wrote: On the other hand, looking here: http://sourceware.org/ml/libc-alpha/2009-10/msg00063.html and looking into refs.c, it seems as if we can try to run strcspn(refname, bad_characters) and strstr(refname, @{ and

Git autocorrect bug

2014-06-04 Thread David Turner
$ cd [some existing git repo] $ git git foo WARNING: You called a Git command named 'git', which does not exist. Continuing under the assumption that you meant 'init' in 0.1 seconds automatically... fatal: internal error: work tree has already been set Current worktree: /home/dturner/git New

Re: Git autocorrect bug

2014-06-05 Thread David Turner
On Thu, 2014-06-05 at 13:29 +0700, Duy Nguyen wrote: On Thu, Jun 5, 2014 at 10:49 AM, David Turner dtur...@twopensource.com wrote: fatal: internal error: work tree has already been set Current worktree: /home/dturner/git New worktree: /home/dturner/git/foo This is the part you complain

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

2014-06-05 Thread David Turner
On Thu, 2014-06-05 at 14:30 +0200, Torsten Bögershausen wrote: On 2014-06-04 23.16, David Turner wrote: Sure! I actually went with 120k to make measurement easier: https://github.com/dturner-tw/many-refs Hm, I didn't get so man git remote -v origin https://github.com/dturner-tw

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

2014-06-05 Thread David Turner
On Wed, 2014-06-04 at 14:46 -0700, Junio C Hamano wrote: David Turner dtur...@twopensource.com writes: On Wed, 2014-06-04 at 10:04 +0200, Torsten Bögershausen wrote: [snip discussion of compiler flags; I'll look into a cpuid approach] H, I am not sure if the complexity is really

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

2014-06-05 Thread David Turner
On Thu, 2014-06-05 at 23:42 +0200, Torsten Bögershausen wrote: On 2014-06-05 21.26, David Turner wrote: On Thu, 2014-06-05 at 14:30 +0200, Torsten Bögershausen wrote: On 2014-06-04 23.16, David Turner wrote: Sure! I actually went with 120k to make measurement easier: https

[PATCH v7 0/1] refs.c: SSE4.2 optimizations for check_refname_component

2014-06-05 Thread David Turner
Since Junio has picked up the first patch from previous versions of this series, I'm just going to send the second (SSE) one. I decided not to s/NO_SSE42/!HAVE_SSE42/ because it looks like git mostly uses the former convention (for instance, that's what GIT_PARSE_WITH generates). Thanks for all

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

2014-06-05 Thread David Turner
This is about a 15% improvement. The configure.ac changes include code from the GNU C Library written by Joseph S. Myers joseph at codesourcery dot com. Only supports GCC and Clang at present, because C interfaces to the cpuid instruction are not well-standardized. Signed-off-by: David Turner dtur

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

2014-06-05 Thread David Turner
is turned on by default if core.ignorecase is set, but not otherwise. Signed-off-by: David Turner dtur...@twitter.com --- Documentation/config.txt | 6 + Documentation/git-push.txt | 5 +++-- Documentation/glossary-content.txt | 5 + builtin/receive-pack.c

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

2014-06-05 Thread David Turner
On Fri, 2014-06-06 at 08:37 +0700, Duy Nguyen wrote: On Fri, Jun 6, 2014 at 7:52 AM, David Turner dtur...@twopensource.com wrote: Create the option receive.denycaseclonerefs, which checks pushed refs to ensure that they are not case clones of an existing ref. This setting is turned

Re: [PATCH v7 0/1] refs.c: SSE4.2 optimizations for check_refname_component

2014-06-09 Thread David Turner
On Mon, 2014-06-09 at 15:16 -0700, Junio C Hamano wrote: David Turner dtur...@twopensource.com writes: Since Junio has picked up the first patch from previous versions of this series, I'm just going to send the second (SSE) one. I decided not to s/NO_SSE42/!HAVE_SSE42/ because it looks

Re: [PATCH 2/5] index-helper: new daemon for caching index and related stuff

2014-06-10 Thread David Turner
On Tue, 2014-06-10 at 20:24 +0700, Nguyễn Thái Ngọc Duy wrote: + loop(sb.buf, 600); ... + if (st-st_mtime + 600 time(NULL)) s/600/INDEX_HELPER_TIMEOUT/ or something. + return; /* don't try to read from stale .pid file */ + + fd =

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

2014-06-11 Thread David Turner
is turned on by default if core.ignorecase is set, but not otherwise. Signed-off-by: David Turner dtur...@twitter.com --- Documentation/config.txt | 6 ++ Documentation/git-push.txt | 5 +- Documentation/glossary-content.txt | 9 +++ builtin/receive-pack.c | 147

[PATCH v4 0/1] receive-pack: optionally deny case clone refs

2014-06-11 Thread David Turner
This issue bit us again recently. In talking with some colleagues, I realized that the previous version of this patch, in addition to being potentially slow, was incomplete. Specifically, it didn't handle the case of refs/heads/case/one vs refs/heads/CASE/two; these are case clones even though

Re: [PATCH v4 0/1] receive-pack: optionally deny case clone refs

2014-06-12 Thread David Turner
On Thu, 2014-06-12 at 12:47 -0700, Junio C Hamano wrote: David Turner dtur...@twopensource.com writes: This issue bit us again recently. In talking with some colleagues, I realized that the previous version of this patch, in addition to being potentially slow, was incomplete

Re: [PATCH v7 0/1] refs.c: SSE4.2 optimizations for check_refname_component

2014-06-12 Thread David Turner
On Tue, 2014-06-10 at 08:04 +0200, Johannes Sixt wrote: Am 6/10/2014 1:05, schrieb Junio C Hamano: Junio C Hamano gits...@pobox.com writes: David Turner dtur...@twopensource.com writes: Since Junio has picked up the first patch from previous versions of this series, I'm just going

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

2014-06-14 Thread David Turner
On Sat, 2014-06-14 at 17:22 +0200, Ondřej Bílka wrote: On Thu, Jun 05, 2014 at 07:56:15PM -0400, David Turner wrote: 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

Re: [PATCH v4 0/1] receive-pack: optionally deny case clone refs

2014-06-15 Thread David Turner
On Fri, 2014-06-13 at 12:05 -0700, Ronnie Sahlberg wrote: Thinking about it more. I think we want to wait until the ref transaction API work is finished. The ref transactions API is in progress and it aims to add transactions for ref updates as a first step but then it aims to define a

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

2014-06-16 Thread David Turner
. Signed-off-by: David Turner dtur...@twitter.com --- git-compat-util.h | 10 +++ refs.c | 244 + t/t5511-refspec.sh | 19 + 3 files changed, 239 insertions(+), 34 deletions(-) diff --git a/git-compat-util.h b/git-compat-util.h

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

2014-06-16 Thread David Turner
On Mon, 2014-06-16 at 17:06 -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

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

2014-06-16 Thread David Turner
. Signed-off-by: David Turner dtur...@twitter.com --- git-compat-util.h | 11 +++ refs.c | 223 - t/t5511-refspec.sh | 20 + 3 files changed, 236 insertions(+), 18 deletions(-) diff --git a/git-compat-util.h b/git-compat-util.h

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

2014-06-17 Thread David Turner
% off of the runtime. Ondřej Bílka nel...@seznam.cz suggested an SSE2 approach to the substring searches, which netted a speed boost over the SSE4.2 code I had initially written. Signed-off-by: David Turner dtur...@twitter.com --- git-compat-util.h | 11 +++ refs.c | 223

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

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

2014-06-17 Thread David Turner
% off of the runtime. Ondřej Bílka nel...@seznam.cz suggested an SSE2 approach to the substring searches, which netted a speed boost over the SSE4.2 code I had initially written. Signed-off-by: David Turner dtur...@twitter.com --- git-compat-util.h | 11 +++ refs.c

Re: Git-status / preload_index() performance

2014-06-24 Thread David Turner
On Wed, 2014-06-25 at 00:52 +0200, Karsten Blees wrote: Even more time is spent unpacking the HEAD tree, even with hot cache (repacking with depth 10 reduces this to ~250ms, on SSD its just 7ms). Perhaps caching the HEAD tree in an index extension could help here? This is approximately what

Re: Feature request: git commit -A

2014-06-24 Thread David Turner
On Tue, 2014-06-24 at 15:01 -0400, Aidan Feldman wrote: Hi all- I work on the education team at GitHub and do a fair number of Git workshops. One thing that I've always found difficult to explain to newbies is how the staging area works, and why it's useful. As a hand-wave to simplify

[PATCH 3/3] cache-tree: Write index with updated cache-tree after commit

2014-06-27 Thread David Turner
During the commit process, the cache-tree is updated. We need to write this updated cache-tree so that it's ready for subsequent commands. Add test code which demonstrates that git commit now writes the cache tree. Also demonstrate that cache-tree invalidation is correct. Signed-off-by: David

[PATCH 2/3] test-dump-cache-tree: Improve output format and exit code

2014-06-27 Thread David Turner
Make test-dump-cache-tree more useful for testing. Do not treat known invalid trees as errors (and do not produce non-zero exit code), because we can fall back to the non-cache-tree codepath. Signed-off-by: David Turner dtur...@twitter.com --- t/t0090-cache-tree.sh | 28

[PATCH 1/3] cache-tree: Create/update cache-tree on checkout

2014-06-27 Thread David Turner
When git checkout checks out a branch, create or update the cache-tree so that subsequent operations are faster. Signed-off-by: David Turner dtur...@twitter.com --- builtin/checkout.c| 4 cache-tree.c | 22 -- cache-tree.h | 1 + t/t0090-cache

[PATCH 1/3] cache-tree: Create/update cache-tree on checkout

2014-06-30 Thread David Turner
When git checkout checks out a branch, create or update the cache-tree so that subsequent operations are faster. Signed-off-by: David Turner dtur...@twitter.com --- builtin/checkout.c| 8 cache-tree.c | 5 +++-- t/t0090-cache-tree.sh | 15 ++- 3 files changed

[PATCH 2/3] test-dump-cache-tree: Improve output format and exit code

2014-06-30 Thread David Turner
Make test-dump-cache-tree more useful for testing. Do not treat known invalid trees as errors (and do not produce non-zero exit code), because we can fall back to the non-cache-tree codepath. Signed-off-by: David Turner dtur...@twitter.com --- t/t0090-cache-tree.sh | 28

  1   2   3   4   5   6   7   8   9   10   >