RE: [PATCH v4] Add git-grep threads param

2015-11-09 Thread Victor Leschuk
Correct. I think adding the option (both to command line and to config file) is good, as long as the IO issues are documented. And default to just the fixed number of threads for now - and with the option, maybe people can then more easily try out different scenarios and maybe improve on the

[PATCH v4 03/12] add_sought_entry_mem: convert to struct object_id

2015-11-09 Thread brian m. carlson
Convert this function to use struct object_id. Express several hardcoded constants in terms of GIT_SHA1_HEXSZ. Signed-off-by: brian m. carlson --- builtin/fetch-pack.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git

[PATCH v4 02/12] Convert struct ref to use object_id.

2015-11-09 Thread brian m. carlson
Use struct object_id in three fields in struct ref and convert all the necessary places that use it. Signed-off-by: brian m. carlson --- builtin/clone.c| 16 +++--- builtin/fetch-pack.c | 4 ++-- builtin/fetch.c| 50

[PATCH v4 09/12] Add several uses of get_object_hash.

2015-11-09 Thread brian m. carlson
Convert most instances where the sha1 member of struct object is dereferenced to use get_object_hash. Most instances that are passed to functions that have versions taking struct object_id, such as get_sha1_hex/get_oid_hex, or instances that can be trivially converted to use struct object_id

[PATCH v4 05/12] get_remote_heads: convert to struct object_id

2015-11-09 Thread brian m. carlson
Replace an unsigned char array with struct object_id and express several hard-coded constants in terms of GIT_SHA1_HEXSZ. Signed-off-by: brian m. carlson --- connect.c | 22 -- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git

[PATCH v4 11/12] Remove get_object_hash.

2015-11-09 Thread brian m. carlson
Convert all instances of get_object_hash to use an appropriate reference to the hash member of the oid member of struct object. This provides no functional change, as it is essentially a macro substitution. Signed-off-by: brian m. carlson --- The script used to do

[PATCH v4 01/12] sha1_file: introduce has_object_file helper.

2015-11-09 Thread brian m. carlson
Add has_object_file, which is a wrapper around has_sha1_file, but for struct object_id. Signed-off-by: brian m. carlson --- cache.h | 3 +++ sha1_file.c | 5 + 2 files changed, 8 insertions(+) diff --git a/cache.h b/cache.h index 3ba0b8f3..27bc121b 100644

[PATCH v4 06/12] push_refs_with_export: convert to struct object_id

2015-11-09 Thread brian m. carlson
Signed-off-by: brian m. carlson --- transport-helper.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/transport-helper.c b/transport-helper.c index 91cb0e72..0eb3cf01 100644 --- a/transport-helper.c +++ b/transport-helper.c @@ -878,13

[PATCH v4 07/12] ref_newer: convert to use struct object_id

2015-11-09 Thread brian m. carlson
Convert ref_newer and its caller to use struct object_id instead of unsigned char *. Signed-off-by: brian m. carlson --- builtin/remote.c | 2 +- http-push.c | 4 ++-- remote.c | 8 remote.h | 2 +- 4 files changed, 8 insertions(+), 8

[PATCH v4 12/12] remote: convert functions to struct object_id

2015-11-09 Thread brian m. carlson
Convert several unsigned char arrays to use struct object_id instead, and change hard-coded 40-based constants to use GIT_SHA1_HEXSZ as well. Signed-off-by: brian m. carlson --- remote.c | 58 +- 1 file

[PATCH v4 04/12] parse_fetch: convert to use struct object_id

2015-11-09 Thread brian m. carlson
Convert the parse_fetch function to use struct object_id. Remove the strlen check as get_oid_hex will fail safely on receiving a too-short NUL-terminated string. Signed-off-by: brian m. carlson --- remote-curl.c | 12 ++-- 1 file changed, 6 insertions(+),

[PATCH v4 08/12] object: introduce get_object_hash macro.

2015-11-09 Thread brian m. carlson
This macro is a temporary change to ease the transition of struct object to use struct object_id. It takes an argument of struct object and returns the object's hash. Provide this hash next to struct object for easier conversion. Signed-off-by: brian m. carlson

Re: [PATCH] git-svn: improve rebase/mkdirs performance

