Re: [PATCH v2] completion: Add '--edit-todo' to rebase

2015-07-30 Thread SZEDER Gábor
Quoting Thomas Braun : Signed-off-by: Thomas Braun --- John Keeping hat am 13. Juli 2015 um 15:11 geschrieben: git-rebase.sh contains: if test "$action" = "edit-todo" && test "$type" != "interactive" then die "$(gettext "The --edit-todo action can only be use

Re: [PATCH v2] completion: Add '--edit-todo' to rebase

2015-07-31 Thread SZEDER Gábor
Quoting John Keeping : On Thu, Jul 30, 2015 at 01:24:03PM +0200, SZEDER Gábor wrote: Quoting Thomas Braun : Signed-off-by: Thomas Braun --- John Keeping hat am 13. Juli 2015 um 15:11 geschrieben: git-rebase.sh contains: if test "$action" = "edit-todo&

Re: [PATCH v2] completion: Add '--edit-todo' to rebase

2015-08-01 Thread SZEDER Gábor
Quoting Thomas Braun : Am 31.07.2015 um 12:16 schrieb SZEDER Gábor: Anyway, so this could be something like (modulo likely whitespace damage): diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 07c34ef913..fac01d6985 100644 --- a/contrib

[PATCHv3 1/2] config: add '--names-only' option to list only variable names

2015-08-10 Thread SZEDER Gábor
the completion script, and shell scripts in general, by introducing the '--names-only' option to modify the output of '--list' and '--get-regexp' to list only the names of config variables, so they don't have to perform error-prone post processing to separate vari

[PATCHv3 0/2] 'git config --names-only' to help the completion script

2015-08-10 Thread SZEDER Gábor
eorganized the commit messages: don't go into details of the completion bug in the first patch modifying builtin/config.c, talk about that in the second patch. SZEDER Gábor (2): config: add '--names-only' option to list only variable names completion: list va

[PATCHv3 2/2] completion: list variable names reliably with 'git config --names-only'

2015-08-10 Thread SZEDER Gábor
se 'git config --get-regexp' is run and lines in its output are simply stripped after the first space, so subsequent lines don't even have to contain '.' and '=' to fool the completion script. Use the new '--names-only' option added in the previous commit to l

Re: [PATCHv3 1/2] config: add '--names-only' option to list only variable names

2015-08-12 Thread SZEDER Gábor
Quoting Junio C Hamano : SZEDER Gábor writes: 'git config' can only show values or name-value pairs, so if a shell script needs the names of set config variables it has to run 'git config --list' or '--get-regexp' and parse the output to separate config va

[PATCH] describe: make '--always' fallback work after '--exact-match' failed

2015-08-20 Thread SZEDER Gábor
instead of erroring out when the commit cannot be described with '--exact-match --always'. Signed-off-by: SZEDER Gábor --- builtin/describe.c | 2 +- t/t6120-describe.sh | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/builtin/describe.c b/builtin/describe.c index

Minor builtin 'git am' side-effect

2015-08-20 Thread SZEDER Gábor
Hi, The format of the files '.git/rebase-apply/{next,last}' changed slightly with the recent builtin 'git am' conversion: while these files were newline-terminated when written by the scripted version, the ones written by the builtin are not. This probably makes no difference for shell scripts

[PATCH] t3020: fix typo in test description

2015-08-20 Thread SZEDER Gábor
Signed-off-by: SZEDER Gábor --- t/t3020-ls-files-error-unmatch.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/t3020-ls-files-error-unmatch.sh b/t/t3020-ls-files-error-unmatch.sh index ca01053bcc..124e73b8e6 100755 --- a/t/t3020-ls-files-error-unmatch.sh +++ b/t/t3020

[PATCH] wt-status: move #include "pathspec.h" to the header

2015-08-20 Thread SZEDER Gábor
The declaration of 'struct wt_status' requires the declararion of 'struct pathspec'. Signed-off-by: SZEDER Gábor --- wt-status.c | 1 - wt-status.h | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/wt-status.c b/wt-status.c index 717fd48d13..c327fe8128 1006

[PATCH] config: restructure format_config() for better control flow

