[PATCH v3 1/1] add -i: Show progress counter in the prompt

2019-09-29 Thread Kunal Tyagi via GitGitGadget
From: Kunal Tyagi Report the current hunk count and total number of hunks for the current file in the prompt Adjust the expected output in some tests to account for new data on the prompt Signed-off-by: Kunal Tyagi --- git-add--interactive.perl | 2 +- t/t3701-add-interactive.sh | 2 +- 2 fil

[PATCH v3 0/1] git-add--interactive.perl: Add progress counter in the prompt

2019-09-29 Thread Kunal Tyagi via GitGitGadget
Hi git contributors! I'm Kunal Tyagi. While I was choosing the relevant patches for a commit using the git add -p command, I found that there was no feedback regarding how many hunks from the current file had been processed and how many were left. So I decided to add a small change to the prompt w

[PATCH v2 08/11] grep: allow submodule functions to run in parallel

2019-09-29 Thread Matheus Tavares
Now that object reading operations are internally protected, the submodule initialization functions at builtin/grep.c:grep_submodule() are very close to being thread-safe. Let's take a look at each call and remove from the critical section what we can, for better performance: - submodule_from_path

[PATCH v2 11/11] grep: move driver pre-load out of critical section

2019-09-29 Thread Matheus Tavares
In builtin/grep.c:add_work() we pre-load the userdiff drivers before adding the grep_source in the todo list. This operation is currently being performed after acquiring the grep_mutex, but as it's already thread-safe, we don't need to protect it here. So let's move it out of the critical section w

[PATCH v2 09/11] grep: protect packed_git [re-]initialization

