[BUG] Memory corruption crash with "git bisect start"

2017-02-14 Thread Maxim Kuvyrkov
I'm seeing the following memory corruption crash on a script-constructed repo when starting git bisect. I'm seeing this crash both with system git of Ubuntu Xenial and with freshly-compiled git master from the official repo. The log of the crash is attached. It is possible that the bug is in X

[PATCH 5/5] name-hash: remember previous dir_entry during lazy_init_name_hash

2017-02-14 Thread Johannes Schindelin
From: Jeff Hostetler Teach hash_dir_entry() to remember the previously found dir_entry during lazy_init_name_hash() iteration. This is a performance optimization. Since items in the index array are sorted by full pathname, adjacent items are likely to be in the same directory. This can save memih

[PATCH 4/5] name-hash: specify initial size for istate.dir_hash table

2017-02-14 Thread Johannes Schindelin
From: Jeff Hostetler Specify an initial size for the istate.dir_hash hash map matching the size of the istate.name_hash. Previously hashmap_init() was given 0, causing a 64 bucket hashmap to be created. When working with very large repositories, this would cause numerous rehash() calls to reallo

[PATCH 1/5] name-hash: eliminate duplicate memihash call

2017-02-14 Thread Johannes Schindelin
From: Jeff Hostetler The existing code called memihash() to pass to the find_dir_entry() function, and if not found, called memihash() again to pass to the hashmap_add() function. Remove that duplicate memihash() call in hash_dir_entry(). Signed-off-by: Jeff Hostetler Signed-off-by: Johannes Sc

[PATCH 2/5] hashmap: allow memihash computation to be continued

2017-02-14 Thread Johannes Schindelin
From: Jeff Hostetler There are times when we compute the hash on a full path and then the hash on just the path to the parent directory. This can be expensive on large repositories. With the new memihash_continue() function, we can hash the parent directory first, and reuse that computed hash fo

[PATCH 0/5] A series of performance enhancements in the memihash and name-cache area

2017-02-14 Thread Johannes Schindelin
On Windows, calls to memihash() and maintaining the istate.name_hash and istate.dir_hash HashMaps take significant time on very large repositories. This series of changes reduces the overall time taken for various operations by reducing the number calls to memihash(), moving some of them into multi

[PATCH 3/5] name-hash: precompute hash values during preload-index

2017-02-14 Thread Johannes Schindelin
From: Jeff Hostetler Precompute the istate.name_hash and istate.dir_hash values for each cache-entry during the preload-index phase. Move the expensive memihash() calculations from lazy_init_name_hash() to the multi-threaded preload-index phase. Signed-off-by: Jeff Hostetler Signed-off-by: Joh

Re: [PATCH 11/11] refs: split and make get_*_ref_store() public API

2017-02-14 Thread Duy Nguyen
On Tue, Feb 14, 2017 at 6:55 AM, Stefan Beller wrote: >> >> +/* >> + * Return the ref_store instance for the specified submodule. For the >> + * main repository, use submodule==NULL; such a call cannot fail. > > So now we have both a get_main as well as a get_submodule function, > but the submodul

[PATCH v2] clean: use warning_errno() when appropriate

2017-02-14 Thread Nguyễn Thái Ngọc Duy
All these warning() calls are preceded by a system call. Report the actual error to help the user understand why we fail to remove something. Signed-off-by: Nguyễn Thái Ngọc Duy --- v2 dances with errno builtin/clean.c | 19 ++- 1 file changed, 14 insertions(+), 5 deletions(-)

Re: [PATCH 04/11] files-backend: replace *git_path*() with files_path()

2017-02-14 Thread Duy Nguyen
On Tue, Feb 14, 2017 at 3:58 AM, Ramsay Jones wrote: >> -void files_path(struct files_ref_store *refs, struct strbuf *sb, >> - const char *fmt, ...) __attribute__((format (printf, 3, 4))); > > You only added this in the last commit, so maybe mark it static in > the previous patch! Also

Re: [PATCH 06/11] refs-internal.h: correct is_per_worktree_ref()

2017-02-14 Thread Duy Nguyen
On Tue, Feb 14, 2017 at 5:37 AM, Stefan Beller wrote: > On Mon, Feb 13, 2017 at 7:20 AM, Nguyễn Thái Ngọc Duy > wrote: >> All refs outside refs/ directory is per-worktree, not just HEAD. >> >> Signed-off-by: Nguyễn Thái Ngọc Duy >> --- >> refs/refs-internal.h | 2 +- >> 1 file changed, 1 inser

Re: [PATCH 07/11] files-backend: remove the use of git_path()

2017-02-14 Thread Duy Nguyen
On Tue, Feb 14, 2017 at 6:09 AM, Stefan Beller wrote: >> + >> + if (submodule) { >> + refs->submodule = xstrdup_or_null(submodule); > > drop the _or_null here? > > So in this patch we have either > * submodule set > * or gitdir/gitcommondir set > > which means that we exercise

Re: [PATCH 09/11] refs: move submodule code out of files-backend.c

2017-02-14 Thread Duy Nguyen
On Tue, Feb 14, 2017 at 6:35 AM, Stefan Beller wrote: >> + git_dir = read_gitfile(buf.buf); > > if buf.buf is a (git) directory as opposed to a git file, > we error out in read_gitfile. Did you mean to use > read_gitfile_gently here or rather even resolve_gitdir_gently ? This is what strbuf

Re: [PATCH 01/11] refs-internal.c: make files_log_ref_write() static

2017-02-14 Thread Duy Nguyen
On Tue, Feb 14, 2017 at 3:14 AM, Ramsay Jones wrote: > > > On 13/02/17 15:20, Nguyễn Thái Ngọc Duy wrote: >> Created in 5f3c3a4e6f (files_log_ref_write: new function - 2015-11-10) >> but probably never used outside refs-internal.c >> >> Signed-off-by: Nguyễn Thái Ngọc Duy >> --- >> refs/files-ba

Re: Bug in 'git describe' if I have two tags on the same commit.

2017-02-14 Thread Istvan Pato
This is my fault: this is a lightweight tag. Thank you! 2017-02-13 21:35 GMT+01:00 Junio C Hamano : > Kevin Daudt writes: > >> On Sun, Feb 12, 2017 at 01:15:22PM +0100, Istvan Pato wrote: >> >>> (master) [1] % git show-ref --tag >>> 76c634390... refs/tags/1.0.0 >>> b77c7cd17... refs/tags/1.1.0 >>

<    1   2