Re: [PATCH] completion: expand "push --delete " for refs on that

2017-04-21 Thread SZEDER Gábor
On Tue, Apr 18, 2017 at 3:31 PM, Ævar Arnfjörð Bjarmason wrote: > Change the completion of "push --delete " to complete > refs on that , not all refs. Good. > Before this e.g. cloning git.git > and doing "git push --delete origin p" will complete nothing, Well, it will

[PATCH] test-lib: abort when can't remove trash directory

2017-04-20 Thread SZEDER Gábor
, because that's unexpected and we woud prefer somebody notice and figure out why. Signed-off-by: SZEDER Gábor <szeder@gmail.com> --- Note, that the commit message references ef09036cf (t6500: wait for detached auto gc at the end of the test script, 2017-04-13), which is still only in 'pu

Re: [PATCH] t6500: don't run detached auto gc at the end of the test script

2017-04-20 Thread SZEDER Gábor
On Fri, Apr 14, 2017 at 10:08 PM, Jeff King <p...@peff.net> wrote: > On Thu, Apr 13, 2017 at 09:35:08PM +0200, SZEDER Gábor wrote: > >> >> diff --git a/t/test-lib.sh b/t/test-lib.sh >> >> index 13b569682..d7fa15a69 100644 >> >> --- a/t/test-lib.sh

Re: [PATCH] t6500: don't run detached auto gc at the end of the test script

2017-04-13 Thread SZEDER Gábor
On Thu, Apr 13, 2017 at 9:12 PM, Jeff King <p...@peff.net> wrote: > On Thu, Apr 13, 2017 at 09:03:26PM +0200, SZEDER Gábor wrote: > >> > Yeah, I had a similar thought. I can't think of any reason why it would >> > trigger a false positive, as long

Re: [PATCH] t6500: don't run detached auto gc at the end of the test script

2017-04-13 Thread SZEDER Gábor
On Thu, Apr 13, 2017 at 7:57 PM, Jeff King wrote: > On Thu, Apr 13, 2017 at 10:55:08AM -0700, Stefan Beller wrote: > >> On Thu, Apr 13, 2017 at 9:37 AM, Jeff King wrote: >> > Ah, OK, that makes more sense. I can detect it reliably by just checking >> > >> > ! test

Re: [PATCHv2.1] t6500: wait for detached auto gc at the end of the test script

2017-04-13 Thread SZEDER Gábor
On Thu, Apr 13, 2017 at 6:44 PM, Jeff King <p...@peff.net> wrote: > On Thu, Apr 13, 2017 at 12:31:38PM +0200, SZEDER Gábor wrote: > I did wonder what will happen if Windows learns to daemonize() the > auto-gc. I don't think we'll get an immediate test failure, but this > tes

Re: [PATCH] status: show in-progress info for short status

2017-04-13 Thread SZEDER Gábor
On Fri, Apr 7, 2017 at 4:05 PM, Michael J Gruber <g...@grubix.eu> wrote: > SZEDER Gábor venit, vidit, dixit 06.04.2017 16:33: >>> @@ -1779,6 +1780,31 @@ static void wt_shortstatus_print_tracking(struct >>> wt_status *s) >>> } >>&g

[PATCHv2.1] t6500: wait for detached auto gc at the end of the test script

2017-04-13 Thread SZEDER Gábor
ixt <j...@kdbg.org> Signed-off-by: SZEDER Gábor <szeder@gmail.com> --- Updated subject line, but otherwise the same as v2. t/t6500-gc.sh | 18 +- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/t/t6500-gc.sh b/t/t6500-gc.sh index 08de2e8ab..cc7acd101 10

[PATCHv2] t6500: don't run detached auto gc at the end of the test script

2017-04-12 Thread SZEDER Gábor
ixt <j...@kdbg.org> Signed-off-by: SZEDER Gábor <szeder@gmail.com> --- t/t6500-gc.sh | 18 +- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/t/t6500-gc.sh b/t/t6500-gc.sh index 08de2e8ab..cc7acd101 100755 --- a/t/t6500-gc.sh +++ b/t/t6500-gc.

Re: [PATCH] t6500: don't run detached auto gc at the end of the test script

