Bug 272246

Summary: shells/fish: please add upstream patch that fixes zfs tab completion
Product: Ports & Packages Reporter: Dave Cottlehuber <dch>
Component: Individual Port(s)Assignee: Alan Somers <asomers>
Status: Closed FIXED    
Severity: Affects Some People CC: freebsd, fuz, pat
Priority: --- Flags: asomers: maintainer-feedback+
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
Fix "zfs list" tab completion asomers: maintainer-approval+

Description Dave Cottlehuber freebsd_committer freebsd_triage 2023-06-27 12:22:48 UTC
3.6.1 broke zfs tabcompletion.

This straightforward patch (which will end up in 3.6.2) fixes it:

curl -so - https://github.com/fish-shell/fish-shell/commit/85504ca694ae099f023ae0febb363238d9c64e8d.diff | doas patch -p3


error without this patch:

> zfs lsitread: _: cannot overwrite read-only variable
/usr/local/share/fish/functions/__fish_is_zfs_feature_enabled.fish (line 12):
    echo $feature_name | read -l _ _ state _
    ^
in function '__fish_is_zfs_feature_enabled' with arguments 'feature@bookmarks'
        called on line 344 of file /usr/local/share/fish/completions/zfs.fish
from sourcing file /usr/local/share/fish/completions/zfs.fish

(Type 'help read' for related documentation)
read: _: cannot overwrite read-only variable
/usr/local/share/fish/functions/__fish_is_zfs_feature_enabled.fish (line 12):
    echo $feature_name | read -l _ _ state _
    ^
in function '__fish_is_zfs_feature_enabled' with arguments 'feature@bookmarks'
        called on line 508 of file /usr/local/share/fish/completions/zfs.fish
from sourcing file /usr/local/share/fish/completions/zfs.fish

(Type 'help read' for related documentation)
read: _: cannot overwrite read-only variable
/usr/local/share/fish/functions/__fish_is_zfs_feature_enabled.fish (line 12):
    echo $feature_name | read -l _ _ state _
    ^
in function '__fish_is_zfs_feature_enabled' with arguments 'feature@extensible_dataset'
        called on line 548 of file /usr/local/share/fish/completions/zfs.fish
from sourcing file /usr/local/share/fish/completions/zfs.fish

(Type 'help read' for related documentation)
Comment 1 Alan Somers freebsd_committer freebsd_triage 2023-06-27 14:21:53 UTC
That sounds pretty annoying.  Do you have a link to the PR that fixed the bug upstream?
Comment 2 Dave Cottlehuber freebsd_committer freebsd_triage 2023-09-05 19:12:02 UTC
https://github.com/fish-shell/fish-shell/issues/9705 not sure
when next fish release is planned?
Comment 3 Alan Somers freebsd_committer freebsd_triage 2023-09-05 23:17:26 UTC
Created attachment 244670 [details]
Fix "zfs list" tab completion
Comment 4 Robert Clausecker freebsd_committer freebsd_triage 2023-09-08 15:05:22 UTC
LGTM
Comment 5 commit-hook freebsd_committer freebsd_triage 2023-09-08 15:10:02 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=172aee05e04b38a163213014f1fd37f873eec2cf

commit 172aee05e04b38a163213014f1fd37f873eec2cf
Author:     Alan Somers <asomers@FreeBSD.org>
AuthorDate: 2023-09-05 23:14:14 +0000
Commit:     Alan Somers <asomers@FreeBSD.org>
CommitDate: 2023-09-08 15:09:07 +0000

    shells/fish: fix ZFS tab completion

    It's already fixed upstream, but not yet in any release, with no ETA.

    PR:             272246
    Reported by:    dch
    Sponsored by:   Axcient
    Approved by:    fuz (ports)

 shells/fish/Makefile | 4 ++++
 shells/fish/distinfo | 4 +++-
 2 files changed, 7 insertions(+), 1 deletion(-)