fish で "fatal: not a git repository (or any of the parent directories): .git" と出るようになった

2021/8/12 追記 本家の fishline にて修正された

github.com

fish, version 3.3.1

fish を立ち上げると以下のようなエラー文が常に出るようになってしまった。 git で管理されたディレクトリに移るとまた別のエラー文が出る。

fatal: not a git repository (or any of the parent directories): .git
fatal: ambiguous argument '^^': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'

私の場合、プロンプトを小綺麗にするために fishline を使っているが、どうやらそこでの標準エラーへのリダイレクト部分でエラーが出ているようにある。 以下の commit のように修正したらエラー文がでなくなった。

change the way to redirect stderr · goropikari/fishline@4f8d706 · GitHub

昔は ^^ でリダイレクトしていたようだが fish のバージョンが上がって文法が変わったようだ。 リリースノートによると 3.3.0 の時点で ^ を使ったリダイレクトはデフォルトで無効になったらしい。 github.com