2017-04-12 Thread SZEDER Gábor
On Wed, Apr 12, 2017 at 2:50 AM, Jeff King <p...@peff.net> wrote: > On Wed, Apr 12, 2017 at 02:27:05AM +0200, SZEDER Gábor wrote: > >> >> I wonder if you could make it a general test-lib function, like: >> >> >> >> run_and_wait () { >> >&g

Re: [PATCH] t6500: don't run detached auto gc at the end of the test script

2017-04-11 Thread SZEDER Gábor
On Tue, Apr 11, 2017 at 11:32 PM, Johannes Sixt wrote: > Am 10.04.2017 um 19:01 schrieb Jeff King: >> >> I wonder if you could make it a general test-lib function, like: >> >> run_and_wait () { >> # we read stdout from the child only for the side effect >> # of

Re: [PATCH] t6500: don't run detached auto gc at the end of the test script

2017-04-10 Thread SZEDER Gábor
On Mon, Apr 10, 2017 at 6:35 PM, Jeff King <p...@peff.net> wrote: > On Mon, Apr 10, 2017 at 06:31:54PM +0200, SZEDER Gábor wrote: >> This means we can write this simply as: >> >> doesnt_matter=$(git gc --auto 9>&1) >> >> It's still hackery :) &

Re: [PATCH] t6500: don't run detached auto gc at the end of the test script

2017-04-10 Thread SZEDER Gábor
On Mon, Apr 10, 2017 at 3:58 PM, Jeff King <p...@peff.net> wrote: > On Mon, Apr 10, 2017 at 02:59:11PM +0200, SZEDER Gábor wrote: > >> While this change doesn't completely eliminate the possibility of >> this race, it significantly and seemingly sufficiently reduces its

Re: [PATCH 2/2] test-lib: exhaustively insert non-alnum ASCII into the TRASH_DIRECTORY name

2017-04-10 Thread SZEDER Gábor
On Mon, Apr 10, 2017 at 1:40 PM, Ævar Arnfjörð Bjarmason <ava...@gmail.com> wrote: > On Mon, Apr 10, 2017 at 1:19 PM, SZEDER Gábor <szeder@gmail.com> wrote: >> A few other failures are triggered by the ':' in the trash directory's >> name, breaking the foll

[PATCH] t6500: don't run detached auto gc at the end of the test script

2017-04-10 Thread SZEDER Gábor
and the pid file were not removed.) Signed-off-by: SZEDER Gábor <szeder@gmail.com> --- t/t6500-gc.sh | 32 +++- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/t/t6500-gc.sh b/t/t6500-gc.sh index 08de2e8ab..2dc202c9b 100755 --- a/t/t6500-gc.sh +

Re: [PATCH 2/2] test-lib: exhaustively insert non-alnum ASCII into the TRASH_DIRECTORY name

2017-04-10 Thread SZEDER Gábor
On Mon, Apr 10, 2017 at 10:02 AM, Ævar Arnfjörð Bjarmason <ava...@gmail.com> wrote: > On Mon, Apr 10, 2017 at 3:47 AM, SZEDER Gábor <szeder@gmail.com> wrote: >>> Change the test library to insert non-alphanumeric ASCII characters >>> into the TRASH_DIRECTORY na

Re: [PATCH 2/2] test-lib: exhaustively insert non-alnum ASCII into the TRASH_DIRECTORY name

2017-04-09 Thread SZEDER Gábor
> Change the test library to insert non-alphanumeric ASCII characters > into the TRASH_DIRECTORY name, that's the directory the test library > creates, chdirs to and runs each individual test from. > > Unless test_fails_on_unusual_directory_names=1 is declared before > importing test-lib.sh (and

Re: [PATCH] status: show in-progress info for short status

2017-04-06 Thread SZEDER Gábor
inished merge, 2007-09-30). Later 3041c3243 (am: --rebasing, 2008-03-04) made it possible to tell those cases apart and made __git_ps1() use this right away to display either "AM" or "REBASE", respectively. However, it left that "AM/REBASE" in an else-branch as a fallbac

Re: [PATCH v5 2/4] read-cache: add strcmp_offset function

2017-04-06 Thread SZEDER Gábor
> Add strcmp_offset() function to also return the offset of the > first change. > > Signed-off-by: Jeff Hostetler > --- > cache.h | 1 + > read-cache.c | 29 + > 2 files changed, 30 insertions(+) > > diff --git a/cache.h b/cache.h >

Re: [PATCH v5 4/4] read-cache: speed up add_index_entry during checkout

2017-04-05 Thread SZEDER Gábor
> Teach add_index_entry_with_check() and has_dir_name() > to see if the path of the new item is greater than the > last path in the index array before attempting to search > for it. > > During checkout, merge_working_tree() populates the new > index in sorted order, so this change saves at least

Re: [PATCH v5 3/4] test-strcmp-offset: created test for strcmp_offset

2017-04-05 Thread SZEDER Gábor
I think this patch should be squashed into the previous commit; I don't see any reason why the tests should be added in a different commit than the function they are testing. However... > Signed-off-by: Jeff Hostetler > --- > Makefile | 1 + >

Re: Terrible bad performance for it blame --date=iso -C

2017-04-03 Thread SZEDER Gábor
> In the other case (for the user bored of waiting seeking for some > entertainment ;-)) a "-v (verbose) option could be useful. Or at the > very least: If git is expecting that some operation will take (or > already did take) a lot of time, give some message explaining why it > is taking a lot

Re: [PATCH 3/3] completion: offer ctags symbol names for 'git log -S', '-G' and '-L:'

