--- Begin Message ---
Package: git-phab
Version: 2.9.0~git20170531+6877964-1
Severity: normal
Tags: patch
Dear Maintainer,
The bash-completion script which git-phab installs has a syntax error
(missing } to end the function) and calls a function which is not
defined (_python_argcomplete_global). The errors were hidden due to
bash-completion redirecting stdout/stderr when loading completion
scripts, which is being changed in an upcoming version. See
https://github.com/scop/bash-completion/issues/506
I've attached a patch with a functional bash-completion script based on
the output of register-python-argcomplete3. See patch for specific
details.
Thanks,
Kevin
>From 5d3f5f2a52dcae25509384bc4c1fe708f4b5fb90 Mon Sep 17 00:00:00 2001
Message-Id: <5d3f5f2a52dcae25509384bc4c1fe708f4b5fb90.1615499214.git.kevin@kevinlocke.name>
From: Kevin Locke <kevin@kevinlocke.name>
Date: Thu, 11 Mar 2021 13:55:19 -0700
Subject: [PATCH] fix bash-completion script
The previous bash-completion script was non-functional. Replace it with
a functional bash-completion script generated using:
register-python-argcomplete3 git-phab | sed '
s/_python_argcomplete/_git_phab/
s/"$1"/git-phab/
s/COMP_LINE="$COMP_LINE"/COMP_LINE="${COMP_LINE\/git phab\/git-phab}"/'
The first replacement renames the completion function to _git_phab,
which is required by the bash-completion script for git to complete `git
phab`.
The second replacement invokes git-phab to perform the completion,
rather than the first function argument, since the git bash-completion
script does not pass any arguments to the completion function.
The third replaces 'git phab' with 'git-phab' in $COMP_LINE so that
argcomplete can recognize the script name when parsing $COMP_LINE.
Note: It would be possible to Build-Depend on python3-argcomplete and
generate this script during build. (See diffoscope for an example.)
However, making the above changes would be fragile, since the output of
register-python-argcomplete3 may change arbitrarily, so this patch uses
the edited script.
Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
---
debian/bash_completion.d/git-phab | 27 +++++++++++++++++++++------
1 file changed, 21 insertions(+), 6 deletions(-)
diff --git a/debian/bash_completion.d/git-phab b/debian/bash_completion.d/git-phab
index 6603f72..e9a3ea5 100644
--- a/debian/bash_completion.d/git-phab
+++ b/debian/bash_completion.d/git-phab
@@ -1,7 +1,22 @@
-function _git_phab()
-{
- COMP_WORDS=(git-phab ${COMP_WORDS[@]:2})
- COMP_CWORD=$((COMP_CWORD - 1))
- COMP_LINE=${COMP_LINE/git phab/git-phab}
- _python_argcomplete_global git-phab
+_git_phab() {
+ local IFS=$'\013'
+ local SUPPRESS_SPACE=0
+ if compopt +o nospace 2> /dev/null; then
+ SUPPRESS_SPACE=1
+ fi
+ COMPREPLY=( $(IFS="$IFS" \
+ COMP_LINE="${COMP_LINE/git phab/git-phab}" \
+ COMP_POINT="$COMP_POINT" \
+ COMP_TYPE="$COMP_TYPE" \
+ _ARGCOMPLETE_COMP_WORDBREAKS="$COMP_WORDBREAKS" \
+ _ARGCOMPLETE=1 \
+ _ARGCOMPLETE_SUPPRESS_SPACE=$SUPPRESS_SPACE \
+ git-phab 8>&1 9>&2 1>/dev/null 2>/dev/null) )
+ if [[ $? != 0 ]]; then
+ unset COMPREPLY
+ elif [[ $SUPPRESS_SPACE == 1 ]] && [[ "$COMPREPLY" =~ [=/:]$ ]]; then
+ compopt -o nospace
+ fi
+}
+complete -o nospace -o default -F _git_phab "git-phab"
--
2.30.1
--- End Message ---
--- Begin Message ---
Source: git-phab
Source-Version: 2.9.0~git20170531+6877964-2
Done: Andrej Shadura <andrewsh@debian.org>
We believe that the bug you reported is fixed in the latest version of
git-phab, which is due to be installed in the Debian FTP archive.
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to 985029@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Andrej Shadura <andrewsh@debian.org> (supplier of updated git-phab package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Format: 1.8
Date: Thu, 11 Mar 2021 23:44:16 +0100
Source: git-phab
Architecture: source
Version: 2.9.0~git20170531+6877964-2
Distribution: unstable
Urgency: medium
Maintainer: Debian QA Group <packages@qa.debian.org>
Changed-By: Andrej Shadura <andrewsh@debian.org>
Closes: 985029
Changes:
git-phab (2.9.0~git20170531+6877964-2) unstable; urgency=medium
.
[ Kevin Locke ]
* Fix bash-completion script (Closes: #985029).
Checksums-Sha1:
43ac690a41dac85d588fd878d8eb6a1a7f7d9516 1755 git-phab_2.9.0~git20170531+6877964-2.dsc
933334d5cbd519d7d9f0a163bbaf4b855a5c71ac 3240 git-phab_2.9.0~git20170531+6877964-2.debian.tar.xz
Checksums-Sha256:
b950751a114a09258f9f8cdcb100927f249ce54c3111fa7af48b2e621a91a044 1755 git-phab_2.9.0~git20170531+6877964-2.dsc
1f2ebdc48ebfe62a31caf94a9a8ec482b08b9d219a9670df29785b972accfa8e 3240 git-phab_2.9.0~git20170531+6877964-2.debian.tar.xz
Files:
9ba9e7cc5974d6467afa1c03065b2e4f 1755 utils optional git-phab_2.9.0~git20170531+6877964-2.dsc
07421b6640a70e1b7e1525f6e6965ce4 3240 utils optional git-phab_2.9.0~git20170531+6877964-2.debian.tar.xz
-----BEGIN PGP SIGNATURE-----
iHUEARYIAB0WIQSD3NF/RLIsyDZW7aHoRGtKyMdyYQUCYEqdkQAKCRDoRGtKyMdy
YZbUAQD38NN/HBoICxAf1lUqhUCeWlZs0/U0TiI+1kUDvqqeeAEAs7JZ5xzcgko3
WpzliDIJ2Rr18jRtsyZzYPxjVa4fFwI=
=6pmG
-----END PGP SIGNATURE-----
--- End Message ---