2015-08-20 Thread SZEDER Gábor
key-value delimiter to make the function easier to read. Signed-off-by: SZEDER Gábor --- > The topic is now in 'next'; I think I've locally fixed it up for > these when I originally queued them a few days ago, so if there are > any remaining issues, please throw incremental polis

Re: [PATCH] wt-status: move #include "pathspec.h" to the header

2015-08-20 Thread SZEDER Gábor
Quoting Junio C Hamano : SZEDER Gábor writes: The declaration of 'struct wt_status' requires the declararion of 'struct pathspec'. I think this is fine. I am guessing that you are saying it is wrong to force wt-status.c to include pathspec.h before including wt-stat

Re: [PATCH] describe: make '--always' fallback work after '--exact-match' failed

2015-08-21 Thread SZEDER Gábor
Quoting Junio C Hamano : SZEDER Gábor writes: 'git describe [...] --always' should always show the unique abbreviated object name as a fallback when the given commit cannot be described with the given set of options, see da2478dbb0 (describe --always: fall back to showing an a

Re: [PATCH 2/3] format_config: simplify buffer handling

2015-08-21 Thread SZEDER Gábor
Quoting Jeff King : When formatting a config value into a strbuf, we may end up stringifying it into a fixed-size buffer using sprintf, and then copying that buffer into the strbuf. We can eliminate the middle-man (and drop some calls to sprintf!) by writing directly to the strbuf. The reason

[PATCH] describe --contains: default to HEAD when no commit-ish is given

2015-08-21 Thread SZEDER Gábor
nd line to make '--contains' behave consistently with other 'git describe' options. 'git describe's short help already indicates that the commit-ish is optional, but the synopsis in the man page doesn't, so update it accordingly as well. Signed-off-by: SZEDER Gáb

Re: [RFC/PATCH] contrib: teach completion about git-worktree options and arguments

2015-08-21 Thread SZEDER Gábor
Quoting Junio C Hamano : Eric Sunshine writes: On Thu, Jul 23, 2015 at 4:49 PM, Eric Sunshine wrote: Complete subcommands 'add' and 'prune', as well as their respective options --force, --detach, --dry-run, --verbose, and --expire. Also complete 'refname' in "git worktree add [-b ] ".

[PoC PATCH] completion: support 'git worktree'

2015-08-21 Thread SZEDER Gábor
Signed-off-by: SZEDER Gábor --- > I wrote a completion function for 'git worktree' as well, turns out a week > or two before you posted this, but I never submitted it as it was way too > convoluted. Anyway, will send it in reply to this, just for reference. And here it is.

Re: [PATCH] am: terminate state files with a newline

2015-08-23 Thread SZEDER Gábor
Hi, Quoting Paul Tan : Did we ever explictly allow external programs to poke around the contents of the .git/rebase-apply directory? I think it may not be so good, as it means that it may not be possible to switch the storage format in the future (e.g. to allow atomic modifications, maybe?) :-/

Re: [PATCH] describe --contains: default to HEAD when no commit-ish is given

2015-08-24 Thread SZEDER Gábor
Quoting Junio C Hamano : @@ -443,10 +443,13 @@ int cmd_describe(int argc, const char **argv, const char *prefix) if (pattern) argv_array_pushf(&args, "--refs=refs/tags/%s", pattern); } - while (*argv) { -

[PATCH v2] describe --contains: default to HEAD when no commit-ish is given

2015-08-24 Thread SZEDER Gábor
d line to make '--contains' behave consistently with other 'git describe' options. While at it, use argv_array_pushv() instead of the loop to pass commit-ishes to 'git name-rev'. 'git describe's short help already indicates that the commit-ish is optional, b

Re: [PATCH] stash: Add stash.showFlag config variable

2015-08-27 Thread SZEDER Gábor
Hi, I haven't made up my mind about this feature yet, but have a few comments about its implementation. > diff --git a/git-stash.sh b/git-stash.sh > index 1d5ba7a..8432435 100755 > --- a/git-stash.sh > +++ b/git-stash.sh > @@ -33,6 +33,12 @@ else > reset_color= > fi > > +if git config

[PATCH] completion: fix completion after 'git -C path'

2015-10-05 Thread SZEDER Gábor
ture, then at least the command line will not be utterly disrupted by those error messages. Note, that this change merely fixes the breakage related to 'git -C path', but the completion script will not take it into account as it does '--git-dir path'. Signed-off-by: SZEDER Gábor -

Re: [PATCH] completion: fix completion after 'git -C path'

2015-10-06 Thread SZEDER Gábor
Quoting Michael J Gruber : SZEDER Gábor venit, vidit, dixit 05.10.2015 14:02: The main completion function finds the name of the git command by iterating through all the words on the command line in search for the first non-option-looking word. As it is not aware of 'git -C's mand

Re: [PATCH v2 1/2] completion: Add sequencer function

2015-05-30 Thread SZEDER Gábor
Quoting Thomas Braun : Signed-off-by: Thomas Braun --- contrib/completion/git-completion.bash | 48 +++--- 1 file changed, 33 insertions(+), 15 deletions(-) I don't see the benefits of this change. This patch adds more than twice as many lines as it removes

Re: [PATCH v2 1/2] completion: Add sequencer function

2015-06-01 Thread SZEDER Gábor
Quoting Junio C Hamano : SZEDER Gábor writes: I don't see the benefits of this change. This patch adds more than twice as many lines as it removes, and patch 2/2 adds 8 new lines although it could get away with only 5 without this function. To offer sequencer options we current

[PATCH] commit: cope with scissors lines in commit message

2015-06-07 Thread SZEDER Gábor
ecause a "real" scissors line added by 'git commit --verbose' might follow, and in that case the diff and submodule shortlog get included in the commit message. Don't bail out if a scissors line doesn't start at the beginning of the line, but keep looking for a non-indented

[PATCH] completion: teach 'scissors' mode to 'git commit --cleanup='

2015-06-07 Thread SZEDER Gábor
Signed-off-by: SZEDER Gábor --- contrib/completion/git-completion.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index bfc74e9d57..a1098765f6 100644 --- a/contrib/completion/git

Re: [PATCH] commit: cope with scissors lines in commit message

2015-06-08 Thread SZEDER Gábor
Quoting Junio C Hamano : SZEDER Gábor writes: The diff and submodule shortlog appended to the commit message template by 'git commit --verbose' are not stripped when the commit message contains an indented scissors line. When cleaning up a commit message with 'git commi

[PATCH v2] commit: cope with scissors lines in commit message

2015-06-08 Thread SZEDER Gábor
s on the first line as well. Helped-by: Junio C Hamano Signed-off-by: SZEDER Gábor --- Changes besides incorporating Junio's suggestion and updating the commit message accordingly: * Instead of adding a new test, modify the existing one to check handling indented scissors lines.

[PATCH v3] commit: cope with scissors lines in commit message

2015-06-08 Thread SZEDER Gábor
s on the first line as well. Helped-by: Junio C Hamano Signed-off-by: SZEDER Gábor --- Fixed a typo in the commit message. t/t7502-commit.sh | 24 +++- wt-status.c | 9 + 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/t/t7502-commit.sh b/t/t7502

rebase -i might leave CHERRY_PICK_HEAD behind

2015-06-16 Thread SZEDER Gábor
Hi, When skipping an empty commit with 'git rebase --continue' a CHERRY_PICK_HEAD file might be left behind. What I did boils down to this: echo one >file git add file git commit -m first echo two >file git commit -a -m second echo three >file git commit -a -m third

Re: [PATCH] git-prompt.sh: Document GIT_PS1_STATESEPARATOR

2015-06-16 Thread SZEDER Gábor
Quoting Joe Cridge : The environment variable GIT_PS1_STATESEPARATOR can be used to set the separator between the branch name and the state symbols in the prompt. At present the variable is not mentioned in the inline documentation which makes it difficult for the casual user to identify. Tha

Re: [PATCH 2/2] rebase -i: do not leave a CHERRY_PICK_HEAD file behind

2015-06-17 Thread SZEDER Gábor
Hi, Quoting Johannes Schindelin : When skipping commits whose changes were already applied via `git rebase --continue`, we need to clean up said file explicitly. The same is not true for `git rebase --skip` because that will execute `git reset --hard` as part of the "skip" handling in git-rebas

Re: Git completion not using ls-remote to auto-complete during push

2015-06-18 Thread SZEDER Gábor
Quoting Robert Dailey > I do the following: > > $ git push origin :topic > > If I stop halfway through typing 'topic' and hit TAB, auto-completion > does not work if I do not have a local branch by that name (sometimes > I delete my local branch first, then I push to delete it remotely). I > tho

Re: Git completion not using ls-remote to auto-complete during push

2015-06-18 Thread SZEDER Gábor
Quoting Robert Dailey : On Thu, Jun 18, 2015 at 6:29 AM, SZEDER Gábor wrote: Quoting Robert Dailey I do the following: $ git push origin :topic If I stop halfway through typing 'topic' and hit TAB, auto-completion does not work if I do not have a local branch by that name (s

[PATCH 1/2] bash prompt: test untracked files status indicator with untracked dirs

2015-07-19 Thread SZEDER Gábor
cked files status indicator. Signed-off-by: SZEDER Gábor --- t/t9903-bash-prompt.sh | 25 + 1 file changed, 25 insertions(+) diff --git a/t/t9903-bash-prompt.sh b/t/t9903-bash-prompt.sh index 49d58e6726..6b68777b98 100755 --- a/t/t9903-bash-prompt.sh +++ b/t/t9903-bash

[PATCH 2/2] bash prompt: faster untracked status indicator with untracked directories

2015-07-19 Thread SZEDER Gábor
nmatch -- ':/*' >/dev/null 2>/dev/null real 0m0.010s user 0m0.008s sys 0m0.000s This follows suit of ea95c7b8f5 (completion: improve untracked directory filtering for filename completion, 2013-09-18). Signed-off-by: SZEDER Gábor --- contrib/completion/git-prompt.sh | 2 +

Re: [PATCHv2 0/7] Fix and generalize version sort reordering

2016-12-20 Thread SZEDER Gábor
On Wed, Dec 14, 2016 at 6:08 PM, Jeff King wrote: > On Thu, Dec 08, 2016 at 03:23:54PM +0100, SZEDER Gábor wrote: > >> > With my patches it looks like this: >> > >> > $ git -c versionsort.prereleasesuffix=-pre \ >> > -c versionsort.prerele

Re: [PATCH] git-prompt.sh: add submodule indicator

2017-01-20 Thread SZEDER Gábor
I'm not well-versed in submodules, so I won't comment on whether this is the right way to determine that a repository is a submodule, but I was surprised to see how much you have to work to find this out. My comments will mostly focus on how to eliminate or at least limit the scope of subshells an

Re: [PATCH 2/2] ref-filter: add function to parse atoms from a nul-terminated string

2017-01-26 Thread SZEDER Gábor
On Wed, Dec 7, 2016 at 5:09 PM, SZEDER Gábor wrote: > ref-filter's parse_ref_filter_atom() function parses an atom between > the start and end pointers it gets as arguments. This is fine for two > of its callers, which process '%(atom)' format specifiers and the end >

Re: [PATCH 2/4] git-prompt.sh: rework of submodule indicator

2017-01-31 Thread SZEDER Gábor
> Rework of the first patch. The prompt now will look like this: > (+name:master). I tried to considere all suggestions. > Tests still missing. > > Signed-off-by: Benjamin Fuchs > --- > contrib/completion/git-prompt.sh | 49 > > 1 file changed, 24 inser

Re: [PATCH 4/4] git-prompt.sh: add tests for submodule indicator

2017-01-31 Thread SZEDER Gábor
On Mon, Jan 30, 2017 at 9:44 PM, Benjamin Fuchs wrote: > Signed-off-by: Benjamin Fuchs > --- > t/t9903-bash-prompt.sh | 43 +++ > 1 file changed, 43 insertions(+) > > diff --git a/t/t9903-bash-prompt.sh b/t/t9903-bash-prompt.sh > index 97c9b32..4dce366 100

[PATCH] .mailmap: update Gábor Szeder's email address

2017-01-31 Thread SZEDER Gábor
Signed-off-by: SZEDER Gábor --- .mailmap | 1 + 1 file changed, 1 insertion(+) diff --git a/.mailmap b/.mailmap index 9c87a3840..ab59b2fac 100644 --- a/.mailmap +++ b/.mailmap @@ -225,6 +225,7 @@ Steven Walter Steven Walter Sven Verdoolaege Sven Verdoolaege +SZEDER Gábor Tay Ray

Re: [PATCH v2 7/7] completion: recognize more long-options

2017-01-31 Thread SZEDER Gábor
On Fri, Jan 27, 2017 at 10:17 PM, wrote: > From: Cornelius Weig > > Recognize several new long-options for bash completion in the following > commands: Adding more long options that git commands learn along the way is always an improvement. However, seeing "_several_ new long options" (or "som

Re: [PATCH 3/7] completion: improve bash completion for git-add

2017-01-31 Thread SZEDER Gábor
> Add some long-options for git-add and improve path completion when the > --update flag is given. Please tell us in the commit message _how_ this improves path completion. > --- > contrib/completion/git-completion.bash | 10 +++--- > 1 file changed, 7 insertions(+), 3 deletions(-) > > diff

Re: [PATCH 2/7] completion: add subcommand completion for rerere

2017-02-01 Thread SZEDER Gábor
> Managing recorded resolutions requires command-line usage of git-rerere. > Added subcommand completion for rerere and path completion for its > subcommand forget. > --- > contrib/completion/git-completion.bash | 11 +++ > 1 file changed, 11 insertions(+) > > diff --git a/contrib/complet

Re: [PATCH 6/7] completion: teach remote subcommands option completion

2017-02-01 Thread SZEDER Gábor
> Git-remote needs to complete remote names, its subcommands, and options > thereof. In addition to the existing subcommand and remote name > completion, do also complete the options > > - add: --track --master --fetch --tags --no-tags --mirror= Oh, '--track' and '--master' are not even in the

Re: [PATCH 4/7] completion: teach ls-remote to complete options

2017-02-01 Thread SZEDER Gábor
> ls-remote needs to complete remote names and its own options. And refnames, too. > In > addition to the existing remote name completions, do also complete > the options --heads, --tags, --refs, and --get-url. Why only these four options and not the other four? There are eight options in tota

Re: [PATCH v2 7/7] completion: recognize more long-options

2017-02-01 Thread SZEDER Gábor
On Wed, Feb 1, 2017 at 5:49 PM, Cornelius Weig wrote: > Hi Gabor, > > thanks for taking a look at these commits. > > On 01/31/2017 11:17 PM, SZEDER Gábor wrote: >> On Fri, Jan 27, 2017 at 10:17 PM, wrote: >>> From: Cornelius Weig >>> >>> Recogn

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

2017-02-02 Thread SZEDER Gábor
git ls-tree' used for completing the 'ref:path' notation. The other git commands executed in the completion script 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 unnece

[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 --- contrib/comp

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

2017-02-02 Thread SZEDER Gábor
return with error without printing anything to stdout if it doesn't. Signed-off-by: SZEDER Gábor --- contrib/completion/git-completion.bash | 1 + t/t9902-completion.sh | 8 2 files changed, 9 insertions(+) diff --git a/contrib/completion/git-completion.

[PATCHv2 12/21] completion: list short refs from a remote given as a URL

2017-02-02 Thread SZEDER Gábor
y. When the remote given to __git_refs() doesn't exist, then it will be handled by this resurrected 'git ls-remote' query. This code path doesn't list 'HEAD' unconditionally, which has the nice side effect of fixing two more expected test failures. Signed-off-b

[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 --- t/t9902-completion.sh | 8 +--- 1 file changed, 5 insertions(+), 3

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

2017-02-02 Thread SZEDER Gábor
;local' 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 --- t/t9902-completion.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff

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

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

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

2017-02-02 Thread SZEDER Gábor
tests' correctness. Add only the files we are actually interested in. Signed-off-by: SZEDER Gábor --- 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/

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

2017-02-02 Thread SZEDER Gábor
-32623-1-git-send-email-sze...@ira.uka.de/T/ [2] - http://public-inbox.org/git/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 documentati

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

2017-02-02 Thread SZEDER Gábor
ot; behavior of our completion script is to not offer anything, but fall back to filename completion. Signed-off-by: SZEDER Gábor --- contrib/completion/git-completion.bash | 11 +++ 1 file changed, 11 insertions(+) diff --git a/contrib/completion/git-completion.bash b/contrib/com

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

2017-02-02 Thread SZEDER Gábor
t don't go through __git() already have their standard error silenced. Signed-off-by: SZEDER Gábor --- contrib/completion/git-completion.bash | 28 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/contrib/completion/git-completion.bash b/contrib

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

2017-02-02 Thread SZEDER Gábor
ure that it handles success and failure of __git_find_repo_path() and that it still handles its optional remote argument, because users' custom completion scriptlets might depend on it. Signed-off-by: SZEDER Gábor --- contrib/completion/git-completion.bash | 46 ++ t/t9902-com

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

2017-02-02 Thread SZEDER Gábor
-parse --git-dir' in __gitdir() itself. Signed-off-by: SZEDER Gábor --- 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 5b2bd672

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

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

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

2017-02-02 Thread SZEDER Gábor
hether its 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 --- contrib/completion/git-completion.bash | 20 ++-- t/t9902-completion.sh | 11 ++- 2 files c

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

2017-02-02 Thread SZEDER Gábor
signment to override $__git_dir with the path of the repository where the refs should come 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 ---

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

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

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

2017-02-02 Thread SZEDER Gábor
ways outputs a canonicalized absolute path to the .git directory, regardless of whether the path is discovered automatically or is specified via $GIT_DIR or 'git --git-dir='. Signed-off-by: SZEDER Gábor --- Documentation/git-rev-parse.txt | 4 builtin/rev-parse.c | 26 +

[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 --- contrib/completion/git-completion.bash | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-

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

2017-02-02 Thread SZEDER Gábor
when not in a repository. Signed-off-by: SZEDER Gábor --- 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-c

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

2017-02-02 Thread SZEDER Gábor
mand substitution. We are better off to perform all 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 completi

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

2017-02-02 Thread SZEDER Gábor
if git ever learns a new option with a mandatory argument in the future, then, though the completion script will again misbehave, at least the command line will not be utterly disrupted by those error messages. Signed-off-by: SZEDER Gábor --- contrib/completion/git-completion.bash | 8 ---

[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 --- contrib/completion/git-completion.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/completion/git

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

2017-02-02 Thread SZEDER Gábor
box.org/git/20170203024829.8071-1-szeder@gmail.com/T/ This series 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 p

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

2017-02-02 Thread SZEDER Gábor
user0m2.155s sys 0m0.183s After: real0m2.781s user0m1.826s sys 0m0.136s Signed-off-by: SZEDER Gábor --- contrib/completion/git-completion.bash | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contrib/completion/git-completion.bash b/cont

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

2017-02-02 Thread SZEDER Gábor
0m2.121s After: real0m0.750s user0m0.015s sys 0m0.090s Signed-off-by: SZEDER Gábor --- contrib/completion/git-completion.bash | 12 +++- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/contrib/completion/git-completion.bash b/contrib/comple

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

2017-02-02 Thread SZEDER Gábor
60s [1] - https://github.com/git-for-windows/git/issues/524 Signed-off-by: SZEDER Gábor --- 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 in

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

2017-02-02 Thread SZEDER Gábor
060s After: real0m0.683s user0m0.203s sys 0m0.076s Signed-off-by: SZEDER Gábor --- contrib/completion/git-completion.bash | 54 -- contrib/completion/git-completion.zsh | 9 ++ t/t9902-completion.sh | 16 ++

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

2017-02-02 Thread SZEDER Gábor
n even if the whole current word contains some kind of a prefix. Make 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 --- contrib/completion/git-completion.bash |

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

2017-02-02 Thread SZEDER Gábor
's tracking DWIMery and listing full remote refs via 'git ls-remote'). Signed-off-by: SZEDER Gábor --- contrib/completion/git-completion.bash | 14 +++-- t/t9902-completion.sh | 102 + 2 files changed, 111 insertions(+), 5

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

2017-02-02 Thread SZEDER Gábor
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 --- contrib/completion/git-completion.bash | 20 t/t9902-completion.sh | 4 2 files changed, 16 insertions(+), 8

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

2017-02-02 Thread SZEDER Gábor
her processing, which means all callsites except a single one in the __git_refs2() helper. Signed-off-by: SZEDER Gábor --- contrib/completion/git-completion.bash | 102 --- t/t9902-completion.sh | 106 + 2 files changed, 1

[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 --- contrib/completion/git-completion.bash |

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

2017-02-02 Thread SZEDER Gábor
e the 'git for-each-ref' format 'refname:strip=2' instead of 'refname:short' to avoid harmful disambiguation of tags and branches in __git_tags() and __git_heads(). Signed-off-by: SZEDER Gábor --- contrib/completion/git-completion.bash | 4 ++-- 1 file changed, 2 insertio

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

2017-02-02 Thread SZEDER Gábor
1m8.421s user0m7.591s sys 0m3.557s Before this patch: real0m8.191s user0m4.638s sys 0m2.918s After: real0m6.187s user0m3.358s sys 0m2.121s Signed-off-by: SZEDER Gábor --- contrib/completion/git-completion.bash | 7 +++

[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

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 >> previous series for __gitdir work) breaks "git l

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 'for-each-

[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

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 series, and haven't quite

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 to be checked out. Checkout of files makes only > sense

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 wrote: > SZEDER Gábor writes: > >> 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 &#x

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 refs, which is invalid for git-checkout. Refs 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 wrote: > SZEDER Gábor writes: > >>> If you feel uncomfortable and want these to cook longer, please tell >>> me so. >> >> Well, it was mainly my surprise that a 20+ patch series arriving so >> late that

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 lists matching paths like this:

Re: [PATCH 5/5] versioncmp: cope with common leading parts in versionsort.prereleaseSuffix

2016-10-04 Thread SZEDER Gábor
Quoting SZEDER Gábor : Quoting SZEDER Gábor : Version sort with prerelease reordering sometimes puts tagnames in the wrong order, when the common part of two compared tagnames ends with the leading character(s) of one or more configured prerelease suffixes. $ git config --get-all

Re: [PATCH 5/5] versioncmp: cope with common leading parts in versionsort.prereleaseSuffix

2016-10-05 Thread SZEDER Gábor
Quoting Junio C Hamano : SZEDER Gábor writes: And a final sidenote: sorting based on the longest matching suffix also allows us to (ab)use version sort with prerelease suffixes to sort postrelease tags as we please, too: $ ~/src/git/git -c versionsort.prereleasesuffix=-alpha

Re: [PATCH/RFC] git.c: support "!!" aliases that do not move cwd

2016-10-11 Thread SZEDER Gábor
Quoting Duy Nguyen : On Fri, Oct 7, 2016 at 10:55 PM, Jakub Narębski wrote: W dniu 07.10.2016 o 16:19, Johannes Schindelin pisze: On Fri, 7 Oct 2016, Jakub Narębski wrote: Note that we would have to teach git completion about new syntax; or new configuration variable if we go that route.

Re: [Bug?] git notes are not copied during rebase

2016-11-17 Thread SZEDER Gábor
> I am currently a heavy user of rebasing and noticed that my notes > don't get correctly applied, even if notes.rewrite.rebase is set > explicitly to true (though manual says that is the default). Setting 'notes.rewrite.rebase' is, as you mentioned, not necessary, but not sufficient either. See

[PATCH 2/2] ref-filter: add function to parse atoms from a nul-terminated string

2016-12-07 Thread SZEDER Gábor
o the end of that string literal is needed as well. The next patch will add yet another caller using a string literal. Add a helper function around parse_ref_filter_atom() to parse an atom up to the terminating nul, and call this helper in those two callers. Signed-off-by: SZEDER Gábor --- ref-filt

  1   2   3   4   5   6   7   8   9   10   >