2017-03-30 Thread SZEDER Gábor
On Fri, Mar 24, 2017 at 1:52 AM, Jeff King <p...@peff.net> wrote: > On Thu, Mar 23, 2017 at 04:38:39PM +0100, SZEDER Gábor wrote: > > > Just like in the case of search patterns for 'git grep', see 29eec71f2 > > (completion: match ctags symbol names in grep patterns, 20

Re: [PATCHv2 08/14] completion: let 'for-each-ref' and 'ls-remote' filter matching refs

2017-03-28 Thread SZEDER Gábor
On Fri, Mar 24, 2017 at 8:42 PM, Jeff King <p...@peff.net> wrote: > On Thu, Mar 23, 2017 at 04:29:18PM +0100, SZEDER Gábor wrote: >> case "$cur_" in >> refs|refs/*) >> format="refn

Re: [PATCH] refs.c: use skip_prefix() in prettify_refname()

2017-03-23 Thread SZEDER Gábor
On Thu, Mar 23, 2017 at 8:39 PM, Jeff King wrote: > On Thu, Mar 23, 2017 at 12:33:06PM -0700, Junio C Hamano wrote: > >> >> Nice, but why add the "if" when it's doing nothing? >> > >> > It's short-circuiting in the conditional. >> >> I think René meant this: >> >> /* just for

[PATCH] refs.c: use skip_prefix() in prettify_refname()

2017-03-23 Thread SZEDER Gábor
This eliminates three magic numbers. Signed-off-by: SZEDER Gábor <szeder@gmail.com> --- refs.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/refs.c b/refs.c index e7606716d..0272e332c 100644 --- a/refs.c +++ b/refs.c @@ -366,11 +366,11

[PATCH 3/3] completion: offer ctags symbol names for 'git log -S', '-G' and '-L:'

2017-03-23 Thread SZEDER Gábor
these options, both in stuck and in unstuck forms. Signed-off-by: SZEDER Gábor <szeder@gmail.com> --- contrib/completion/git-completion.bash | 28 1 file changed, 28 insertions(+) diff --git a/contrib/completion/git-completion.bash b/contrib/completi

[PATCH 0/3] completion: updates to ctags symbol names

2017-03-23 Thread SZEDER Gábor
/completion-refs-speedup'. SZEDER Gábor (3): completion: put matching ctags symbol names directly into COMPREPLY completion: extract completing ctags symbol names into helper function completion: offer ctags symbol names for 'git log -S', '-G' and '-L:' contrib/completion/git-completion.bash | 72

[PATCH 1/3] completion: put matching ctags symbol names directly into COMPREPLY

2017-03-23 Thread SZEDER Gábor
ime __gitcomp_direct "$(__git_match_ctag "" tags "" " ")" real0m0.058s user 0m0.048s sys 0m0.008s Signed-off-by: SZEDER Gábor <szeder@gmail.com> --- Notes: It's still just a simple linear search through the tags file, so t

[PATCH 2/3] completion: extract completing ctags symbol names into helper function

2017-03-23 Thread SZEDER Gábor
__git_complete_symbol(), which encompasses the condition for checking the presence of the tag file and filling COMPREPLY, and accepts '--opt=val'-style options with default values that keep callsites simpler. Signed-off-by: SZEDER Gábor <szeder@gmail.com> --- contrib/completion/git-completion.bas

Re: [PATCHv2 00/14] completion: speed up refs completion

2017-03-23 Thread SZEDER Gábor
On Thu, Mar 23, 2017 at 4:29 PM, SZEDER Gábor <szeder@gmail.com> wrote: > This series is the updated version of 'sg/completion-refs-speedup'. Forgot to mention that v1 can be found here: http://public-inbox.org/git/20170203025405.8242-1-szeder@gmail.com/T/ Gábor

[PATCHv2 03/14] completion: support completing full refs after '--option=refs/'

2017-03-23 Thread SZEDER Gábor
this new parameter the 4. positional parameter and leave the 3. as an ignored placeholder for now (it will be used later in this patch series). Signed-off-by: SZEDER Gábor <szeder@gmail.com> --- contrib/completion/git-completion.bash | 21 ++--- t/t9902-complet

[PATCHv2 00/14] completion: speed up refs completion

2017-03-23 Thread SZEDER Gábor
] - http://public-inbox.org/git/20170206181545.12869-1-szeder@gmail.com/ SZEDER Gábor (14): completion: remove redundant __gitcomp_nl() options from _git_commit() completion: wrap __git_refs() for better option parsing completion: support completing full refs after '--option=refs

[PATCHv2 11/14] completion: let 'for-each-ref' sort remote branches for 'checkout' DWIMery

2017-03-23 Thread SZEDER Gábor
: real0m2.781s user0m1.826s sys 0m0.136s Signed-off-by: SZEDER Gábor <szeder@gmail.com> --- contrib/completion/git-completion.bash | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contrib/completion/git-completion.bash b/contrib/completi

[PATCHv2 02/14] completion: wrap __git_refs() for better option parsing

2017-03-23 Thread SZEDER Gábor
refs2() helper. Signed-off-by: SZEDER Gábor <szeder@gmail.com> --- contrib/completion/git-completion.bash | 102 --- t/t9902-completion.sh | 106 + 2 files changed, 173 insertions(+), 35 deletions(-) diff --git a/co

[PATCHv2 06/14] completion: don't disambiguate tags and branches

2017-03-23 Thread SZEDER Gábor
and branches in __git_tags() and __git_heads(). Signed-off-by: SZEDER Gábor <szeder@gmail.com> --- contrib/completion/git-completion.bash | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash

[PATCHv2 12/14] completion: fill COMPREPLY directly when completing refs

2017-03-23 Thread SZEDER Gábor
real0m2.093s user0m1.641s sys 0m0.060s After: real0m0.683s user0m0.203s sys 0m0.076s Signed-off-by: SZEDER Gábor <szeder@gmail.com> --- contrib/completion/git-completion.bash | 54 +- contrib/completion/git-completio

[PATCHv2 10/14] completion: let 'for-each-ref' filter remote branches for 'checkout' DWIMery

2017-03-23 Thread SZEDER Gábor
0m0.750s user0m0.015s sys 0m0.090s Signed-off-by: SZEDER Gábor <szeder@gmail.com> --- contrib/completion/git-completion.bash | 12 +++- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/contrib/completion/git-completion.bash b/contrib/completi

[PATCHv2 14/14] completion: speed up branch and tag completion

2017-03-23 Thread SZEDER Gábor
suffix parameters, and to fill COMPREPLY using __gitcomp_direct(). Signed-off-by: SZEDER Gábor <szeder@gmail.com> --- contrib/completion/git-completion.bash | 25 +++-- 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/contrib/completion/git-completion.bas

[PATCHv2 09/14] completion: let 'for-each-ref' strip the remote name from remote branches

2017-03-23 Thread SZEDER Gábor
0m8.191s user0m4.638s sys 0m2.918s After: real0m6.187s user0m3.358s sys 0m2.121s Signed-off-by: SZEDER Gábor <szeder@gmail.com> --- contrib/completion/git-completion.bash | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff

[PATCHv2 13/14] completion: fill COMPREPLY directly when completing fetch refspecs

2017-03-23 Thread SZEDER Gábor
and feed the result, since it doesn't need further processing, to the new __gitcomp_direct() helper added in the previous commit, because it should be faster when there are a lot of refspecs to list. Signed-off-by: SZEDER Gábor <szeder@gmail.com> --- contrib/completion/git-completion.ba

[PATCHv2 08/14] completion: let 'for-each-ref' and 'ls-remote' filter matching refs

2017-03-23 Thread SZEDER Gábor
0m0.104s sys 0m0.008s On Windows, before: real0m1.480s user0m1.031s sys 0m0.060s After: real0m0.377s user0m0.015s sys 0m0.030s Signed-off-by: SZEDER Gábor <szeder@gmail.com> --- contrib/completion/git-completion.bash

[PATCHv2 07/14] completion: don't disambiguate short refs

2017-03-23 Thread SZEDER Gábor
Signed-off-by: SZEDER Gábor <szeder@gmail.com> --- contrib/completion/git-completion.bash | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index e129f674e..5ee35d530 100644 --- a/c

[PATCHv2 04/14] completion: support completing fully qualified non-fast-forward refspecs

2017-03-23 Thread SZEDER Gábor
) that has all the necessary parameters to do the right thing in all cases mentioned above, including non-fast-forward fully qualified refspecs. This new function can also easier benefit from optimizations coming later in this patch series. Signed-off-by: SZEDER Gábor <szeder@gmail.com&

[PATCHv2 01/14] completion: remove redundant __gitcomp_nl() options from _git_commit()

2017-03-23 Thread SZEDER Gábor
Those two options are specifying the default values that __gitcomp_nl() would use anyway when invoked with no options at all. Signed-off-by: SZEDER Gábor <szeder@gmail.com> --- contrib/completion/git-completion.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/c

[PATCHv2 05/14] completion: support excluding full refs

2017-03-23 Thread SZEDER Gábor
Commit 49416ad22 (completion: support excluding refs, 2016-08-24) made possible to complete short refs with a '^' prefix. Extend the support to full refs to make completing '^refs/...' work. Signed-off-by: SZEDER Gábor <szeder@gmail.com> --- contrib/completion/git-completion.bas

Re: [PATCH v2 2/2] doc/SubmittingPatches: show how to get a CLI commit summary

2017-03-21 Thread SZEDER Gábor
On Tue, Mar 21, 2017 at 6:58 PM, Junio C Hamano <gits...@pobox.com> wrote: > SZEDER Gábor <szeder@gmail.com> writes: > >>> The "Copy commit summary" command of gitk can be used to obtain this >>> -format. >>> +format, or this invocati

Re: [PATCH v2 2/2] doc/SubmittingPatches: show how to get a CLI commit summary

2017-03-21 Thread SZEDER Gábor
> Amend the section which describes how to get a commit summary to show > how do to that with "git show", currently the documentation only shows > how to do that with gitk. > > Signed-off-by: Ævar Arnfjörð Bjarmason > --- > Documentation/SubmittingPatches | 11 ++- > 1

[PATCHv2] pickaxe: fix segfault with '-S<...> --pickaxe-regex'

2017-03-18 Thread SZEDER Gábor
ect the new test without the fix to fail most of the time on Windows. Signed-off-by: SZEDER Gábor <szeder@gmail.com> --- Changes since v1: diff --git a/diffcore-pickaxe.c b/diffcore-pickaxe.c index 03f84b714..341529b5a 100644 --- a/diffcore-pickaxe.c +++ b/diffcore-pickaxe.c @@ -81,12 +81

Re: [PATCH] pickaxe: fix segfault with '-S<...> --pickaxe-regex'

2017-03-18 Thread SZEDER Gábor
On Sat, Mar 18, 2017 at 4:12 PM, SZEDER Gábor <szeder@gmail.com> wrote: > Make sure that the buffer size is reduced on each iteration as the > buffer pointer is advanced, thus maintaining the correct end of buffer > location. > > The new test is flaky, I've never seen it

[PATCHv2 2/2] tests: make the 'test_pause' helper work in non-verbose mode

2017-03-18 Thread SZEDER Gábor
-by: SZEDER Gábor <szeder@gmail.com> --- t/test-lib-functions.sh | 9 ++--- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh index 4a50a6104..5ee124332 100644 --- a/t/test-lib-functions.sh +++ b/t/test-lib-functi

[PATCHv2 1/2] tests: create an interactive gdb session with the 'debug' helper

2017-03-18 Thread SZEDER Gábor
-off-by: SZEDER Gábor <szeder@gmail.com> --- t/test-lib-functions.sh | 2 +- t/test-lib.sh | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh index bd357704c..4a50a6104 100644 --- a/t/test-lib-functions.sh +

Re: [PATCH] tests: create an interactive gdb session with the 'debug' helper

2017-03-18 Thread SZEDER Gábor
On Fri, Mar 17, 2017 at 3:55 PM, Jeff King <p...@peff.net> wrote: > On Fri, Mar 17, 2017 at 03:46:46PM +0100, SZEDER Gábor wrote: > >> The 'debug' test helper is supposed to facilitate debugging by running >> a command of the test suite under gdb. Unfortunately, its u

[PATCH] pickaxe: fix segfault with '-S<...> --pickaxe-regex'

2017-03-18 Thread SZEDER Gábor
ails, 2016-09-21). And based on that commit message I would expect the new test without the fix to fail reliably on Windows. Signed-off-by: SZEDER Gábor <szeder@gmail.com> --- diffcore-pickaxe.c | 5 - t/t4062-diff-pickaxe.sh | 5 + 2 files changed, 9 insertions(+), 1 d

[PATCH] tests: create an interactive gdb session with the 'debug' helper

2017-03-17 Thread SZEDER Gábor
, see 781f76b15 (test-lib: redirect stdin of tests, 2011-12-15)). Re-attach the original standard input in the debug helper, thus creating an interactive gdb session, which is much much more useful. Signed-off-by: SZEDER Gábor <szeder@gmail.com> --- t/test-lib-functions.sh | 2 +-

Re: git-clone --config order & fetching extra refs during initial clone

2017-03-10 Thread SZEDER Gábor
On Mon, Feb 27, 2017 at 10:12 PM, Jeff King wrote: > I didn't actually review it very carefully before, but I'll do so now > (spoiler: a few nits, but it looks fine). > >> static struct ref *wanted_peer_refs(const struct ref *refs, >> - struct refspec *refspec) >> +

Re: [PATCH v2 2/2] completion: checkout: complete paths when ref given

2017-02-15 Thread SZEDER Gábor
On Tue, Feb 14, 2017 at 10:24 PM, wrote: > + *) > + __git_complete_tree_file "$ref" "$cur" > + ;; There is one more caveat here. Both our __git_complete_index_file() and Bash's builtin filename completion

Re: [PATCH] completion: restore removed line continuating backslash

2017-02-15 Thread SZEDER Gábor
On Wed, Feb 15, 2017 at 3:41 AM, Junio C Hamano <gits...@pobox.com> wrote: > SZEDER Gábor <szeder@gmail.com> writes: > >>> If you feel uncomfortable and want these to cook longer, please tell >>> me so. >> >> Well, it was mainly my surp

Re: [PATCH v2 2/2] completion: checkout: complete paths when ref given

2017-02-14 Thread SZEDER Gábor
On Tue, Feb 14, 2017 at 10:24 PM, wrote: > From: Cornelius Weig > > Git-checkout completes words starting with '--' as options and other > words as refs. Even after specifying a ref, further words not starting > with '--' are completed as

Re: [PATCH] completion: restore removed line continuating backslash

2017-02-14 Thread SZEDER Gábor
On Mon, Feb 13, 2017 at 9:45 PM, Junio C Hamano <gits...@pobox.com> wrote: > SZEDER Gábor <szeder@gmail.com> writes: > >> Recent commit 1cd23e9e0 (completion: don't use __gitdir() for git >> commands, 2017-02-03) rewrapped a couple of long lines, and while >&g

Re: [PATCH] completion: complete modified files for checkout with '--'

2017-02-13 Thread SZEDER Gábor
On Tue, Feb 14, 2017 at 12:33 AM, wrote: > From: Cornelius Weig > > The command line completion for git-checkout bails out when seeing '--' > as an isolated argument. For git-checkout this signifies the start of a > list of files which are

Re: [PATCH] squash! completion: fill COMPREPLY directly when completing refs

2017-02-13 Thread SZEDER Gábor
On Fri, Feb 10, 2017 at 10:44 PM, Junio C Hamano wrote: > Should I expect a reroll to come, or is this the only fix-up to the > series that begins at <20170203025405.8242-1-szeder@gmail.com>? > > No hurries. Yes, definitely. I found a minor bug in the middle of the

[PATCH] completion: restore removed line continuating backslash

2017-02-13 Thread SZEDER Gábor
Recent commit 1cd23e9e0 (completion: don't use __gitdir() for git commands, 2017-02-03) rewrapped a couple of long lines, and while doing so it inadvertently removed a '\' from the end of a line, thus breaking completion for 'git config remote.name.push '. Signed-off-by: SZEDER Gábor <sze

Re: What's cooking in git.git (Feb 2017, #02; Mon, 6)

2017-02-06 Thread SZEDER Gábor
> * sg/completion-refs-speedup (2017-02-06) 13 commits > - squash! completion: fill COMPREPLY directly when completing refs > - completion: fill COMPREPLY directly when completing refs > - completion: list only matching symbolic and pseudorefs when completing refs > - completion: let

Re: [PATCH 00/12] completion: speed up refs completion

2017-02-06 Thread SZEDER Gábor
On Mon, Feb 6, 2017 at 7:31 PM, Jacob Keller wrote: > On Fri, Feb 3, 2017 at 7:15 PM, Jacob Keller wrote: >> I haven't had a chance to further investigate, but I tried this series >> out (from your github) and it appears that this series (or the >>

[PATCH] squash! completion: fill COMPREPLY directly when completing refs

2017-02-06 Thread SZEDER Gábor
Care should be taken, though, because that prefix might contain 'for-each-ref' format specifiers as part of the left hand side of a '..' range or '...' symmetric difference notation or fetch/push/etc. refspec, e.g. 'git log "evil-%(refname)..br'. Doubling every '%' in the prefix will prevent 'git

[PATCH 04/12] completion: support excluding full refs

2017-02-02 Thread SZEDER Gábor
Commit 49416ad22 (completion: support excluding refs, 2016-08-24) made possible to complete short refs with a '^' prefix. Extend the support to full refs to make completing '^refs/...' work. Signed-off-by: SZEDER Gábor <szeder@gmail.com> --- contrib/completion/git-completion.bas

[PATCH 05/12] completion: don't disambiguate tags and branches

2017-02-02 Thread SZEDER Gábor
and branches in __git_tags() and __git_heads(). Signed-off-by: SZEDER Gábor <szeder@gmail.com> --- contrib/completion/git-completion.bash | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash

[PATCH 08/12] completion: let 'for-each-ref' strip the remote name from remote branches

2017-02-02 Thread SZEDER Gábor
0m8.191s user0m4.638s sys 0m2.918s After: real0m6.187s user0m3.358s sys 0m2.121s Signed-off-by: SZEDER Gábor <szeder@gmail.com> --- contrib/completion/git-completion.bash | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff

[PATCH 06/12] completion: don't disambiguate short refs

2017-02-02 Thread SZEDER Gábor
Signed-off-by: SZEDER Gábor <szeder@gmail.com> --- contrib/completion/git-completion.bash | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 19799e3ba..d55eadfd1 100644 --- a/c

[PATCH 12/12] completion: fill COMPREPLY directly when completing refs

2017-02-02 Thread SZEDER Gábor
0m0.076s Signed-off-by: SZEDER Gábor <szeder@gmail.com> --- contrib/completion/git-completion.bash | 54 -- contrib/completion/git-completion.zsh | 9 ++ t/t9902-completion.sh | 16 ++ 3 files changed, 64 insertions(

[PATCH 03/12] completion: support completing full refs after '--option=refs/'

2017-02-02 Thread SZEDER Gábor
this new parameter the 4. positional parameter and leave the 3. as an ignored placeholder for now (it will be used later in this patch series). Signed-off-by: SZEDER Gábor <szeder@gmail.com> --- contrib/completion/git-completion.bash | 21 ++--- t/t9902-complet

[PATCH 11/12] completion: list only matching symbolic and pseudorefs when completing refs

2017-02-02 Thread SZEDER Gábor
the current word to be completed, as it will allow us to optimize how refs are placed into the COMPREPLY array. Signed-off-by: SZEDER Gábor <szeder@gmail.com> --- contrib/completion/git-completion.bash | 20 t/t9902-completion.sh | 4 2 files chang

[PATCH 07/12] completion: let 'for-each-ref' and 'ls-remote' filter matching refs

2017-02-02 Thread SZEDER Gábor
full remote refs via 'git ls-remote'). Signed-off-by: SZEDER Gábor <szeder@gmail.com> --- contrib/completion/git-completion.bash | 14 +++-- t/t9902-completion.sh | 102 + 2 files changed, 111 insertions(+), 5 deletions(-) diff --git a/c

[PATCH 02/12] completion: wrap __git_refs() for better option parsing

2017-02-02 Thread SZEDER Gábor
refs2() helper. Signed-off-by: SZEDER Gábor <szeder@gmail.com> --- contrib/completion/git-completion.bash | 102 --- t/t9902-completion.sh | 106 + 2 files changed, 173 insertions(+), 35 deletions(-) diff --git a/co

[PATCH 10/12] completion: let 'for-each-ref' sort remote branches for 'checkout' DWIMery

2017-02-02 Thread SZEDER Gábor
: real0m2.781s user0m1.826s sys 0m0.136s Signed-off-by: SZEDER Gábor <szeder@gmail.com> --- contrib/completion/git-completion.bash | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contrib/completion/git-completion.bash b/contrib/completi

[PATCH 09/12] completion: let 'for-each-ref' filter remote branches for 'checkout' DWIMery

2017-02-02 Thread SZEDER Gábor
0m0.750s user0m0.015s sys 0m0.090s Signed-off-by: SZEDER Gábor <szeder@gmail.com> --- contrib/completion/git-completion.bash | 12 +++- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/contrib/completion/git-completion.bash b/contrib/completi

[PATCH 00/12] completion: speed up refs completion

2017-02-02 Thread SZEDER Gábor
is also available at: https://github.com/szeder/git completion-refs-speedup SZEDER Gábor (12): completion: remove redundant __gitcomp_nl() options from _git_commit() completion: wrap __git_refs() for better option parsing completion: support completing full refs after '--option=refs

[PATCH 01/12] completion: remove redundant __gitcomp_nl() options from _git_commit()

2017-02-02 Thread SZEDER Gábor
Those two options are specifying the default values that __gitcomp_nl() would use anyway when invoked with no options at all. Signed-off-by: SZEDER Gábor <szeder@gmail.com> --- contrib/completion/git-completion.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/c

[PATCHv2 14/21] completion: fix completion after 'git -C '

2017-02-02 Thread SZEDER Gábor
line will not be utterly disrupted by those error messages. Signed-off-by: SZEDER Gábor <szeder@gmail.com> --- contrib/completion/git-completion.bash | 8 t/t9902-completion.sh | 7 ++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/contrib/com

[PATCHv2 09/21] completion: respect 'git --git-dir=' when listing remote refs

2017-02-02 Thread SZEDER Gábor
the necessary checks of the remote in __git_refs(). Though __git_refs() was the last remaining callsite that passed a remote to __gitdir(), don't delete __gitdir()'s remote-handling part yet, just in case some users' custom completion scriptlets depend on it. Signed-off-by: SZEDER Gábor <sze

[PATCHv2 01/21] completion: improve __git_refs()'s in-code documentation

2017-02-02 Thread SZEDER Gábor
That "first argument is passed to __gitdir()" statement in particular is not really helpful, and after this series it won't be the case anyway. Signed-off-by: SZEDER Gábor <szeder@gmail.com> --- contrib/completion/git-completion.bash | 8 +--- 1 file changed, 5 insertions

[PATCHv2 06/21] completion tests: add tests for the __git_refs() helper function

2017-02-02 Thread SZEDER Gábor
-by: SZEDER Gábor <szeder@gmail.com> --- t/t9902-completion.sh | 265 +- 1 file changed, 264 insertions(+), 1 deletion(-) diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh index f7f7d49fb..7956cb9b1 100755 --- a/t/t9902-completion.sh +

[PATCHv2 08/21] completion: fix most spots not respecting 'git --git-dir='

2017-02-02 Thread SZEDER Gábor
' in __gitdir() itself. Signed-off-by: SZEDER Gábor <szeder@gmail.com> --- contrib/completion/git-completion.bash | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 5b2

[PATCHv2 20/21] completion: extract repository discovery from __gitdir()

2017-02-02 Thread SZEDER Gábor
that this change doesn't alter __gitdir()'s behavior. Signed-off-by: SZEDER Gábor <szeder@gmail.com> --- contrib/completion/git-completion.bash | 42 +- t/t9902-completion.sh | 22 +- 2 files changed, 42 insertions(+), 22 deletions(-)

[PATCHv2 10/21] completion: list refs from remote when remote's name matches a directory

2017-02-02 Thread SZEDER Gábor
argument matches the name of a configured remote. Use this helper to decide how to handle the remote passed to __git_refs(). Signed-off-by: SZEDER Gábor <szeder@gmail.com> --- contrib/completion/git-completion.bash | 20 ++-- t/t9902-completion.sh

[PATCHv2 19/21] completion: don't guard git executions with __gitdir()

2017-02-02 Thread SZEDER Gábor
these functions, sparing the fork()+exec() overhead of the command substitution and the potential 'git rev-parse' execution. Signed-off-by: SZEDER Gábor <szeder@gmail.com> --- contrib/completion/git-completion.bash | 32 +++- 1 file changed, 11 insertions(

[PATCHv2 15/21] rev-parse: add '--absolute-git-dir' option

2017-02-02 Thread SZEDER Gábor
automatically or is specified via $GIT_DIR or 'git --git-dir='. Signed-off-by: SZEDER Gábor <szeder@gmail.com> --- Documentation/git-rev-parse.txt | 4 builtin/rev-parse.c | 26 ++ t/t1500-rev-parse.sh| 17 + 3 files chang

[PATCHv2 17/21] completion: don't use __gitdir() for git commands

2017-02-02 Thread SZEDER Gábor
from. Although one-shot variable assignments in front of shell functions are to be avoided in our scripts in general, in the Bash completion script we can do that safely. Signed-off-by: SZEDER Gábor <szeder@gmail.com> --- contrib/completion/git-completion.bash | 60

[PATCHv2 13/21] completion: don't offer commands when 'git --opt' needs an argument

2017-02-02 Thread SZEDER Gábor
Signed-off-by: SZEDER Gábor <szeder@gmail.com> --- contrib/completion/git-completion.bash | 11 +++ 1 file changed, 11 insertions(+) diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 4ded44977..7d25b33b8 100644 --- a/contri

[PATCHv2 18/21] completion: consolidate silencing errors from git commands

2017-02-02 Thread SZEDER Gábor
through __git() already have their standard error silenced. Signed-off-by: SZEDER Gábor <szeder@gmail.com> --- contrib/completion/git-completion.bash | 28 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/contrib/completion/git-completion.bash b/c

[PATCHv2 21/21] completion: cache the path to the repository

2017-02-02 Thread SZEDER Gábor
optional remote argument, because users' custom completion scriptlets might depend on it. Signed-off-by: SZEDER Gábor <szeder@gmail.com> --- contrib/completion/git-completion.bash | 46 ++ t/t9902-completion.sh | 161 + 2 files c

[PATCHv2 04/21] completion tests: consolidate getting path of current working directory

2017-02-02 Thread SZEDER Gábor
the path of the trash directory in a variable, and use that variable in all __gitdir() tests. Signed-off-by: SZEDER Gábor <szeder@gmail.com> --- t/t9902-completion.sh | 44 +--- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/t

[PATCHv2 02/21] completion tests: don't add test cruft to the test repository

2017-02-02 Thread SZEDER Gábor
the files we are actually interested in. Signed-off-by: SZEDER Gábor <szeder@gmail.com> --- t/t9902-completion.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh index a34e55f87..f490c1d05 100755 --- a/t/t9902-complet

[PATCHv2 00/21] completion: various __gitdir()-related improvements

2017-02-02 Thread SZEDER Gábor
/CANoM8SXO_Rz_CVOz9ptsaVCzcQ2D1FQrSuFFW4vZ4SdRYMzD=w...@mail.gmail.com/ [3] - http://public-inbox.org/git/20160518185825.horde.epd2njnvqew_vx4b01yw...@webmail.informatik.kit.edu/ SZEDER Gábor (21): completion: improve __git_refs()'s in-code documentation completion tests: don't add test cruft to the test repository completion tests

[PATCHv2 05/21] completion tests: check __gitdir()'s output in the error cases

2017-02-02 Thread SZEDER Gábor
The __gitdir() helper function shouldn't output anything if not in a git repository. The relevant tests only checked its error code, so extend them to ensure that there's no output. Signed-off-by: SZEDER Gábor <szeder@gmail.com> --- t/t9902-completion.sh | 8 +--- 1 file chan

[PATCHv2 03/21] completion tests: make the $cur variable local to the test helper functions

2017-02-02 Thread SZEDER Gábor
' is bashism, of course, but the tests of the Bash completion script are run under Bash anyway, and there are already other variables declared local in this test script. Signed-off-by: SZEDER Gábor <szeder@gmail.com> --- t/t9902-completion.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 del

[PATCHv2 07/21] completion: ensure that the repository path given on the command line exists

2017-02-02 Thread SZEDER Gábor
printing anything to stdout if it doesn't. Signed-off-by: SZEDER Gábor <szeder@gmail.com> --- contrib/completion/git-completion.bash | 1 + t/t9902-completion.sh | 8 2 files changed, 9 insertions(+) diff --git a/contrib/completion/git-completion.bash b/c

[PATCHv2 16/21] completion: respect 'git -C '

2017-02-02 Thread SZEDER Gábor
don't need these '-C ' options, because __gitdir() already took those options into account. It would not hurt them, either, but let's not induce unnecessary code churn. Signed-off-by: SZEDER Gábor <szeder@gmail.com> --- contrib/completion/git-completion.bash | 19 ++-- t/t9902-complet

[PATCHv2 11/21] completion: don't list 'HEAD' when trying refs completion outside of a repo

2017-02-02 Thread SZEDER Gábor
When refs completion is attempted while not in a git repository, the completion script offers 'HEAD' erroneously. Check early in __git_refs() that there is either a repository or a remote to work on, and return early if neither is given. Signed-off-by: SZEDER Gábor <szeder@gmail.

<    3   4   5   6   7   8   9   10   11   12   >