All of lore.kernel.org
 help / color / mirror / Atom feed
From: Harrison McCullough <mccullough.harrison@gmail.com>
To: git@vger.kernel.org
Subject: Error in bash completion
Date: Wed, 16 Jun 2021 09:44:38 -0600	[thread overview]
Message-ID: <CAHLeu+y3DxLv7M4SM2f5yVxtKXbpAWD7Ad2m+rVKpKfKiA6PVw@mail.gmail.com> (raw)

What did you do before the bug happened? (Steps to reproduce your issue)

1. Create a Bash function, e.g. `ga() { git add "${@:-.}"; }`
2. Use the `__git_complete` function to add Bash tab completion for your custom
   Bash function, e.g. `__git_complete ga git_add`
3. Attempt to tab complete a file path, e.g. `ga my-incomplete-file-path<TAB>`


What did you expect to happen? (Expected behavior)

Bash tab-completes the file path.


What happened instead? (Actual behavior)

Bash tab-completes the file path but also displays an error:

$ ga fi-bash: [: -lt: unary operator expected
le3.txt

(This is when I was using tab completion to add a file called `file3.txt`).


What's different between what you expected and what actually happened?

I do not expect using tab completion to display an error.


Anything else you want to add:

I have tested this with a minial setup with Bash version 5.1.8(1)-release with
no other files sourced at startup except
/usr/local/Cellar/git/2.32.0/etc/bash_completion.d/git-completion.bash

[System Info]
git version:
git version 2.32.0
cpu: x86_64
no commit associated with this build
sizeof-long: 8
sizeof-size_t: 8
shell-path: /bin/sh
uname: Darwin 20.5.0 Darwin Kernel Version 20.5.0: Sat May  8 05:10:33
PDT 2021; root:xnu-7195.121.3~9/RELEASE_X86_64 x86_64
compiler info: clang: 12.0.5 (clang-1205.0.22.9)
libc info: no libc information available
$SHELL (typically, interactive shell): /usr/local/bin/bash


[Enabled Hooks]

-Harrison McCullough

             reply	other threads:[~2021-06-16 15:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-16 15:44 Harrison McCullough [this message]
2021-06-16 17:40 ` Error in bash completion Denton Liu
2021-06-16 18:05   ` Harrison McCullough
2021-06-16 19:19   ` Felipe Contreras
2021-06-17  2:06 ` Felipe Contreras
2021-06-17  2:15   ` Harrison McCullough

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAHLeu+y3DxLv7M4SM2f5yVxtKXbpAWD7Ad2m+rVKpKfKiA6PVw@mail.gmail.com \
    --to=mccullough.harrison@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.