aboutsummaryrefslogtreecommitdiff
path: root/contrib/completion
Commit message (Collapse)AuthorAge
* Merge branch 'ma/bash-completion-leaking-x'Junio C Hamano2015-04-20
|\ | | | | | | | | | | | | | | The completion script (in contrib/) contaminated global namespace and clobbered on a shell variable $x. * ma/bash-completion-leaking-x: completion: fix global bash variable leak on __gitcompappend
| * completion: fix global bash variable leak on __gitcompappendMárcio Almada2015-04-12
| | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'sg/completion-gitcomp-nl-for-refs'Junio C Hamano2015-03-26
|\ \ | | | | | | | | | | | | | | | | | | Code clean-up. * sg/completion-gitcomp-nl-for-refs: completion: use __gitcomp_nl() for completing refs
| * | completion: use __gitcomp_nl() for completing refsSZEDER Gábor2015-03-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We do that almost everywhere, because it's faster for large number of refs, see a31e62629 (completion: optimize refs completion, 2011-10-15). These were the last two places where we still used __gitcomp() for completing refs. Signed-off-by: SZEDER Gábor <szeder@ira.uka.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Merge branch 'ct/prompt-untracked-fix'Junio C Hamano2015-03-25
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | The prompt script (in contrib/) did not show the untracked sign when working in a subdirectory without any untracked files. * ct/prompt-untracked-fix: git prompt: use toplevel to find untracked files
| * | | git prompt: use toplevel to find untracked filesCody A Taylor2015-03-15
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | The __git_ps1() prompt function would not show an untracked state when all the untracked files are outside the current working directory. Signed-off-by: Cody A Taylor <codemister99@yahoo.com> Helped-by: SZEDER Gábor <szeder@ira.uka.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Merge branch 'js/completion-ctags-pattern-substitution-fix'Junio C Hamano2015-03-23
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code that reads from the ctags file in the completion script (in contrib/) did not spell ${param/pattern/string} substitution correctly, which happened to work with bash but not with zsh. * js/completion-ctags-pattern-substitution-fix: contrib/completion: escape the forward slash in __git_match_ctag
| * | | contrib/completion: escape the forward slash in __git_match_ctagJohn Szakmeister2015-03-14
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current definition results in an incorrect expansion of the term under zsh. For instance "/^${1////\\/}/" under zsh with the argument "hi" results in: /^/\/h/\/i/ This results in an output similar to this when trying to complete `git grep chartab` under zsh: :: git grep chartabawk: cmd. line:1: /^/\/c/\/h/\/a/\/r/\/t/\/a/\/b/ { print $1 } awk: cmd. line:1: ^ backslash not last character on line awk: cmd. line:1: /^/\/c/\/h/\/a/\/r/\/t/\/a/\/b/ { print $1 } awk: cmd. line:1: ^ syntax error Leaving the prompt in a goofy state until the user hits a key. Escaping the literal / in the parameter expansion (using "/^${1//\//\\/}/") results in: /^chartab/ allowing the completion to work correctly. This formulation also works under bash. Signed-off-by: John Szakmeister <john@szakmeister.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Merge branch 'jk/push-config'Junio C Hamano2015-03-23
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Restructure "git push" codepath to make it easier to add new configuration bits and then add push.followTags configuration that turns --follow-tags option on by default. * jk/push-config: push: allow --follow-tags to be set by config push.followTags cmd_push: pass "flags" pointer to config callback cmd_push: set "atomic" bit directly git_push_config: drop cargo-culted wt_status pointer
| * | | push: allow --follow-tags to be set by config push.followTagsDave Olszewski2015-03-14
| | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Dave Olszewski <cxreg@pobox.com> Helped-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | Merge branch 'mg/doc-status-color-slot'Junio C Hamano2015-03-17
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Documentation fixes. * mg/doc-status-color-slot: config,completion: add color.status.unmerged
| * | | | config,completion: add color.status.unmergedMichael J Gruber2015-03-10
| | |_|/ | |/| | | | | | | | | | | | | | | | | | Reported-by: "Mladen B." <mladen074@gmail.com> Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | Merge branch 'sg/completion-remote'Junio C Hamano2015-03-17
|\ \ \ \ | |_|/ / |/| | | | | | | | | | | | | | | | | | | | | | | Code simplification. * sg/completion-remote: completion: simplify __git_remotes() completion: add a test for __git_remotes() helper function
| * | | completion: simplify __git_remotes()SZEDER Gábor2015-03-06
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The __git_remotes() helper function lists the remotes from the config file by processing the output of a 'git config' query. A simple 'git remote' produces the exact same output, so run that instead. Remotes under '$GIT_DIR/remotes' are still listed by running 'ls -1', because 'git remote' unfortunately ignores them. Signed-off-by: SZEDER Gábor <szeder@ira.uka.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Merge branch 'cj/log-invert-grep'Junio C Hamano2015-02-11
|\ \ \ | |/ / |/| | | | | | | | | | | | | | | | | "git log --invert-grep --grep=WIP" will show only commits that do not have the string "WIP" in their messages. * cj/log-invert-grep: log: teach --invert-grep option
| * | log: teach --invert-grep optionChristoph Junghans2015-01-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "git log --grep=<string>" shows only commits with messages that match the given string, but sometimes it is useful to be able to show only commits that do *not* have certain messages (e.g. "show me ones that are not FIXUP commits"). Originally, we had the invert-grep flag in grep_opt, but because "git grep --invert-grep" does not make sense except in conjunction with "--files-with-matches", which is already covered by "--files-without-matches", it was moved it to revisions structure. To have the flag there expresses the function to the feature better. When the newly inserted two tests run, the history would have commits with messages "initial", "second", "third", "fourth", "fifth", "sixth" and "Second", committed in this order. The commits that does not match either "th" or "Sec" is "second" and "initial". For the case insensitive case only "initial" matches. Signed-off-by: Christoph Junghans <ottxor@gentoo.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Merge branch 'tf/prompt-preserve-exit-status'Junio C Hamano2015-01-14
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using the exit status of the last command in the prompt, e.g. PS1='$(__git_ps1) $? ', did not work well because the helper function stomped on the exit status. * tf/prompt-preserve-exit-status: git-prompt: preserve value of $? in all cases
| * | | git-prompt: preserve value of $? in all casesTony Finch2015-01-14
| | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Tony Finch <dot@dotat.at> Reviewed-by: SZEDER Gábor <szeder@ira.uka.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | Merge branch 'rh/hide-prompt-in-ignored-directory'Junio C Hamano2015-01-14
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | * rh/hide-prompt-in-ignored-directory: git-prompt.sh: allow to hide prompt for ignored pwd git-prompt.sh: if pc mode, immediately set PS1 to a plain prompt
| * | | | git-prompt.sh: allow to hide prompt for ignored pwdJess Austin2015-01-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Optionally set __git_ps1 to display nothing when present working directory is ignored, triggered by the new environment variable GIT_PS1_HIDE_IF_PWD_IGNORED. This environment variable may be overridden on any repository by setting bash.hideIfPwdIgnored to "false". In the absence of GIT_PS1_HIDE_IF_PWD_IGNORED this change has no effect. Many people manage e.g. dotfiles in their home directory with git. This causes the prompt generated by __git_ps1 to refer to that "top level" repo while working in any descendant directory. That can be distracting, so this patch helps one shut off that noise. Signed-off-by: Jess Austin <jess.austin@gmail.com> Signed-off-by: Richard Hansen <rhansen@bbn.com> Reviewed-by: Richard Hansen <rhansen@bbn.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | git-prompt.sh: if pc mode, immediately set PS1 to a plain promptRichard Hansen2015-01-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At the beginning of __git_ps1, right after determining that the function is running in pc mode, set PS1 to a plain (undecorated) prompt. This makes it possible to simply return early without having to set PS1 if the prompt should not be decorated. Signed-off-by: Richard Hansen <rhansen@bbn.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | Merge branch 'mm/complete-rebase-autostash'Junio C Hamano2015-01-14
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | * mm/complete-rebase-autostash: git-completion: add --autostash for 'git rebase'
| * | | | | git-completion: add --autostash for 'git rebase'Matthieu Moy2015-01-07
| | |_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This option was added in 58794775 (rebase: implement --[no-]autostash and rebase.autostash, 2013-05-12). Completion of "--autosquash" has been there, but this was not; addition of this would require people completing "--autosquash" to type a bit more than before. Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | Merge branch 'tf/prompt-preserve-exit-status'Junio C Hamano2015-01-07
|\ \ \ \ \ | | |_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using the exit status of the last command in the prompt, e.g. PS1='$(__git_ps1) $? ', did not work well because the helper function stomped on the exit status. * tf/prompt-preserve-exit-status: git-prompt: preserve value of $? inside shell prompt
| * | | | git-prompt: preserve value of $? inside shell promptTony Finch2014-12-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If you have a prompt which displays the command exit status, __git_ps1 without this change corrupts it, although it has the correct value in the parent shell: ~/src/git (master) 0 $ set | grep ^PS1 PS1='\w$(__git_ps1) $? \$ ' ~/src/git (master) 0 $ false ~/src/git (master) 0 $ echo $? 1 ~/src/git (master) 0 $ There is a slightly ugly workaround: ~/src/git (master) 0 $ set | grep ^PS1 PS1='\w$(x=$?; __git_ps1; exit $x) $? \$ ' ~/src/git (master) 0 $ false ~/src/git (master) 1 $ This change makes the workaround unnecessary. Signed-off-by: Tony Finch <dot@dotat.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | Merge branch 'pd/completion-filenames-fix'Junio C Hamano2015-01-07
|\ \ \ \ \ | |_|_|/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The top-of-the-file instruction for completion scripts (in contrib/) did not name the files correctly. * pd/completion-filenames-fix: Update documentation occurrences of filename .sh
| * | | | Update documentation occurrences of filename .shPeter van der Does2014-12-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Documentation in the completion scripts for Bash and Zsh state the wrong filenames. Signed-off-by: Peter van der Does <peter@avirtualhome.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | Merge branch 'jg/prompt-localize-temporary'Junio C Hamano2014-12-22
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "git-prompt" (in contrib/) used a variable from the global scope, possibly contaminating end-user's namespace. * jg/prompt-localize-temporary: git-prompt.sh: make $f local to __git_eread()
| * | | | | git-prompt.sh: make $f local to __git_eread()Justin Guenther2014-12-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This function uses (non-local) $f to store the value of its first parameter. This can interfere with the user's environment. Signed-off-by: Justin Guenther <jguenther@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | Merge branch 'rt/completion-tag'Junio C Hamano2014-12-22
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | * rt/completion-tag: completion: add git-tag options
| * | | | | | completion: add git-tag optionsRalf Thielow2014-12-04
| | |_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add completion for git-tag options including all options that are currently shown in "git tag -h". Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | git-send-email: add --transfer-encoding optionPaolo Bonzini2014-11-25
| |_|_|/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The thread at http://thread.gmane.org/gmane.comp.version-control.git/257392 details problems when applying patches with "git am" in a repository with CRLF line endings. In the example in the thread, the repository originated from "git-svn" so it is not possible to use core.eol and friends on it. Right now, the best option is to use "git am --keep-cr". However, when a patch create new files, the patch application process will reject the new file because it finds a "/dev/null\r" string instead of "/dev/null". The problem is that SMTP transport is CRLF-unsafe. Sending a patch by email is the same as passing it through "dos2unix | unix2dos". The newly introduced CRLFs are normally transparent because git-am strips them. The keepcr=true setting preserves them, but it is mostly working by chance and it would be very problematic to have a "git am" workflow in a repository with mixed LF and CRLF line endings. The MIME solution to this is the quoted-printable transfer enconding. This is not something that we want to enable by default, since it makes received emails horrible to look at. However, it is a very good match for projects that store CRLF line endings in the repository. The only disadvantage of quoted-printable is that quoted-printable patches fail to apply if the maintainer uses "git am --keep-cr". This is because the decoded patch will have two carriage returns at the end of the line. Therefore, add support for base64 transfer encoding too, which makes received emails downright impossible to look at outside a MUA, but really just works. The patch covers all bases, including users that still live in the late 80s, by also providing a 7bit content transfer encoding that refuses to send emails with non-ASCII character in them. And finally, "8bit" will add a Content-Transfer-Encoding header but otherwise do nothing. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | Merge branch 'oc/mergetools-beyondcompare'Junio C Hamano2014-10-29
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | * oc/mergetools-beyondcompare: mergetool: rename bc3 to bc
| * | | | | mergetool: rename bc3 to bcJunio C Hamano2014-10-21
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Beyond Compare version 4 works the same way as version 3, so rename the existing "bc3" adaptor to just "bc", while keeping "bc3" as a backward compatible wrapper. Noticed-by: Olivier Croquette <ocroquette@free.fr> Helped-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | Merge branch 'jk/prompt-stash-could-be-packed' into maintJunio C Hamano2014-09-19
| |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | * jk/prompt-stash-could-be-packed: git-prompt: do not look for refs/stash in $GIT_DIR
* | \ \ \ \ Merge branch 'js/completion-hide-not-a-repo'Junio C Hamano2014-10-21
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some internal error messages leaked out of the bash completion when typing "git cmd <TAB>" and the machinery tried to complete refnames. * js/completion-hide-not-a-repo: completion: silence "fatal: Not a git repository" error
| * | | | | | completion: silence "fatal: Not a git repository" errorJohn Szakmeister2014-10-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is possible that a user is trying to run a git command and fail to realize that they are not in a git repository or working tree. When trying to complete an operation, __git_refs would fall to a degenerate case and attempt to use "git for-each-ref", which would emit the error. Hide this error message coming from "git for-each-ref". Signed-off-by: John Szakmeister <john@szakmeister.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | Merge branch 'jc/completion-no-chdir'Junio C Hamano2014-10-16
|\ \ \ \ \ \ \ | |/ / / / / / |/| | | | | | | | | | | | | | | | | | | | * jc/completion-no-chdir: completion: use "git -C $there" instead of (cd $there && git ...)
| * | | | | | completion: use "git -C $there" instead of (cd $there && git ...)Junio C Hamano2014-10-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have had "git -C $there" to first go to a different directory and run a Git command without changing the arguments for quite some time. Use it instead of (cd $there && git ...) in the completion script. This allows us to lose the work-around for misfeatures of modern interactive-minded shells that make "cd" unusable in scripts (e.g. end users' $CDPATH taking us to unexpected places in any POSIX shell, and chpwd functions spewing unwanted output in zsh). Based on Øystein Walle's idea, which was raised during the discussion on the solution by Brandon Turner for a problem zsh users had with RVM which mucks with chpwd_functions in users' environments (https://github.com/wayneeseguin/rvm/issues/3076). As $root variable, which is used to direct where to chdir to, is set to "." based on if $2 to __git_index_files is set (not if it is empty), the only caller of the function is fixed not to pass the optional $2 when it does not want us to switch to a different directory. Otherwise we would end up doing "git -C '' command...", which would not work. Maybe we would want "git -C '' command..." to mean "do not chdir anywhere", but that is a spearate topic. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | completion: add --show-signature for log and showDavid Aguilar2014-10-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | Merge branch 'tb/complete-diff-ignore-blank-lines'Junio C Hamano2014-09-19
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * tb/complete-diff-ignore-blank-lines: completion: Add --ignore-blank-lines for diff
| * | | | | | | completion: Add --ignore-blank-lines for diffThomas Braun2014-09-03
| | |_|_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Thomas Braun <thomas.braun@virtuell-zuhause.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | Merge branch 'jk/prompt-stash-could-be-packed'Junio C Hamano2014-09-09
|\ \ \ \ \ \ \ | |_|_|/ / / / |/| | | / / / | | |_|/ / / | |/| | | | | | | | | | | | | | | | | | | | | | The prompt script checked $GIT_DIR/ref/stash file to see if there is a stash, which was a no-no. * jk/prompt-stash-could-be-packed: git-prompt: do not look for refs/stash in $GIT_DIR
| * | | | | git-prompt: do not look for refs/stash in $GIT_DIRJeff King2014-08-25
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since dd0b72c (bash prompt: use bash builtins to check stash state, 2011-04-01), git-prompt checks whether we have a stash by looking for $GIT_DIR/refs/stash. Generally external programs should never do this, because they would miss packed-refs. That commit claims that packed-refs does not pack refs/stash, but that is not quite true. It does pack the ref, but due to a bug, fails to prune the ref. When we fix that bug, we would want to be doing the right thing here. Signed-off-by: Jeff King <peff@peff.net> Reviewed-by: Michael Haggerty <mhagger@alum.mit.edu> Reviewed-by: Ronnie Sahlberg <sahlberg@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | Merge branch 'jk/more-push-completion'Junio C Hamano2014-07-30
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * jk/more-push-completion: completion: complete `git push --force-with-lease=` completion: add some missing options to `git push` completion: complete "unstuck" `git push --recurse-submodules`
| * | | | | completion: complete `git push --force-with-lease=`John Keeping2014-07-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: John Keeping <john@keeping.me.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | completion: add some missing options to `git push`John Keeping2014-07-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: John Keeping <john@keeping.me.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | completion: complete "unstuck" `git push --recurse-submodules`John Keeping2014-07-22
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since the argument to `--recurse-submodules` is mandatory, it does not need to be stuck to the option with `=`. Signed-off-by: John Keeping <john@keeping.me.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | Merge branch 'sp/complete-ext-alias'Junio C Hamano2014-06-25
|\ \ \ \ \ | |/ / / / |/| | | | | | | | | | | | | | * sp/complete-ext-alias: completion: handle '!f() { ... }; f' and "!sh -c '...' -" aliases
| * | | | completion: handle '!f() { ... }; f' and "!sh -c '...' -" aliasesSteffen Prohaska2014-06-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | '!f() { ... }; f' and "!sh -c '....' -" are recommended patterns for declaring more complex aliases (see git wiki [1]). This commit teaches the completion to handle them. When determining which completion to use for an alias, an opening brace or single quote is now skipped, and the search for a git command is continued. For example, the aliases '!f() { git commit ... }' or "!sh -c 'git commit ...'" now trigger commit completion. Previously, the search stopped on the opening brace or quote, and the completion tried it to determine how to complete, which obviously was useless. The null command ':' is now skipped, so that it can be used as a workaround to declare the desired completion style. For example, the aliases !f() { : git commit ; if ... } f !sh -c ': git commit; if ...' - now trigger commit completion. Shell function declarations now work with or without space before the parens, i.e. '!f() ...' and '!f () ...' both work. [1] https://git.wiki.kernel.org/index.php/Aliases Signed-off-by: Steffen Prohaska <prohaska@zib.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>