[Django] #19806: django_bash_completion clobbers upstream completion of ‘python’

2 views
Skip to first unread message

Django

unread,
Feb 11, 2013, 11:44:17 PM2/11/13
to django-...@googlegroups.com
#19806: django_bash_completion clobbers upstream completion of ‘python’
-------------------------------+--------------------
Reporter: andersk | Owner: nobody
Type: Uncategorized | Status: new
Component: Uncategorized | Version: 1.4
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------
`extras/django_bash_completion` now tries to complete `python manage.py`
in addition to `./manage.py` (#12174), but this results in the upstream
completion hook for `python` being entirely clobbered. For example, the
upstream hook completes `python -Q`, but this is lost when loading
`django_bash_completion`:

{{{
$ python -Q <TAB>
new old warn warnall
$ . extras/django_bash_completion
$ python -Q <TAB>
AUTHORS .git/ LICENSE setup.py
CONTRIBUTING.rst .gitattributes MANIFEST.in tests/
django/ .gitignore README.rst .tx/
docs/ .hgignore scripts/
extras/ INSTALL setup.cfg
}}}

That seems like a really unfriendly thing to do, especially on Linux
distros where merely installing the Django package pulls in
`django_bash_completion` automatically.

I don’t know of a way to install a completion hook for `python manage.py`
without clobbering all of `python`, so I would propose that the second
half of the script (starting at `_python_django_completion`) should be
deleted entirely. Users who want bash completion can type `./manage.py`
or `django-admin` instead.

--
Ticket URL: <https://code.djangoproject.com/ticket/19806>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Feb 22, 2013, 12:43:54 PM2/22/13
to django-...@googlegroups.com
#19806: django_bash_completion clobbers upstream completion of ‘python’
-------------------------------------+-------------------------------------
Reporter: andersk | Owner: nobody
Type: Bug | Status: new
Component: Core (Management | Version: 1.4
commands) | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: | Needs documentation: 0
Has patch: 0 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by carljm):

* needs_better_patch: => 0
* component: Uncategorized => Core (Management commands)
* needs_tests: => 0
* needs_docs: => 0
* type: Uncategorized => Bug
* stage: Unreviewed => Accepted


Comment:

Agreed, this is quite unfriendly.

--
Ticket URL: <https://code.djangoproject.com/ticket/19806#comment:1>

Django

unread,
Feb 24, 2013, 5:59:53 AM2/24/13
to django-...@googlegroups.com
#19806: django_bash_completion clobbers upstream completion of ‘python’
-------------------------------------+-------------------------------------
Reporter: andersk | Owner: anonymous
Type: Bug | Status: assigned

Component: Core (Management | Version: 1.4
commands) | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: | Needs documentation: 0
Has patch: 0 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by anonymous):

* owner: nobody => anonymous
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/19806#comment:2>

Django

unread,
Feb 24, 2013, 6:01:17 AM2/24/13
to django-...@googlegroups.com
#19806: django_bash_completion clobbers upstream completion of ‘python’
-------------------------------------+-------------------------------------
Reporter: andersk | Owner: kwadrat

Type: Bug | Status: assigned
Component: Core (Management | Version: 1.4
commands) | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: | Needs documentation: 0
Has patch: 0 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by kwadrat):

* owner: anonymous => kwadrat


--
Ticket URL: <https://code.djangoproject.com/ticket/19806#comment:3>

Django

unread,
Feb 24, 2013, 10:14:14 AM2/24/13
to django-...@googlegroups.com
#19806: django_bash_completion clobbers upstream completion of ‘python’
-------------------------------------+-------------------------------------
Reporter: andersk | Owner:
Type: Bug | Status: new

Component: Core (Management | Version: 1.4
commands) | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: | Needs documentation: 0
Has patch: 1 | Patch needs improvement: 0
Needs tests: 1 | UI/UX: 0

Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by kwadrat):

* owner: kwadrat =>
* status: assigned => new
* has_patch: 0 => 1
* needs_tests: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/19806#comment:4>

Django

unread,
Feb 24, 2013, 6:35:42 PM2/24/13
to django-...@googlegroups.com
#19806: django_bash_completion clobbers upstream completion of ‘python’
-------------------------------------+-------------------------------------
Reporter: andersk | Owner:
Type: Bug | Status: new
Component: Core (Management | Version: 1.4
commands) | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: | Needs documentation: 0
Has patch: 1 | Patch needs improvement: 0
Needs tests: 1 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (by andersk):

Copying the upstream completion for `python` is still unfriendly, because
the upstream completion might change, and things will break again if any
other package wants to extend `python` completion. Also, in bash-
completion 2, the preferred way to install completions is in `/usr/share
/bash-completion/completions/command_name` where they are loaded
dynamically (rather than all at once at startup), which will break this
anyway. This really needs some help from bash-completion upstream. Until
that happens, I still recommend that the completion for `python manage.py`
be removed entirely. For concreteness, I’ll attach that patch below.

--
Ticket URL: <https://code.djangoproject.com/ticket/19806#comment:5>

Django

unread,
12:19 AM (12 hours ago) 12:19 AM
to django-...@googlegroups.com
#19806: django_bash_completion clobbers upstream completion of ‘python’
-------------------------------------+-------------------------------------
Reporter: Anders Kaseorg | Owner: (none)
Type: Bug | Status: new
Component: Core (Management | Version: 1.4
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by vaaiiibbhav):

* needs_tests: 1 => 0

--
Ticket URL: <https://code.djangoproject.com/ticket/19806#comment:6>

Django

unread,
12:23 AM (12 hours ago) 12:23 AM
to django-...@googlegroups.com
#19806: django_bash_completion clobbers upstream completion of ‘python’
-------------------------------------+-------------------------------------
Reporter: Anders Kaseorg | Owner: (none)
Type: Bug | Status: new
Component: Core (Management | Version: 1.4
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Vaibhav Verma):

https://github.com/django/django/pull/21644
--
Ticket URL: <https://code.djangoproject.com/ticket/19806#comment:7>

Django

unread,
12:29 AM (12 hours ago) 12:29 AM
to django-...@googlegroups.com
#19806: django_bash_completion clobbers upstream completion of ‘python’
-------------------------------------+-------------------------------------
Reporter: Anders Kaseorg | Owner:
| vaaiiibbhav
Type: Bug | Status: assigned
Component: Core (Management | Version: 1.4
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by vaaiiibbhav):

* owner: (none) => vaaiiibbhav
* status: new => assigned

--
Ticket URL: <https://code.djangoproject.com/ticket/19806#comment:8>

Django

unread,
8:48 AM (4 hours ago) 8:48 AM
to django-...@googlegroups.com
#19806: django_bash_completion clobbers upstream completion of ‘python’
-------------------------------------+-------------------------------------
Reporter: Anders Kaseorg | Owner: Vaibhav
| Verma
Type: Bug | Status: assigned
Component: Core (Management | Version: 1.4
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls):

* needs_better_patch: 0 => 1

--
Ticket URL: <https://code.djangoproject.com/ticket/19806#comment:9>
Reply all
Reply to author
Forward
0 new messages