Bug#980754: yadm:bash completions does not work

2021-01-31 Thread Russ Allbery
Russ Allbery  writes:
> YABUKI Yukiharu  writes:

>> I use yadm with bash. I use yadm command frequency. Once a day, yadm
>> works fine with bash. But nowadays, yadm does not do completions with
>> bash. I just switch in zsh. It look yadm completion is fine.

> This works for me on one system and not on another, both with the same
> version of yadm, so I think something changed in bash.  On the working
> system, I have bash 5.1~rc2-1, and on the broken system, I have bash
> 5.1-2.  Both have the same version of bash-completion.

> I haven't yet tracked down what the change was.

I found the problem, and I think it's a change in Git.  The yadm
completion rules delegate some of the work to the Git completion rules,
but the Git completion rules were restructured to remove an old
compatibility function that yadm was relying on.

The following diff seems to fix the problem.  I'm not sure if there's a
better solution.  This is upstream issue
https://github.com/TheLocehiliosan/yadm/issues/318 (although the symptoms
there are different).

--- yadm.bash.orig  2021-01-31 12:49:38.002713695 -0800
+++ yadm.bash   2021-01-31 12:46:10.194337545 -0800
@@ -1,10 +1,10 @@
 # test if git completion is missing, but loader exists, attempt to load
-if ! declare -F _git > /dev/null && declare -F _completion_loader > /dev/null; 
then
+if ! declare -F _git > /dev/null && ! declare -F __git > /dev/null && declare 
-F _completion_loader > /dev/null; then
   _completion_loader git
 fi
 
 # only operate if git completion is present
-if declare -F _git > /dev/null; then
+if declare -F _git > /dev/null || declare -F __git > /dev/null; then
 
   _yadm() {
 
@@ -66,7 +66,11 @@
 if [[ " ${yadm_switches[*]} " != *" $penultimate "* ]]; then
   # TODO: somehow solve the problem with [--yadm-xxx option] being
   #   incompatible with what git expects, namely [--arg=option]
-  _git
+  if declare -F _git > /dev/null; then
+_git
+  else
+__git_wrap__git_main
+  fi
 fi
 if [[ "$current" =~ ^- ]]; then
   local matching

-- 
Russ Allbery (r...@debian.org)  



Bug#980754: yadm:bash completions does not work

2021-01-21 Thread Russ Allbery
YABUKI Yukiharu  writes:

> I use yadm with bash. I use yadm command frequency. Once a day, yadm
> works fine with bash. But nowadays, yadm does not do completions with
> bash. I just switch in zsh. It look yadm completion is fine.

This works for me on one system and not on another, both with the same
version of yadm, so I think something changed in bash.  On the working
system, I have bash 5.1~rc2-1, and on the broken system, I have bash
5.1-2.  Both have the same version of bash-completion.

I haven't yet tracked down what the change was.

-- 
Russ Allbery (r...@debian.org)  



Bug#980754: yadm:bash completions does not work

2021-01-21 Thread YABUKI Yukiharu
Package: yadm
Version: 2.5.0-2
Severity: normal

Dear Maintainer,

I use yadm with bash. I use yadm command frequency. Once a day, yadm
works fine with bash. But nowadays, yadm does not do completions with
bash. I just switch in zsh. It look yadm completion is fine.

I checked vanilla bash environment with yadm. yadm with bash_completion
does not work.

Who works yadm with bash_completions fine?

Best regards, Yukiharu

-- System Information:
Debian Release: bullseye/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 5.10.0-1-amd64 (SMP w/8 CPU threads)
Kernel taint flags: TAINT_WARN, TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=ja_JP.UTF-8, LC_CTYPE=ja_JP.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages yadm depends on:
ii  git  1:2.30.0-1

yadm recommends no packages.

yadm suggests no packages.

-- no debconf information