Re: [PATCH 13/14] completion: add default options
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Jun 22, 2019, 03:01 UTC
- Message-ID
- <CACsJy8AATA-7Z+HsA80NQ2j4Z9JeuSYXiBZLi=7FopzfLY1R+w@mail.gmail.com>
- In-Reply-To
- <20190621223107.8022-14-felipe.contreras@gmail.com>
On Sat, Jun 22, 2019 at 5:31 AM Felipe Contreras <felipe.contreras@gmail.com> wrote:
Show 21 quoted lines
> > Versions of Git older than v2.17 don't know about > --git-completion-helper, so provide some defaults for them. > > Also, some commands fail if there's no Git repository available. > > Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> > --- > contrib/completion/git-completion.bash | 97 +++++++++++++++++++++++++- > t/t9902-completion.sh | 4 +- > 2 files changed, 98 insertions(+), 3 deletions(-) > > diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash > index d3ee6c7dc2..922ba5f925 100644 > --- a/contrib/completion/git-completion.bash > +++ b/contrib/completion/git-completion.bash > @@ -377,6 +377,100 @@ else > unset $(compgen -v __gitcomp_builtin_) > fi > > +__gitcomp_builtin_add_default=" --dry-run --verbose --interactive --patch --edit --force --update --renormalize --intent-to-add --all --ignore-
removal --refresh --ignore-errors --ignore-missing --chmod= --no-dry-run -- --no-verbose --no-interactive --no-patch --no-edit --no-force --no-update --no-renormalize --no-intent-to-add --no-all --no-ignore-removal --no-refresh --no-ignore-errors --no-ignore-missing --no-chmod"
And who's going to keep these uptodate? If you do this, might as well delete --git-completion-helper
A more acceptable option might be regenerate git-completion.bash and run --git-completion-helper to generate these, or make git-completion.bash source a generated file. But that might need some more build infrastructure, and people who just one to copy the file might not like it.
-- Duy