2019-09-29 Thread Matheus Tavares
Some fields in struct raw_object_store are lazy initialized by the thread-unsafe packfile.c:prepare_packed_git(). Although this function is present in the call stack of git-grep threads, all paths to it are currently protected by obj_read_lock() (and the main thread usually indirectly calls it befo

[PATCH v2 07/11] submodule-config: add skip_if_read option to repo_read_gitmodules()

2019-09-29 Thread Matheus Tavares
Currently, submodule-config.c doesn't have an externally acessible function to read gitmodules only if it wasn't already read. But this exactly behavior is internally implemented by gitmodules_read_check(), to perform a lazy load. Let's merge this function with repo_read_gitmodules() adding an 'ski

[PATCH v2 10/11] grep: re-enable threads in non-worktree case

2019-09-29 Thread Matheus Tavares
They were disabled at 53b8d93 ("grep: disable threading in non-worktree case", 12-12-2011), due to observable performance drops (to the point that using a single thread would be faster than multiple threads). But now that zlib inflation can be performed in parallel we can regain the speedup, so let

[PATCH v2 05/11] object-store: allow threaded access to object reading

2019-09-29 Thread Matheus Tavares
Allow object reading to be performed by multiple threads protecting it with an internal lock. The lock usage can be toggled with enable_obj_read_lock() and disable_obj_read_lock(). Currently, the functions which can be safely called in parallel are: read_object_file_extended(), repo_read_object_fil

[PATCH v2 06/11] grep: replace grep_read_mutex by internal obj read lock

2019-09-29 Thread Matheus Tavares
git-grep uses 'grep_read_mutex' to protect its calls to object reading operations. But these have their own internal lock now, which ensures a better performance (allowing parallel access to more regions). So, let's remove the former and, instead, activate the latter with enable_obj_read_lock(). S

[PATCH v2 04/11] replace-object: make replace operations thread-safe

2019-09-29 Thread Matheus Tavares
replace-object functions are very close to being thread-safe: the only current racy section is the lazy initialization at prepare_replace_object(). The following patches will protect some object reading operations to be called threaded, but before that, replace functions must be protected. To do so

[PATCH v2 02/11] grep: fix race conditions at grep_submodule()

2019-09-29 Thread Matheus Tavares
There're currently two function calls in builtin/grep.c:grep_submodule() which might result in race conditions: - submodule_from_path(): it has config_with_options() in its call stack which, in turn, may have read_object_file() in its own. Therefore, calling the first function without acquirin

[PATCH v2 01/11] grep: fix race conditions on userdiff calls

2019-09-29 Thread Matheus Tavares
git-grep uses an internal grep_read_mutex to protect object reading operations. Similarly, there's a grep_attr_mutex to protect calls to the gitattributes machinery. However, two of the three functions protected by the last mutex may also perform object reading, as seen bellow: - userdiff_get_text

[PATCH v2 00/11] grep: improve threading and fix race conditions

2019-09-29 Thread Matheus Tavares
This series focus on re-enabling threads at git-grep for the non-worktree case. They are currently disabled due to being slower than single-threaded grep in this case. However, by allowing parallel zlib inflation when reading objects, speedups of up to 3x were observed. The patchset also contains

[PATCH v2 03/11] grep: fix racy calls in grep_objects()

2019-09-29 Thread Matheus Tavares
deref_tag() calls is_promisor_object() and parse_object(), both of which perform lazy initializations and other thread-unsafe operations. If it was only called by grep_objects() this wouldn't be a problem as the latter is only executed by the main thread. However, deref_tag() is also present in rea

Re: [PATCH v4] diffcore-break: use a goto instead of a redundant if statement

2019-09-29 Thread Junio C Hamano
Alex Henrie writes: > The condition "if (q->nr <= j)" checks whether the loop exited normally > or via a break statement. This check can be avoided by replacing the > jump out of the inner loop with a jump to the end of the outer loop. > > With the break replaced by a goto, the two diff_q calls t

Re: [PATCH v2 1/1] git-add--interactive.perl: Add progress counter in the prompt

2019-09-29 Thread Junio C Hamano
"Kunal Tyagi via GitGitGadget" writes: > From: Kunal Tyagi > Subject: Re: [PATCH v2 1/1] git-add--interactive.perl: Add progress counter > in the prompt Either of these two, perhaps (I'd use the former if I were writing this patch): add -i: show progress counter in the prompt

Re: [PATCH v3] commit-graph: remove a duplicate assignment

2019-09-29 Thread Junio C Hamano
Alex Henrie writes: > The variable g was being set to the same value both at the beginning of > the function and before the loop. The assignment before the loop was > kept because it helps clarify what the loop does, and the redundant > assignment at the beginning of the function was removed. Wr

Re: [PATCH v3] diffcore-break: use a goto instead of a redundant if statement

2019-09-29 Thread Junio C Hamano
CB Bailey writes: > For easier discussion, I've snipped the original patch and replaced with > one with enough context to show the entire function. > > I was reviewing this patch and it appeared to introduce a change in > behaviour. > >> diff --git a/diffcore-break.c b/diffcore-break.c >> index 8

[PATCH v4] diffcore-break: use a goto instead of a redundant if statement

2019-09-29 Thread Alex Henrie
The condition "if (q->nr <= j)" checks whether the loop exited normally or via a break statement. This check can be avoided by replacing the jump out of the inner loop with a jump to the end of the outer loop. With the break replaced by a goto, the two diff_q calls then can be replaced with a sing

Re: [PATCH v3] diffcore-break: use a goto instead of a redundant if statement

2019-09-29 Thread Alex Henrie
On Sun, Sep 29, 2019 at 3:37 AM CB Bailey wrote: > > Previously, if the condition matched in the inner loop, the function > would null out the entry in the queue that that inner loop had reached > (q->queue[j] = NULL) and then break out of the inner loop. This meant > that the outer loop would ski

Re: ProGit2 translation in Azerbaijani

2019-09-29 Thread Alicenab
Hi guys, any updates? On 22.09.19 02:36, Alicenab wrote: Hi there! I have a translated ProGit2 book to Azerbaijan language. As code of country name name for our country(az) have already taken, I have created "aze" version of it. I hope it will be no problem for you. Partial translations availa

Re: [PATCH 4/4] git-gui--askyesno (mingw): use Git for Windows' icon, if available

2019-09-29 Thread Pratyush Yadav
Since this is a git-gui dialog/prompt, why not use the git-gui icon? This will mean some uniformity between all the platforms (though I'm not sure if other platforms even use GIT_ASK_YESNO). It would also probably save you the hacks needed to find out the git-for-windows icon. Well, there is th

Re: [PATCH 3/4] git-gui--askyesno: allow overriding the window title

2019-09-29 Thread Pratyush Yadav
One minor nitpick: please add a comment at the top of the file documenting the `--title` option, and the usage of the program in general. Other than that, looks good. Thanks. On 26/09/19 08:29AM, Johannes Schindelin via GitGitGadget wrote: > From: Johannes Schindelin > > "Question?" is maybe

Re: [PATCH 2/4] git gui: set GIT_ASKPASS=git-gui--askpass if not set yet

2019-09-29 Thread Pratyush Yadav
What is the difference between SSH_ASKPASS and GIT_ASKPASS? On my first read, I assumed SSH_ASKPASS is replaced by GIT_ASKPASS, but I might be wrong. On 26/09/19 08:29AM, Johannes Schindelin via GitGitGadget wrote: > From: Johannes Schindelin > > Signed-off-by: Johannes Schindelin > --- > gi

Re: [PATCH 1/4] git-gui: provide question helper for retry fallback on Windows

2019-09-29 Thread Pratyush Yadav
On 26/09/19 08:29AM, Heiko Voigt via GitGitGadget wrote: > From: Heiko Voigt > > Make use of the new environment variable GIT_ASK_YESNO to support the > recently implemented fallback in case unlink, rename or rmdir fail for > files in use on Windows. The added dialog will present a yes/no questio

Re: [PATCH 2/2] git-gui: support for diff3 conflict style

2019-09-29 Thread Pratyush Yadav
Hi Philip, Bert, Is there any way I can test this change? Philip, I ran the rebase you mention in the GitHub issue [0], and I get that '9c8cba6862abe5ac821' is an unknown revision. Is there any quick way I can reproduce this (maybe on a sample repo)? [0] https://github.com/git-for-windows/git/

Re: [PATCH v3] diffcore-break: use a goto instead of a redundant if statement

2019-09-29 Thread CB Bailey
On Sat, Sep 28, 2019 at 06:56:46PM -0600, Alex Henrie wrote: > The condition "if (q->nr <= j)" checks whether the loop exited normally > or via a break statement. This check can be avoided by replacing the > jump to the end of the loop with a jump to the end of the function. > > With the break rep

What's cooking in git.git (Sep 2019, #03; Sun, 29)

2019-09-29 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 ones marked with '.' do not appear in any of the integration branches, but I am still holding onto them. I've been offline for a week or so

Re: [PATCH v2 00/19] hashmap bug/safety/ease-of-use fixes

2019-09-29 Thread Junio C Hamano
Eric Wong writes: > Patches 1-11 are largely unchanged from the original series with the > exception of 2, which is new and posted at: > > https://public-inbox.org/git/20190908074953.kux7zz4y7iolqko4@whir/ > > 12-17 take further steps to get us away from hashmap_entry being > the first elem