2015-11-09 Thread Eric Wong
Dair Grant wrote: > This takes 10 minutes to process when using a single hash, vs > 3 seconds with a hash of hashes. > > Signed-off-by: Dair Grant Thanks! I've made some minor edits, will push the following out to

RE: [PATCH v4] Add git-grep threads param

2015-11-09 Thread Victor Leschuk
> if (list.nr || cached) >num_threads = 1; > if (!num_threads) > num_threads = GREP_NUM_THREADS_DEFAULT; > and then later, instead of use_threads, do: > if (num_threads <= 1) { ... do single-threaded version ... > } else { ... do multi-threaded version

Re: [PATCH v4] Add git-grep threads param

2015-11-09 Thread Jeff King
On Mon, Nov 09, 2015 at 09:55:34AM -0800, Linus Torvalds wrote: > > if (list.nr || cached ) > > num_threads = 0; // do not use threads > > else if (num_threads == 0) > > num_threads = online_cpus() <= 1 ? 0 : GREP_NUM_THREADS_DEFAULT; > > I will say this AGAIN. > > The number of threads is

Re: [PATCH v4] Add git-grep threads param

2015-11-09 Thread Stefan Beller
On Mon, Nov 9, 2015 at 9:55 AM, Linus Torvalds wrote: > > So stop with the "online_cpus()" stuff. And don't base your benchmarks > purely on the CPU-bound case. Because the CPU-bound case is the case > that is already generally so good that few people will care all

Re: [PATCH v7 01/11] refs: make is_branch public

2015-11-09 Thread Ramsay Jones
On 09/11/15 17:03, Michael Haggerty wrote: > From: David Turner > > is_branch was already non-static, but this patch declares it in the > header. > > Signed-off-by: Ronnie Sahlberg > Signed-off-by: David Turner >

Re: [PATCH v4] Add git-grep threads param

2015-11-09 Thread Jeff King
On Mon, Nov 09, 2015 at 08:34:27AM -0800, Victor Leschuk wrote: > > Why don't we leave it at 8, then? That's the conservative choice, and > > once we have --threads, people can easily experiment with different > > values and we can follow-up with a change to the default if need be. > > I'd

[PATCH] t5813: avoid creating urls that break on cygwin

2015-11-09 Thread Dennis Kaarsemaker
When passed an ssh:// url, git strips ssh://host from the url but does not remove leading slashes from the path. So when this test used ssh://remote//path/to/pwd, the path accessed by our fake SSH is //path/to/pwd, which cygwin interprets as a UNC path, causing the test to fail. We may want to

Re: [PATCH v4] Add git-grep threads param

2015-11-09 Thread Linus Torvalds
On Mon, Nov 9, 2015 at 10:32 AM, Victor Leschuk wrote: > On Mon, Nov 9, 2015 at 9:28 AM, Victor Leschuk >> num_threads = online_cpus() <= 1 ? 0 : GREP_NUM_THREADS_DEFAULT; > > Actually I have never said the nCPUs played main role in it. T The pseudo-code you sent

Re: [PATCH] t5813: avoid creating urls that break on cygwin

2015-11-09 Thread Jeff King
On Mon, Nov 09, 2015 at 06:49:35PM +0100, Dennis Kaarsemaker wrote: > When passed an ssh:// url, git strips ssh://host from the url but does > not remove leading slashes from the path. So when this test used > ssh://remote//path/to/pwd, the path accessed by our fake SSH is > //path/to/pwd, which

Re: [PATCH v4] Add git-grep threads param

2015-11-09 Thread Linus Torvalds
On Mon, Nov 9, 2015 at 9:28 AM, Victor Leschuk wrote: > > Maybe use the simplest version (and keep num_numbers == 0 also as flag for > all other checks in code like if(num_flags) ): > > if (list.nr || cached ) > num_threads = 0; // do not use threads > else if

Re: [PATCH v4] Add git-grep threads param

2015-11-09 Thread Jeff King
On Mon, Nov 09, 2015 at 09:28:12AM -0800, Victor Leschuk wrote: > Maybe use the simplest version (and keep num_numbers == 0 also as flag for > all other checks in code like if(num_flags) ): > > if (list.nr || cached ) > num_threads = 0; // do not use threads > else if (num_threads == 0)

RE: [PATCH v4] Add git-grep threads param

2015-11-09 Thread Victor Leschuk
On Mon, Nov 9, 2015 at 9:28 AM, Victor Leschuk wrote: > > Maybe use the simplest version (and keep num_numbers == 0 also as flag for > all other checks in code like if(num_flags) ): > > if (list.nr || cached ) > num_threads = 0; // do not use threads > else if

Problem staging file

2015-11-09 Thread Jack Adrian Zappa
I'm using vss2git [1] which as the name suggests, converts a VSS source control database to git. It has had a couple of hiccups, but for the most part I've not had too much problems that I couldn't manually fix except for this one. I have a file that refuses to be staged. The commands are:

[PATCH v7 11/11] refs: break out ref conflict checks

2015-11-09 Thread Michael Haggerty
From: David Turner Create new function find_descendant_ref, to hold one of the ref conflict checks used in verify_refname_available. Multiple backends will need this function, so move it to the common code. Also move rename_ref_available to the common code, because

[PATCH v7 05/11] pack_if_possible_fn(): use ref_type() instead of is_per_worktree_ref()

2015-11-09 Thread Michael Haggerty
is_per_worktree_ref() will soon be made private, so use the public interface, ref_type(), in its place. And now that we're using ref_type(), we can make it clear that we won't pack pseudorefs. This was the case before, but due to the not-so-obvious reason that this function is applied to

[PATCH v7 07/11] refs/refs-internal.h: new header file

2015-11-09 Thread Michael Haggerty
There are a number of constants, structs, and static functions defined in refs.c and treated as private to the references module. But we want to support multiple reference backends within the reference module, and those backends will need access to some heretofore private declarations. We don't

[PATCH v7 10/11] files_log_ref_write: new function

2015-11-09 Thread Michael Haggerty
From: David Turner Because HEAD and stash are per-worktree, every refs backend needs to go through the files backend to write these refs. So create a new function, files_log_ref_write, and add it to refs/refs-internal.h. Later, we will use this to handle reflog updates

Re: [PATCH] t5813: avoid creating urls that break on cygwin

2015-11-09 Thread Jeff King
On Sun, Nov 08, 2015 at 10:54:04AM +0100, Dennis Kaarsemaker wrote: > The fake ssh used by this test simply strips ssh://host from the url, > leaving paths behind that start with //, which cygwin interprets as UNC > paths, causing the test to fail. I found the first sentence a little misleading.

Re: git-credential-cache--daemon quits on SIGHUP, can we change it to ignore instead?

2015-11-09 Thread Jeff King
On Sun, Nov 08, 2015 at 09:58:06PM -0500, Noam Postavsky wrote: > > I am leaning more towards ignoring SIGHUP (configurably) being the only > > really sane path forward. Do you want to try your hand at a patch? > > Something like this? Yes, but with a proper commit message, and an update to

[RFD/WIP PATCH] rev-list: list all heads with --all

2015-11-09 Thread Michael J Gruber
HEAD is a worktree specific sysmref, so that a repository with multiple worktrees can have multiple HEADs, or HEADs in a worktree different from the current worktree. So far, "rev-parse --all" adds only the HEAD from the current worktree to the list of refs (besides branches etc.). So, a detached

Re: [PATCH v4] Add git-grep threads param

2015-11-09 Thread Jeff King
On Mon, Nov 09, 2015 at 03:36:16AM -0800, Victor Leschuk wrote: > Yeah do also think it would be more reasonable to use "0" for > "autodetect" default value. However chat this autodetect value should > be? > > For index index-pack and pack-objects we use ncpus() for this, however > according to

[PATCH v7 03/11] verify_refname_available(): new function

2015-11-09 Thread Michael Haggerty
From: Ronnie Sahlberg Add a new verify_refname_available() function, which checks whether the refname is available for use, taking all references (both packed and loose) into account. This function, unlike the old verify_refname_available(), has semantics independent of the

[PATCH v7 06/11] refname_is_safe(): improve docstring

2015-11-09 Thread Michael Haggerty
Signed-off-by: Michael Haggerty --- refs.c | 16 ++-- 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/refs.c b/refs.c index 82129f0..f48c58a 100644 --- a/refs.c +++ b/refs.c @@ -341,13 +341,17 @@ static struct ref_dir *get_ref_dir(struct ref_entry

[PATCH v7 00/11] refs backend pre-vtable

2015-11-09 Thread Michael Haggerty
This is another reroll of the pre-vtable part of the refs-backend patch series dt/refs-backend-pre-vtable. v6 [1] proved cumbersome because it conflicted messily with lf/ref-is-hidden-namespace [2]. The conflicts were partly due to the motion of code across files but, even worse, due to the change

[PATCH v7 01/11] refs: make is_branch public

2015-11-09 Thread Michael Haggerty
From: David Turner is_branch was already non-static, but this patch declares it in the header. Signed-off-by: Ronnie Sahlberg Signed-off-by: David Turner Signed-off-by: Junio C Hamano Signed-off-by:

[PATCH v7 02/11] verify_refname_available(): rename function

2015-11-09 Thread Michael Haggerty
From: Ronnie Sahlberg Rename verify_refname_available() to verify_refname_available_dir() to make the old name available for a more general purpose. Signed-off-by: Ronnie Sahlberg Signed-off-by: David Turner Signed-off-by:

[PATCH v7 04/11] copy_msg(): rename to copy_reflog_msg()

2015-11-09 Thread Michael Haggerty
From: David Turner We will soon increase the visibility of this function, so make its name more distinctive. Signed-off-by: David Turner Signed-off-by: Junio C Hamano Signed-off-by: Michael Haggerty

[PATCH v7 09/11] initdb: make safe_create_dir public

2015-11-09 Thread Michael Haggerty
From: David Turner Soon we will want to create initdb functions for ref backends, and code from initdb that calls this function needs to move into the files backend. So this function needs to be public. Signed-off-by: David Turner

RE: [PATCH v4] Add git-grep threads param

2015-11-09 Thread Victor Leschuk
> Why don't we leave it at 8, then? That's the conservative choice, and > once we have --threads, people can easily experiment with different > values and we can follow-up with a change to the default if need be. I'd propose the following: if (list.nr || cached) {

Re: [PATCH v7 07/11] refs/refs-internal.h: new header file

2015-11-09 Thread Ramsay Jones
On 09/11/15 17:03, Michael Haggerty wrote: > There are a number of constants, structs, and static functions defined > in refs.c and treated as private to the references module. But we want > to support multiple reference backends within the reference module, > and those backends will need access

Re: fetch unshallow fails to honor dry-run

2015-11-09 Thread Jeff King
[+cc Duy for shallow expertise] On Sun, Oct 25, 2015 at 10:16:00AM +0100, Tim Janik wrote: > git fetch --dry-run modifies the repository if --unshallow is passed: > > $ git --version > git version 2.1.4 > $ git fetch --dry-run --unshallow > remote: Counting objects: 30603, done. > remote:

RE: [PATCH v4] Add git-grep threads param

2015-11-09 Thread Victor Leschuk
. > In the meantime I'd argue for just getting rid of the online_cpu's > check, because > (a) I think it's actively misleading > (b) the threaded grep probably doesn't hurt much even on a single > CPU, and the _potential_ upside from IO could easily dwarf the cost. > (c) do developers

Re: [PATCH 0/5] Use watchman to reduce index refresh time

2015-11-09 Thread Christian Couder
On Tue, Nov 3, 2015 at 10:21 AM, Duy Nguyen wrote: > On Mon, Nov 2, 2015 at 8:23 PM, Duy Nguyen wrote: >> On Mon, Nov 2, 2015 at 3:54 PM, Paolo Ciarrocchi >> wrote: >>> On Sun, Nov 1, 2015 at 2:55 PM, Nguyễn Thái Ngọc Duy

Re: [PATCH v7 01/11] refs: make is_branch public

2015-11-09 Thread Michael Haggerty
On 11/09/2015 07:54 PM, Ramsay Jones wrote: > On 09/11/15 17:03, Michael Haggerty wrote: >> [...] >> diff --git a/refs.h b/refs.h >> index 6d30c98..39b8edc 100644 >> --- a/refs.h >> +++ b/refs.h >> @@ -217,6 +217,8 @@ extern void warn_dangling_symrefs(FILE *fp, const char >> *msg_fmt, const

Re: [PATCH v7 07/11] refs/refs-internal.h: new header file

2015-11-09 Thread Michael Haggerty
On 11/09/2015 08:46 PM, Ramsay Jones wrote: > On 09/11/15 17:03, Michael Haggerty wrote: >> [...] >> diff --git a/refs.c b/refs.c >> index f48c58a..9aff0c8 100644 >> --- a/refs.c >> +++ b/refs.c >> @@ -1,6 +1,6 @@ >> #include "cache.h" >> +#include "refs/refs-internal.h" >> #include "lockfile.h"

[PATCH v4 00/12] object_id part 2

2015-11-09 Thread brian m. carlson
This is the second in a series of conversions to struct object_id. This series converts more of the refs code and struct object to use struct object_id. It introduces an additional helper function, has_object_file, which is the equivalent of has_sha1_file. The name was chosen to be slightly

Re: [PATCH 2/6] remote-http(s): Support SOCKS proxies

2015-11-09 Thread Pat Thoyts
Johannes Schindelin writes: >Hi, > >On Tue, 27 Oct 2015, Johannes Schindelin wrote: > >> On Mon, 26 Oct 2015, Junio C Hamano wrote: >> >> > James McCoy writes: >> > >> > >> The code looks OK but the last paragraph makes _us_ worried. What >>

Re: [PATCH v7 01/11] refs: make is_branch public

2015-11-09 Thread David Turner
On Mon, 2015-11-09 at 18:54 +, Ramsay Jones wrote: > > On 09/11/15 17:03, Michael Haggerty wrote: > > From: David Turner > > > > is_branch was already non-static, but this patch declares it in the > > header. > > > > Signed-off-by: Ronnie Sahlberg

Re: [PATCH v7 00/11] refs backend pre-vtable

2015-11-09 Thread David Turner
On Mon, 2015-11-09 at 18:03 +0100, Michael Haggerty wrote: > This is another reroll of the pre-vtable part of the refs-backend > patch series dt/refs-backend-pre-vtable. v6 [1] proved cumbersome > because it conflicted messily with lf/ref-is-hidden-namespace [2]. The > conflicts were partly due to

Re: how to check for uncommitted/unstaged changes on remote side before pushing

2015-11-09 Thread Dennis Kaarsemaker
On zo, 2015-11-08 at 22:23 +0100, Marc Haber wrote: > Hi, > > I am trying to abuse git as a code distribution channel and would > like > to be able to trigger redistribution just by git push. [insert obligatory remark about git not being a deployment tool] > The idea is to push to a remote to

Re: how to check for uncommitted/unstaged changes on remote side before pushing

2015-11-09 Thread Marc Haber
Hi Dennis, thanks for your comments. I appreciate that. On Mon, Nov 09, 2015 at 09:25:00AM +0100, Dennis Kaarsemaker wrote: > On zo, 2015-11-08 at 22:23 +0100, Marc Haber wrote: > > Hi, > > > > I am trying to abuse git as a code distribution channel and would > > like > > to be able to trigger

Re: how to check for uncommitted/unstaged changes on remote side before pushing

2015-11-09 Thread Dennis Kaarsemaker
On ma, 2015-11-09 at 10:31 +0100, Marc Haber wrote: > Abusing git here has the advantage that one can save local changes > and merge them, which is handy for the task at hand (which is > deploying my dotfiles to "my" servers). For this I really like vcsh (https://github.com/RichiH/vcsh/) in

RE: [PATCH v4] Add git-grep threads param

2015-11-09 Thread Victor Leschuk
From: Jeff King [p...@peff.net] Sent: Tuesday, November 03, 2015 22:40 To: Junio C Hamano Cc: Victor Leschuk; git@vger.kernel.org; Victor Leschuk; torva...@linux-foundation.org; j...@keeping.me.uk Subject: Re: [PATCH v4] Add git-grep threads param On

[PATCH v3] gitk: add -C commandline parameter to change path

2015-11-09 Thread Juha-Pekka Heikkila
This patch adds -C (change working directory) parameter to gitk. With this parameter, instead of need to cd to directory with .git folder, one can point the correct folder from commandline. Signed-off-by: Juha-Pekka Heikkila --- v2: Adjusted the parameter as per

Re: git-credential-cache--daemon quits on SIGHUP, can we change it to ignore instead?

2015-11-09 Thread Noam Postavsky
On Mon, Nov 9, 2015 at 10:53 AM, Jeff King wrote: > Yes, but with a proper commit message, and an update to > Documentation/config.txt. :) Right, see attached. > > Automated tests would be nice, but I suspect it may be too complicated > to be worth it. I attempted